PowerShell Logo Small

Rename-ADObject



This is the built-in help made by Microsoft for the command 'Rename-ADObject', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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

Changes the name of an Active Directory object.

SYNTAX


Rename-ADObject [-Identity] <ADObject> [-NewName] <String> [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Partition <String>]
[-PassThru [<SwitchParameter>]] [-Server <String>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Rename-ADObject cmdlet renames an Active Directory object. This cmdlet sets the Name property of an Active Directory object that has an
LDAP Display Name (ldapDisplayName) of "name". To modify the given name, surname and other name of a user, use the Set-ADUser cmdlet. To
modify the Security Accounts Manager (SAM) account name of a user, computer, or group, use the Set-ADUser, Set-ADComputer or Set-ADGroup
cmdlet.


The Identity parameter specifies the object to rename. 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
Rename-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 NewName parameter defines the new name for the object and must be specified.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219341
Get-ADObject
Move-ADObject
New-ADObject
Remove-ADObject
Restore-ADObject
Set-ADObject

REMARKS

<

Examples


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

C:\PS>Rename-ADObject -Identity "CN=HQ,CN=Sites,CN=Configuration,DC=FABRIKAM,DC=COM" -NewName UnitedKingdomHQ



Description

-----------

Rename the name of an existing site 'HQ' to the new name 'UnitedKingdomHQ'. If the distinguished name is provided in the -Identity parameter,
then the -Partition parameter is not required.




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

C:\PS>Rename-ADObject -Identity "4777c8e8-cd29-4699-91e8-c507705a0966" -NewName "AmsterdamHQ" -Partition "CN=Configuration,DC=FABRIKAM,DC=COM"



Description

-----------

Rename the object with objectGUID '4777c8e8-cd29-4699-91e8-c507705a096'6 to 'SiteNewName'. Note -Partition parameter is required because the
Naming Context of the site object is not known from the GUID provided to the -Identity parameter.




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

C:\PS>Rename-ADObject "OU=ManagedGroups,OU=Managed,DC=Fabrikam,DC=Com" -NewName Groups



Description

-----------

Rename the object with the DistinguisehdName 'OU=ManagedGroups,OU=Managed,DC=Fabrikam,DC=Com' to 'Groups'.




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

C:\PS>Rename-ADObject -Identity "4777c8e8-cd29-4699-91e8-c507705a0966" -NewName "DavidAhs"



Description

-----------

Rename the object with objectGUID '4777c8e8-cd29-4699-91e8-c507705a0966' to 'DavidAhs'. Note that the -Partition parameter is not specified
because the object is in the Default Naming Context of the domain.




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

C:\PS>Rename-ADObject "CN=Apps,DC=AppNC" -NewName "InternalApps" -server "FABRIKAM-SRV1:60000"



Description

-----------

Rename the container 'CN=Apps,DC=AppNC' to 'InternalApps' in an LDS instance.