CmdID

CmdID / PowerShell / Cmdlets / Rename

Rename-LocalUser

Renames a local user account. PowerShell reference

From the PowerShell reference 6 parameters Alias rnlu

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Renames a local user account. The Rename-LocalUser cmdlet renames a local user account. NOTE: The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system.

Rename-LocalUser [-InputObject] <LocalUser> [-NewName] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
Rename-LocalUser [-Name] <String> [-NewName] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
Rename-LocalUser [-NewName] <String> [-SID] <SecurityIdentifier> [-WhatIf] [-Confirm] [<CommonParameters>]

Rename a user account

Rename-LocalUser -Name "Admin02" -NewName "AdminContoso02"Identify

Its page in the reference: Rename-LocalUser.

Parameters

6 in the PowerShell reference
-InputObjectSpecifies the user account that this cmdlet renames. To obtain a user account, use the Get-LocalUser cmdlet.
-NameSpecifies the name of the user account that this cmdlet renames.
-NewNameSpecifies a new name for the user account.
-SIDSpecifies the security ID (SID) of a user accounts that this cmdlet renames.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.