title: Getting an "Access Denied" error when executing PS code as an Administrator
body: <p>Tried the code I found on this SO question:
  <a href="https://stackoverflow.com/questions/15167069/powershell-create-local-user">PowerShell: Create Local User Account</a></p>
  
  <p>But when I execute it (in ISE running in the context of a Domain Admin acct, on a PC where Domain Admins are in the local Adminstrators group) I'm getting the following error:</p>
  
  <pre>
  Exception calling "SetInfo" with "0" argument(s): "Access is denied.
  "
  At \\servername\scripts\powershell\create-local-user.ps1:6 char:1
  + $LocalAdmin.SetInfo()
  + ~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : CatchFromBaseAdapterMethodInvokeTI
  </pre>
  
  <p>Why would I be getting an "Access Denied" exception with the <code>SetInfo()</code> method in this case?</p>