PowerShell Logo Small

Remove-Computer



This is the built-in help made by Microsoft for the command 'Remove-Computer', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Remove the local computer from a workgroup or domain.

SYNTAX


Remove-Computer [[-Credential] <PSCredential>] [-Force] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-Computer cmdlet removes the local computer from its current workgroup or domain.

When you remove a computer from a domain, Remove-Computer also disables the computer's domain account.

When the computer is in a domain, you must provide credentials, even when they are the credentials of the current user, and you must restart the
computer to make the change effective.

To get the results of the command, use the Verbose and PassThru parameters.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=135246
Add-Computer
Checkpoint-Computer
Remove-Computer
Restart-Computer
Restore-Computer
Stop-Computer
Test-Connection

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>remove-computer



Description
-----------
This command removes the computer from a workgroup.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>remove-computer -credential domain01\admin01 -passthru -verbose; restart-computer



Description
-----------
These commands remove the local computer from the domain to which it is joined.

The first command removes the computer from the domain. The command uses the Credential parameter to supply the credentials of a domain administr
ator. It uses the PassThru parameter and the Verbose common parameter to display information about the success or failure of the command.

The second command uses the Restart-Computer cmdlet to restart the computer, which is required to complete the remove operation.

The semi-colon (;) separates the two commands.