Reset-ComputerMachinePassword

Reset the machine account password for the computer.

Syntax
      Reset-ComputerMachinePassword [-Server string] [-Confirm] [-Credential PSCredential] [-WhatIf] [CommonParameters]

Key
   -Server string
The name of a domain controller to use when setting the machine account password.
This parameter is optional. If you omit this parameter, a domain controller is chosen to service the command. -Confirm Prompt for confirmation before executing the command. -Credential PSCredential Specifies a user account that has permission to perform this action. The default is the current user. Type a user name, such as User64 or SS64Dom\User64, or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, this cmdlet prompts you for a password. This parameter was introduced in PowerShell 3.0 -WhatIf Describe what would happen if you executed the command without actually executing it.

Reset-ComputerMachinePassword changes the machine account password that the computers use to authenticate to the domain controllers in the domain. You can use it to reset the password of the local computer.

Example

Reset the machine password for the local computer using the credentials of the current user:

PS C:> Reset-ComputerMachinePassword

Reset the machine password of the local computer using the DC64 domain controller:

PS C:> Reset-ComputerMachinePassword -server DC64

Use Invoke-Command to run a Reset-ComputerMachinePassword command on the Server64 remote computer.

PS C:> invoke-command -computername Server64 -scriptblock {reset-ComputerMachinePassword}

“Life is thickly sown with thorns, and I know no other remedy than to pass quickly through them. The longer we dwell on our misfortunes, the greater is their power to harm us” ~ Voltaire

Related PowerShell Cmdlets:

Restart-Computer - Restart the operating system on a computer.


 
Copyright © 1999-2021 SS64.com
Some rights reserved