Rename-ADObject

Change 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]

Key
   -AuthType {Negotiate | Basic}
       The authentication method to use: Negotiate (or 0), Basic (or 1)
       A Secure Sockets Layer (SSL) connection is required for Basic authentication.

   -Credential PSCredential
       The user account credentials to use to perform this task.
       The default credentials are those of the currently logged on user unless the
       cmdlet is run from an Active Directory PowerShell provider drive.
       If the cmdlet is run from such a provider drive, the account associated with the drive is the default.

       Type a user name, such as "User64" or "Domain64\User64" or specify a
       PSCredential object such as one generated by Get-Credential 

       If a user name is specified, the cmdlet will prompt for a password.

   -Identity ADObject
       An AD object. Most often this will be a Distinguished Name (e.g. CN=sample1,OU=demo,DC=SS64,DC=com)
       The identity may also be given as a GUID.

       Derived types, such as the following are also accepted:
          [Microsoft.ActiveDirectory.Management.]
            ADGroup,ADUser,ADComputer,ADServiceAccount,ADFineGrainedPasswordPolicy,ADDomain

       The cmdlet searches the default naming context or partition to find the object.
       If two or more objects are found, the cmdlet returns a non-terminating error.

       The ADObject may also be passed through the pipeline or set via a variable.

   -NewName string
       The new name of the object.
       This parameter sets the Name property of the AD object.

   -Partition string
       The distinguished name of an AD partition.
       string must be one of the naming contexts on the current directory server.
       The cmdlet searches this partition to find the object defined by the -Identity parameter.
       Examples:
         -Partition "CN=Configuration,DC=EUROPE,DC=TEST,DC=SS64,DC=COM"
         -Partition "CN=Schema,CN=Configuration,DC=EUROPE,DC=TEST,DC=SS64,DC=COM"

       In many cases, a default value will be used for -Partition if no value is specified.

   -PassThru
       Return the new or modified object.
       By default (i.e. if -PassThru is not specified), this cmdlet does not generate any output.
 
   -Server string
       The AD Domain Services instance to connect to, this may be a Fully qualified domain name,
       NetBIOS name, Fully qualified directory server name (with or without port number)

   -Confirm
       Prompt for confirmation before executing the command.

   -WhatIf
       Describe what would happen if you executed the command without actually executing the command.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Rename-ADObject renames the -Name property of an AD object. To modify the given name, surname or other name of a user, use Set-ADUser.

To modify the Security Accounts Manager (SAM) account name of a user, computer, or group, use Set-ADUser, Set-ADComputer or Set-ADGroup.

The -NewName parameter defines the new name for the object and must be specified.

Examples

Rename the name of an existing site identified by its DistinguishedName:

PS C:\> Rename-ADObject -Identity "CN=Barcelones,CN=Sites,CN=Configuration,DC=SS64,DC=COM" -NewName Barcelona

Rename a group object identified by its DistinguishedName:

PS C:\> Rename-ADObject "OU=Raval,OU=Districts,DC=SS64,DC=Com" -NewName "El Raval"

“You can always tell that an organisation is on the skids when it changes it's name, and pays a lot of money for consultants to invent some ghastly new corporate identity” ~ Baroness Helena Kennedy

Related:

Get-adObject - Get one or more AD objects
Move-adObject - Move an AD object or container to a different container or domain.
New-adObject - Create an AD object.
Remove-adObject - Remove an AD object.
Restore-adObject - Restore an AD object.
Set-adObject - Modify an AD object.


© Copyright SS64.com 1999-2013
Some rights reserved