Remove a computer from the domain with PowerShell run the following command:
Remove-Computer -UnjoinDomaincredential Domain\User -PassThru -Verbose -Restart
Remove a computer from the domain with PowerShell run the following command:
Remove-Computer -UnjoinDomaincredential Domain\User -PassThru -Verbose -Restart
I use a Group Policy setting to ensure certain users or groups are always administrators on every machine I add to my test domain. This is a reminder to myself how I do this.
Open the GP Editor and navigate to Computer Configuration\Policies\Windows Settings\Security Settings\Restricted Groups.
The membership dialogue appears.
The group will now be a member of the Administrators group on all computers the policy is applied to.
I recently tried to remove an OU from my Test AD came and up against this message: You do no have sufficient privileges to delete xxxx or this object is protected from accidental deletion.
To get round this I followed this procedure.
I was then able to delete the OU.
More info: https://technet.microsoft.com/en-us/library/cc736842(v=ws.10).aspx.