Reset-ComputerMachinePassword
Published: February 29, 2012
Updated: August 23, 2012
Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0
Reset-ComputerMachinePassword
Syntax
Parameter Set: Default Reset-ComputerMachinePassword [-Credential <PSCredential> ] [-Server <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Reset-ComputerMachinePassword cmdlet 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.
Parameters
-Credential<PSCredential>
Specifies a user account that has permission in the domain to reset the computer's machine password. The default is the current user.
Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.
This parameter is introduced in Windows PowerShell 3.0.
|
Aliases |
none |
|
Required? |
false |
|
Position? |
named |
|
Default Value |
Current user |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
false |
-Server<String>
Specifies 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.
|
Aliases |
none |
|
Required? |
false |
|
Position? |
named |
|
Default Value |
None |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
|
Required? |
false |
|
Position? |
named |
|
Default Value |
false |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
|
Required? |
false |
|
Position? |
named |
|
Default Value |
false |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
None
You cannot pipe input to this cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
-
None
This cmdlet does not generate any output.
Examples
-------------------------- EXAMPLE 1 --------------------------
This command resets the machine password for the local computer. The command runs with the credentials of the current user.
PS C:\> Reset-ComputerMachinePassword
-------------------------- EXAMPLE 2 --------------------------
This command resets the machine password of the local computer using the DC01 domain controller. It uses the Credential parameter to specify a user account that has permission to reset a machine password in the domain.
PS C:\> Reset-ComputerMachinePassword -Server DC01 -Credential Domain01\Admin01
-------------------------- EXAMPLE 3 --------------------------
This command uses theInvoke-Command cmdlet to run a Reset-ComputerMachinePassword command on the Server01 remote computer.
For more information about remote commands in Windows PowerShell, see about_Remote and Invoke-Command.
PS C:\> Invoke-Command -ComputerName Server01 -ScriptBlock {Reset-ComputerMachinePassword}