firstlogon.ps1 1.1 KB

12345678910111213
  1. # runs once at the first logon (autounattend.xml): keeps the VM awake and quiet for screenshot driven tests
  2. powercfg /change monitor-timeout-ac 0
  3. powercfg /change standby-timeout-ac 0
  4. powercfg /change hibernate-timeout-ac 0
  5. reg add "HKCU\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f
  6. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoLockScreen /t REG_DWORD /d 1 /f
  7. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
  8. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f
  9. # the SMB share of the host (QEMU user networking), guest access without a password
  10. reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f
  11. reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f
  12. Set-SmbClientConfiguration -RequireSecuritySignature $false -EnableInsecureGuestLogons $true -Force
  13. New-Item -ItemType File -Path C:\firstlogon.done -Force