title: how to pass credentials to rename command?
body: <p>I'm running the following command in a PowerShell script to simply rename a computer.  The script will be executed by a computer startup script GPO, so I need to pass credentials within the command.  As I can't see what's happening with the script if it's executed at startup I'm testing it by running the script while logged on as a normal user</p>
  
  <pre><code>(Get-WmiObject win32_computersystem).Rename( $NewName,'Password','domain\username')
  </code></pre>
  
  <p>The command returns a ReturnValue of '5' - Access Denied.  How can I pass the username and password?  (I understand the security risk regarding a password in the script)</p>
  
  <pre><code>__GENUS          : 2
  __CLASS          : __PARAMETERS
  __SUPERCLASS     : 
  __DYNASTY        : __PARAMETERS
  __RELPATH        : 
  __PROPERTY_COUNT : 1
  __DERIVATION     : {}
  __SERVER         : 
  __NAMESPACE      : 
  __PATH           : 
  ReturnValue      : 5
  PSComputerName   : 
  </code></pre>