title: remove-computer cmdlet access denied
body: <p>I am trying create a script to remove a computer from a domain using <code>remove-computer -unjoincredentials domain\admin -passthru</code> However, I consistently receive an error stating that </p>
  
  <p><code>remove-computer : Failed to unjoin computer 'web140127105714' from domain 'domain.com' with the following error 
  message: Access is denied.
  At line:1 char:1
  + remove-computer -UnjoinDomainCredential domain\admin -PassThru
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : OperationStopped: (web140127105714:String) [Remove-Computer], InvalidOperationException
      + FullyQualifiedErrorId : FailToUnjoinDomain,Microsoft.PowerShell.Commands.RemoveComputerCommand</code></p>
  
  <p>The account I am using is a domain administrator with full access.  I have confirmed that the account can manually unjoin from the domian.</p>