Azure Windows 11 Single user image need a first login

Hey @tothger ,

Yes I did.

I’ve prevent the privacy window to appear by setting up a few registry key.

I added a “custom script” in my windows-11.pkr.hcl file as below:

custom_script = "powershell -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -Command \"New-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE' -Name 'PrivacyConsent' -PropertyType DWORD -Value 1; Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE' -Name DisablePrivacyExperience -Value 1; Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name AutoAdminLogon -Value 1; Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultUserName -Value '${var.build_username}'; Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultPassword -Value '${var.build_password}'; Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name EnableFirstLogonAnimation -Value 0; Restart-Computer \""

After this, I disable the autologon using a .ps1 script.