title: Powershell set-itemproperty doesn't change registry setting
body: <p>I have a script that I run to lockdown a windows 7 computer to run a VM Client when booted.
  when it runs it creates the local user account that is going to be used for logging in
  Checks for the DefaultPassword  reg key and if is not there creates the key </p>
  
  <p>It sets the registry values for
  AutoAdminLogon value to 1
  DefaultdomainName value to the local machine name
  DefaultPassword value to the local user account password
  DefaultUsername value to the local user that was setup in the script
  ForceAutoLogon value to 1
  LogonType value to 0</p>
  
  <p>After this is done the computer reboots and should login as the local user automatically
  but it doesn't.  I've check the keys and prior to the reboot everything is correct.  But after reboot its back to what it was before the script was run.</p>
  
  <p>The weird thing is .. if I run the script again .. everything works.</p>
  
  <p>Has anyone got any ideas why this is happening???</p>
  
  <p>As I said if I run the same script again AFTER the reboot it set the registry entries with no problems and they stay after the 2nd reboot. So I'm thinking there something going on after the first reboot .. my first thoughts where Domain Group Policies but if that was the case then I would get the same results on the 2nd run of the script and reboot.  I have another script that I run after this one that sets the local user startup to launch the VMClient and disables taskmanager , lockworkstation, and change password functions when they use ctlr-alt-del keys, which is done in the registry .. this work just fine. </p>