PowerShell Logo Small

Rename-ADObject



This is the built-in help made by Microsoft for the command 'Rename-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

Changes the name of an Active Directory object.

SYNTAX


Rename-ADObject [-Identity] <ADObject> [-NewName] <String> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Partition <String>] [-PassThru] [-Server <String>]
[-Confirm] [-WhatIf] [<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/p/?linkid=291102
Get-ADObject
Move-ADObject
New-ADObject
Remove-ADObject
Restore-ADObject
Set-ADObject

REMARKS

<

Examples


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

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



This command renames 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 --------------------------

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



This command renames the object with objectGUID 4777c8e8-cd29-4699-91e8-c507705a0966 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 --------------------------

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



This command renames the object with the DistinguisedName OU=ManagedGroups,OU=Managed,DC=Fabrikam,DC=Com to Groups.




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

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



This command renames 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 --------------------------

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



This command renames the container CN=Apps,DC=AppNC to InternalApps in an LDS instance.