Remove-Computer
cmdlet removes the local computer and remote computers from their currentdomains.Remove-Computer
also disables the domain account of thecomputer. You must provide explicit credentials to unjoin the computer from its domain, even whenthey are the credentials of the current user. You must restart the computer to make the changeeffective. Also, when you remove a computer from a domain, you must move it to a workgroup. Use theWorkgroupName parameter to specify the workgroup.Add-Computer
cmdlet.Remove-Computer
removes the local computer and remote computers from domains. It includescredential parameters that specify alternate credentials for connecting to remote computers, andunjoining from a domain, a Restart parameter for restarting the affected computers, and aWorkgroupName parameter for specifying the name of the workgroup to which computers are added.OldServers.txt
file from theirdomains and moves them into the Legacy workgroup.Remove-Computer
even if your computer is not configured to run remote commands.Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Remove-Computer
prompts you for confirmation beforeremoving each computer.Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
User01
or Domain01User01
, or enter a PSCredential object, such asone generated by the Get-Credential
cmdlet. If you type a user name, the cmdlet prompts you for apassword. To specify a user account that has permission to remove the computer from its currentdomain, use the UnjoinDomainCredential parameter.Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Get-Credential
. If you type a user name, this cmdlet prompts you for a password.Type: | PSCredential |
Aliases: | Credential |
Position: | 0 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Remove-Computer
returns a ComputerChangeInfo object.Otherwise, this cmdlet does not generate any output.