# Reset-ComputerMachinePassword

# Reset-Computer<wbr>Machine<wbr>Password</wbr></wbr>

<div class="display-flex-tablet justify-content-space-between-tablet" id="bkmrk-reference">- Reference

<div class="margin-block-xxs display-none-print" data-hide-on-archived="" id="bkmrk-"></div></div><div class="metadata" id="bkmrk-module%3A-microsoft.po"><dl class="attributeList"><dt>Module:</dt><dd>[Microsoft.PowerShell.Management](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/?view=powershell-5.1)</dd></dl></div>Resets the machine account password for the computer.

## Syntax

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershell"><span class="language">PowerShell</span></div>```
Reset-ComputerMachinePassword
     [-Server <String>]
     [-Credential <PSCredential>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
```

## Description

The `Reset-ComputerMachinePassword` cmdlet changes the computer 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.

## Examples

### Example 1: Reset the password for the local computer

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershell-1"><span class="language">PowerShell</span></div>```
Reset-ComputerMachinePassword
```

This command resets the computer password for the local computer. The command runs with the credentials of the current user.

### Example 2: Reset the password for the local computer by using a specified domain controller

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershell-2"><span class="language">PowerShell</span></div>```
Reset-ComputerMachinePassword -Server "DC01" -Credential Domain01\Admin01
```

This command resets the computer password of the local computer by using the DC01 domain controller. It uses the **Credential** parameter to specify a user account that has permission to reset a computer password in the domain.

### Example 3: Reset the password on a remote computer

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershell-3"><span class="language">PowerShell</span></div>```
$cred = Get-Credential
Invoke-Command -ComputerName "Server01" -ScriptBlock {Reset-ComputerMachinePassword -Credential $using:cred}
```

This command uses the Invoke-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](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote?view=powershell-5.1) and `Invoke-Command`.

## Parameters

### -Confirm

Prompts you for confirmation before running the cmdlet.

<div class="parameterInfo" id="bkmrk-type%3A-switchparamete"><div class="buttons buttons-right margin-bottom-none margin-top-sm">  
</div><div class="has-inner-focus"><table aria-label="Table 1" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[SwitchParameter](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.switchparameter)</td></tr><tr><td>Aliases:</td><td>cf</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>False</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -Credential

Specifies a user account that has permission to perform this action. 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, this cmdlet prompts you for a password.

This parameter was introduced in Windows PowerShell 3.0.

<div class="parameterInfo" id="bkmrk-type%3A-pscredential-p"><div class="buttons buttons-right margin-bottom-none margin-top-sm">  
</div><div class="has-inner-focus"><table aria-label="Table 2" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[PSCredential](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential)</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -Server

Specifies the name of a domain controller to use when this cmdlet sets the computer account password.

This parameter is optional. If you omit this parameter, a domain controller is chosen to service the command.

<div class="parameterInfo" id="bkmrk-type%3A-string-positio"><div class="buttons buttons-right margin-bottom-none margin-top-sm">  
</div><div class="has-inner-focus"><table aria-label="Table 3" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[String](https://learn.microsoft.com/en-us/dotnet/api/system.string)</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

<div class="parameterInfo" id="bkmrk-type%3A-switchparamete-1"><div class="buttons buttons-right margin-bottom-none margin-top-sm">  
</div><div class="has-inner-focus"><table aria-label="Table 4" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[SwitchParameter](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.switchparameter)</td></tr><tr><td>Aliases:</td><td>wi</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>False</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>## Inputs

**<span class="no-loc xref">None</span>**

You cannot pipe input to this cmdlet.

## Outputs

**<span class="no-loc xref">None</span>**

This cmdlet does not generate any output.