TestimoX

API Reference

Command

Test-ADXMigrationPlan

Namespace ADPlayground.PowerShell
Inputs
ADPlayground.Migrations.Core.AdMigrationPlan
Outputs
ADPlayground.Migrations.Core.AdMigrationPlan System.Boolean

Tests whether an AD migration plan has blocking issues.

Examples

Authored help example

Example 1: Build, validate, preview, and apply a small migration 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 -CredentialStrategy ResetRandom -MigrateMembership
                New-ADXMigrationComputer -SourceSamAccountName 'PC001$' -OfflineDomainJoin -MigrateProfile
                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: Display blockers, warnings, and planned phases before apply.


$checked = $plan | Test-ADXMigrationPlan -PassThru
            $checked.PreflightChecks | Format-Table Kind, Severity, IsSatisfied, Code, Target, Message -AutoSize
            $checked.Issues | Format-Table Severity, Code, Target, Message -AutoSize
            $checked.Phases | Format-Table Kind, Item, IsMutating, RequiresMachineExecutor, Description -AutoSize
        

Example 3: Review SIDHistory prerequisites and phases included by the main migration workflow.


$checked = $plan | Test-ADXMigrationPlan -PassThru
            $checked.Request.Defaults | Select-Object SourceDomain, DestinationDomain, SourceAuditReady, SourceTcpipClientSupportReady, ResourceAclScanCompleted
            $checked.PreflightChecks | Where-Object Kind -eq SidHistory | Format-Table Severity, IsSatisfied, Code, Message -AutoSize
            $checked.Phases | Where-Object Kind -eq SidHistory | Format-Table Item, Description -AutoSize
        

Example 4: Review phases that need machine-side or external executors before scheduling rollout.


$plan | Test-ADXMigrationPlan -PassThru |
                Select-Object -ExpandProperty Phases |
                Where-Object { $_.RequiresMachineExecutor -or $_.Kind -in 'ComputerJoin','Profile','ResourceReAcl' } |
                Format-Table Kind, Item, RequiresMachineExecutor, Description -AutoSize
        

Example 5: Confirm that apply will include post-state validation for objects, SIDHistory, memberships, and resources.


$checked = $plan | Test-ADXMigrationPlan -PassThru
            $checked.Phases | Where-Object Kind -eq Validate | Format-Table Kind, Item, Description -AutoSize
            $result = $checked | Invoke-ADXMigrationPlan -Intent read_write -AllowWrite -Apply -WriteExecutionId mig-2026-001 -WriteActorId pklys -WriteChangeReason CAB-1234 -WriteRollbackPlanId rollback-CAB-1234
            $result.Phases | Where-Object Kind -eq Validate | Format-Table Item, Status, Message -AutoSize
            $result.Phases | Where-Object Kind -eq Validate | Select-Object -ExpandProperty Checks | Format-Table Code, Success, Message -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

Test-ADXMigrationPlan -Plan <AdMigrationPlan> [-PassThru] [<CommonParameters>]
#

Parameters

Plan AdMigrationPlan requiredposition: namedpipeline: true (ByValue)
Migration plan to validate.
PassThru SwitchParameter optionalposition: namedpipeline: false
Returns the full plan instead of a Boolean validation result.

Outputs

ADPlayground.Migrations.Core.AdMigrationPlan, System.Boolean