PowerShell Logo Small

Move-ADObject



This is the built-in help made by Microsoft for the command 'Move-ADObject', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Moves an Active Directory object or a container of objects to a different container or domain.

SYNTAX


Move-ADObject [-Identity] <ADObject> [-TargetPath] <String> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Partition <String>] [-PassThru] [-Server <String>]
[-TargetServer <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Move-ADObject cmdlet moves an object or a container of objects from one container to another or from one domain to another.


The Identity parameter specifies the Active Directory object or container to move. You can identify an object or container by its distinguished name (DN) or GUID. You can
also set the Identity parameter to an object variable such as $<localObject>, or you can pass an object through the pipeline to the Identity parameter. For example, you can
use the Get-ADObject cmdlet to retrieve an object and then pass the object through the pipeline to the Move-ADObject cmdlet. You can also use the Get-ADGroup, Get-ADUser,
Get-ADComputer, Get-ADServiceAccount, Get-ADOrganizationalUnit, and Get-ADFineGrainedPasswordPolicy cmdlets to get an object that you can pass through the pipeline to this
cmdlet.


The TargetPath parameter must be specified. This parameter identifies the new location for the object or container.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=291059
Get-ADObject
New-ADObject
Remove-ADObject
Rename-ADObject
Restore-ADObject
Set-ADObject

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>Move-ADObject -Identity "OU=ManagedGroups,DC=Fabrikam,DC=Com" -TargetPath "OU=Managed,DC=Fabrikam,DC=Com"



This command moves the Organizational Unit ManagedGroups to a new location. The OU ManagedGroups must not be protected from accidental deletion for the successful move.




-------------------------- EXAMPLE 2 --------------------------

PS C:\>Move-ADObject -Identity "8d0bcc44-c826-4dd8-af5c-2c69960fbd47" -TargetPath "OU=Managed,DC=Fabrikam,DC=Com"



This command moves the object identified by the specified GUID to the new location.




-------------------------- EXAMPLE 3 --------------------------

PS C:\>Move-ADObject -Identity "8d0bcc44-c826-4dd8-af5c-2c69960fbd47" -TargetPath "1c2ea8a8-c2b7-4a87-8190-0e8a166aee16"



This command moves an object to a new location. Both the object and the target path are specified using GUIDs.




-------------------------- EXAMPLE 4 --------------------------

PS C:\>Move-ADObject -Identity "CN=Peter Bankov,OU=Accounting,DC=Fabrikam,DC=com" -TargetPath "OU=Accounting,DC=Europe,DC=Fabrikam,DC=com" -TargetServer
"server01.europe.fabrikam.com"



This command moves an object with DistinguishedName CN=Peter Bankov,OU=Accounting,DC=Fabrikam,DC=com to a different domain.




-------------------------- EXAMPLE 5 --------------------------

PS C:\>Move-ADObject -Identity "CN=AccountLeads,DC=AppNC" -TargetPath "OU=AccountDeptOU,DC=AppNC" -Server "FABRIKAM-SRV1:60000"



This command moves an object to a new location within an LDS instance.