en-US 0409:00000409 en-US en-US en-US D:\viostor\w10\amd64 E:\viostor\w10\amd64 F:\viostor\w10\amd64 D:\vioscsi\w10\amd64 E:\vioscsi\w10\amd64 F:\vioscsi\w10\amd64 D:\NetKVM\w10\amd64 E:\NetKVM\w10\amd64 F:\NetKVM\w10\amd64 /IMAGE/INDEX 1 OnError M7XTQ-FN8P6-TTKYV-9D4CC-J462D OnError true IT Contoso * Pacific Standard Time IT Contoso true false 1 2 0409:00000409 en-US en-US en-US true true true true true Work 3 mdwelcome true</PlainText> </AdministratorPassword> <LocalAccounts> <LocalAccount wcm:action="add"> <Name>labadmin</Name> <DisplayName>Lab Admin</DisplayName> <Description>Local administrator for automated builds</Description> <Group>Administrators</Group> <Password> <Value>mdwelcome</Value> <PlainText>true</PlainText> </Password> </LocalAccount> </LocalAccounts> </UserAccounts> <!-- Autologon ONCE, just long enough for the FirstLogonCommands. After oobe-desktop.ps1 restarts the PC it lands on the sign-in screen. --> <AutoLogon> <Enabled>true</Enabled> <Username>labadmin</Username> <LogonCount>1</LogonCount> <Password> <Value>mdwelcome</Value> <PlainText>true</PlainText> </Password> </AutoLogon> <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet> <!-- =============================================================== FIRST LOGON COMMANDS - run once, elevated, as labadmin. =============================================================== --> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <Description>Show file extensions</Description> <CommandLine>reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <Description>Allow signed PowerShell scripts</Description> <CommandLine>powershell -NoProfile -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force"</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <!-- VMs only: if a virtio-win disc is attached, install the guest tools (NetKVM is needed before anything can be downloaded). On physical PCs no drive has the installer and this does nothing. Scans every drive for the installer rather than assuming a letter, since the VirtIO disc moves around post-install. --> <SynchronousCommand wcm:action="add"> <Order>3</Order> <Description>Install VirtIO guest tools</Description> <CommandLine>powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-Volume | Where-Object DriveLetter | ForEach-Object { $exe = $_.DriveLetter + ':\virtio-win-guest-tools.exe'; if (Test-Path $exe) { Start-Process $exe -ArgumentList '/install','/quiet','/norestart' -Wait } }"</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <!-- Provisioning: pulls oobe-desktop.ps1 from the repo so the PC always gets the current version, retrying for ~2.5 minutes while the network comes up. If that fails, falls back to the copy of oobe-desktop.ps1 baked into the root of the ISO. The script installs the MeshCentral agent, applies the power/RDP/SSH settings and restarts the PC itself, so this must stay the LAST command. Log: C:\ProgramData\OOBE\oobe-desktop.log --> <SynchronousCommand wcm:action="add"> <Order>4</Order> <Description>Run oobe-desktop.ps1 (url.isworking.fyi, else ISO copy)</Description> <CommandLine>powershell -NoProfile -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $s = $null; for ($i = 1; $i -le 10; $i++) { try { $s = Invoke-RestMethod 'https://url.isworking.fyi/oobe-desktop'; break } catch { Start-Sleep -Seconds 15 } }; if (-not $s) { $f = Get-PSDrive -PSProvider FileSystem | ForEach-Object { Join-Path $_.Root 'oobe-desktop.ps1' } | Where-Object { Test-Path $_ } | Select-Object -First 1; if ($f) { $s = Get-Content -Raw $f } }; if ($s) { Invoke-Expression $s } else { Write-Warning 'oobe-desktop.ps1 not found online or on any drive'; Start-Sleep -Seconds 60 }"</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> </component> </settings> </unattend>