CmdID / PowerShell / Cmdlets / Rename
Rename-Computer
Renames a computer. PowerShell reference
From the PowerShell reference 11 parameters
What it does
Renames a computer. The Rename-Computer cmdlet renames the local computer or a remote computer. It renames one computer in each command. This cmdlet was introduced in Windows PowerShell 3.0.
Rename-Computer [-ComputerName <String>] [-PassThru] [-DomainCredential <PSCredential>] [-LocalCredential <PSCredential>] [-NewName] <String> [-Force] [-Restart] [-WsmanAuthentication <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Rename the local computer
Rename-Computer -NewName "Server044" -DomainCredential Domain01\Admin01 -RestartIdentifyRename a remote computer
$renameParams = @{
ComputerName = "Srv01"
NewName = "Server001"
DomainCredential = "Domain01\Admin01"
Force = $true
}
Rename-Computer @renameParamsIdentifyIts page in the reference: Rename-Computer.
Parameters
-ComputerNameRenames the specified remote computer. The default is the local computer.
This parameter does not rely on PowerShell remoting. You can use the ComputerName parameter of Rename-Computer even if your computer is not configured to run remote commands.-DomainCredentialSpecifies a user account that has permission to connect to the domain. Explicit credentials are required to rename a computer that is joined to a domain.
If you type a user name, this cmdlet prompts you for a password.
To specify a user account that has permission to connect to the computer that is specified by the ComputerName parameter, use the LocalCredential parameter.-ForceForces the command to run without asking for user confirmation.-LocalCredentialSpecifies a user account that has permission to connect to the computer specified by the ComputerName parameter. The default is the current user.
If you type a user name, this cmdlet prompts you for a password.
To specify a user account that has permission to connect to the domain, use the DomainCredential parameter.-NewNameSpecifies a new name for the computer. This parameter is required.
Standard names may contain letters (a-z), (A-Z), numbers (0-9), and hyphens (-), but no spaces or periods (.). The name may not consist entirely of digits, and may not be longer than 63 characters-PassThruReturns the results of the command. Otherwise, this cmdlet does not generate any output.-ProtocolSpecifies which protocol to use to rename the computer. The acceptable values for this parameter are: WSMan and DCOM. The default value is DCOM.
This parameter was introduced in Windows PowerShell 3.0.-RestartIndicates that this cmdlet restarts the computer that was renamed. A restart is often required to make the change effective.-WsmanAuthenticationSpecifies the mechanism that is used to authenticate the user credentials when this cmdlet uses the WSMan protocol. The acceptable values for this parameter are:
- Basic
- CredSSP
- Default
- Digest
- Kerberos
- Negotiate
The default value is Default.
For more information about the values of this parameter, see AuthenticationMechanism Enumeration.
WARNING: Credential Security Service Provider (CredSSP) authentication, in which the user credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control > the network session.
This parameter was introduced in Windows PowerShell 3.0.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.