-
-
Notifications
You must be signed in to change notification settings - Fork 161
Open
Description
Hi,
first of all: thanks a lot for providing the unattended generator – it’s a really useful tool.
Summary
When using a generated unattend.xml on Windows 11, the first automatic logon ends in a blank/gray screen (wallpaper only, no taskbar, no desktop icons). The underlying issue seems to be that the generated UserOnce.ps1 script kills explorer.exe in the current session but does not restart it.
After the next reboot/logon the problem no longer occurs – it only affects the very first logon where UserOnce.ps1 runs.
Environment
- Windows 11 25H2 (in my case running in a VirtualBox EFI VM, but this should not be VM-specific)
unattend.xmlgenerated via https://schneegans.de/windows/unattend-generator/- Auto-logon user configured (
AutoLogonfor a local admin) - First logon customization via the generated
DefaultUser.ps1/UserOnce.ps1
Steps to reproduce
- Generate an
unattend.xmlwith the generator (including the default user customization / UserOnce scripts). - Use it for an unattended Windows 11 installation.
- Let setup finish, then let the machine boot into the first automatic logon of the configured local admin.
- A PowerShell window appears briefly with the message
“Running scripts to configure this user account. Do not close this window.” - After the script finishes, the screen remains gray / just shows a gray screen:
- No taskbar
- No desktop icons
- No shell
Actual behavior
- After the first automatic logon, the user is left with a gray/blank screen because
explorer.exehas been terminated and not restarted.
Expected behavior
- After the first logon and completion of
UserOnce.ps1, the user should see a normal desktop (explorer shell running), without having to startexplorer.exemanually.
Analysis
In the generated C:\Windows\Setup\Scripts\UserOnce.ps1 the last script block looks like this:
{
Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\SetColorTheme.ps1' -Raw | Invoke-Expression;
};
{
Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript {
$_.SessionId -eq ( Get-Process -Id $PID ).SessionId;
} | Stop-Process -Force;
};Metadata
Metadata
Assignees
Labels
No labels