TestimoX

API Reference

Command

New-ADXMigrationUser

Namespace ADPlayground.PowerShell
Outputs
ADPlayground.Migrations.Core.AdMigrationPrincipalItem

Creates a typed user item for an AD migration plan.

Examples

Authored help example

Example 1: Add a user to a complete migration plan, then validate, preview, and apply the plan.


$plan = New-ADXMigrationPlan -SourceDomain old.contoso.com -DestinationDomain new.contoso.com -SourceDomainController old-pdc.old.contoso.com -DestinationDomainController new-dc01.new.contoso.com -DestinationOrganizationalUnit 'OU=Migrated,DC=new,DC=contoso,DC=com' -SourceAuditReady -SourceTcpipClientSupportReady -ResourceAclScanCompleted -BusinessJustification CAB-1234 {
                New-ADXMigrationUser -SourceSamAccountName alice -DestinationSamAccountName alice -CopyAttribute mail,displayName,department,title -CredentialStrategy ResetRandom -MigrateMembership
                New-ADXMigrationResource -Path '\\FS1\Finance' -ReAclMode AddDestinationBeforeRemoveSource
            }
            if ($plan | Test-ADXMigrationPlan) {
                $preview = $plan | Invoke-ADXMigrationPlan
                $preview.Phases | Format-Table Kind, Item, Status, Changed, Message -AutoSize
                $plan | Invoke-ADXMigrationPlan -Intent read_write -AllowWrite -Apply -WriteExecutionId mig-2026-001 -WriteActorId pklys -WriteChangeReason CAB-1234 -WriteRollbackPlanId rollback-CAB-1234
            }
        

Example 2: Plan a user with a temporary password reference and inspect credential and SIDHistory phases before apply.


$plan = New-ADXMigrationPlan -SourceDomain old.contoso.com -DestinationDomain new.contoso.com -DestinationOrganizationalUnit 'OU=Migrated,DC=new,DC=contoso,DC=com' -SourceAuditReady -SourceTcpipClientSupportReady -ResourceAclScanCompleted -BusinessJustification CAB-1234 {
                New-ADXMigrationUser -SourceSamAccountName bob -CredentialStrategy SetTemporary -CredentialSecretReference 'vault://migration/CAB-1234/bob-temp' -ForceCredentialChangeAtNextLogon
            }
            $checked = $plan | Test-ADXMigrationPlan -PassThru
            $checked.Issues | Format-Table Severity, Code, Target, Message -AutoSize
            $checked.Phases | Where-Object { $_.Kind -in 'PrepareDestination','CredentialStrategy','SidHistory','Validate' } | Format-Table Kind, Item, Description -AutoSize
        

Example 3: Use an external password filter or sync provider instead of PES/hash-copy style password migration.


$plan = New-ADXMigrationPlan -SourceDomain old.contoso.com -DestinationDomain new.contoso.com -DestinationOrganizationalUnit 'OU=Migrated,DC=new,DC=contoso,DC=com' -SourceAuditReady -SourceTcpipClientSupportReady -ResourceAclScanCompleted -BusinessJustification CAB-1234 {
                New-ADXMigrationUser -SourceSamAccountName carol -CredentialStrategy ExternalSyncProvider -CredentialProviderName 'Evotec.PasswordSync' -MigrateMembership
            }
            $plan | Test-ADXMigrationPlan -PassThru | Select-Object -ExpandProperty Phases | Format-Table Kind, Item, IsMutating, Description -AutoSize
            $plan | Invoke-ADXMigrationPlan
        

Example 4: Skip SIDHistory only after replacement access and resource re-ACL work are represented in the plan.


$plan = New-ADXMigrationPlan -SourceDomain old.contoso.com -DestinationDomain new.contoso.com -DestinationOrganizationalUnit 'OU=Migrated,DC=new,DC=contoso,DC=com' -ResourceAclScanCompleted -BusinessJustification CAB-1234 {
                New-ADXMigrationUser -SourceSamAccountName dave -NoSidHistory -CredentialStrategy Manual
                New-ADXMigrationResource -Path '\\FS1\Archive' -ReAclMode ReportOnly
            }
            $plan | Test-ADXMigrationPlan -PassThru | Select-Object -ExpandProperty Phases | Format-Table Kind, Item, Description -AutoSize
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

New-ADXMigrationUser -SourceSamAccountName <string> [-AllowPrivilegedSidHistory] [-Attribute <Hashtable>] [-CommonName <string>] [-CopyAttribute <string[]>] [-CredentialProviderName <string>] [-CredentialSecretReference <string>] [-CredentialStrategy <ResetRandom|SetTemporary|SetKnown|ExternalSyncProvider|Manual>] [-Description <string>] [-DestinationOrganizationalUnit <string>] [-DestinationSamAccountName <string>] [-DisplayName <string>] [-ForceCredentialChangeAtNextLogon] [-Mail <string>] [-MigrateMembership] [-NoSidHistory] [-SkipDestinationPreparation] [-UserPrincipalName <string>] [<CommonParameters>]
#

Parameters

SourceSamAccountName string requiredposition: namedpipeline: false
Source SAM account name.
AllowPrivilegedSidHistory SwitchParameter optionalposition: namedpipeline: false
Allows privileged SIDHistory when explicitly approved.
Attribute Hashtable optionalposition: namedpipeline: false
Explicit destination attributes to set during preparation.
CommonName string optionalposition: namedpipeline: false
Optional destination common name.
CopyAttribute string[] optionalposition: namedpipeline: false
Attribute names to copy from source to destination.
CredentialProviderName string optionalposition: namedpipeline: false
External credential sync provider name.
CredentialSecretReference string optionalposition: namedpipeline: false
Secret reference for supplied-password strategies. Do not pass cleartext passwords.
CredentialStrategy AdMigrationCredentialStrategy optionalposition: namedpipeline: falsevalues: 5
Credential handling strategy. Possible values: None, ResetRandom, SetTemporary, SetKnown, ExternalSyncProvider, Manual
Possible values: ResetRandom, SetTemporary, SetKnown, ExternalSyncProvider, Manual
Description string optionalposition: namedpipeline: false
Optional destination description.
DestinationOrganizationalUnit string optionalposition: namedpipeline: false
Destination organizational unit distinguished name.
DestinationSamAccountName string optionalposition: namedpipeline: false
Destination SAM account name. Defaults to the source SAM account name.
DisplayName string optionalposition: namedpipeline: false
Optional destination display name.
ForceCredentialChangeAtNextLogon SwitchParameter optionalposition: namedpipeline: false
Forces credential change at next logon after reset/set strategies.
Mail string optionalposition: namedpipeline: false
Optional destination mail address.
MigrateMembership SwitchParameter optionalposition: namedpipeline: false
Requests source group membership migration.
NoSidHistory SwitchParameter optionalposition: namedpipeline: false
Disables SIDHistory continuity for this item.
SkipDestinationPreparation SwitchParameter optionalposition: namedpipeline: false
Skips destination object creation/update preparation.
UserPrincipalName string optionalposition: namedpipeline: false
Optional destination user principal name.

Outputs

ADPlayground.Migrations.Core.AdMigrationPrincipalItem