- remote-access/windows-baseline.ps1: no driver updates, no restart while signed in, active hours 5-23, Game DVR off, Microsoft bundled apps removed, no sleep/hibernate/disk/USB power saving; never restarts or touches the NIC Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
4.7 KiB
PowerShell
58 lines
4.7 KiB
PowerShell
# windows-baseline.ps1 - the settings every show PC gets so Windows never breaks a service, as on the NA
|
|
# LiveStream PC (2026-10-19): Windows Update installs no drivers and never restarts while the user is signed
|
|
# in (active hours 5 AM - 11 PM as well); Game DVR off; Microsoft's bundled apps removed; no disk or USB power
|
|
# saving, no sleep. Nothing here restarts the PC or touches its network card. Run as an administrator; safe to
|
|
# run again. Prints what it set.
|
|
$ErrorActionPreference = 'SilentlyContinue'; $ProgressPreference = 'SilentlyContinue'
|
|
function K($p) { if (-not (Test-Path $p)) { New-Item $p -Force | Out-Null } }
|
|
|
|
# Windows Update: no drivers (the 10/15 NVIDIA driver broke a stream), no restarts while signed in.
|
|
$wu = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate'; $au = "$wu\AU"; K $wu; K $au
|
|
Set-ItemProperty $wu ExcludeWUDriversInQualityUpdate 1 -Type DWord
|
|
Set-ItemProperty $wu SetActiveHours 1 -Type DWord; Set-ItemProperty $wu ActiveHoursStart 5 -Type DWord; Set-ItemProperty $wu ActiveHoursEnd 23 -Type DWord
|
|
Set-ItemProperty $au NoAutoRebootWithLoggedOnUsers 1 -Type DWord
|
|
$ds = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching'; K $ds
|
|
Set-ItemProperty $ds SearchOrderConfig 0 -Type DWord; Set-ItemProperty $ds DontSearchWindowsUpdate 1 -Type DWord
|
|
$dm = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata'; K $dm; Set-ItemProperty $dm PreventDeviceMetadataFromNetwork 1 -Type DWord
|
|
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching' SearchOrderConfig 0 -Type DWord
|
|
|
|
# Game DVR / Xbox capture off (machine policy and this user).
|
|
$gd = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR'; K $gd; Set-ItemProperty $gd AllowGameDVR 0 -Type DWord
|
|
K 'HKCU:\System\GameConfigStore'; Set-ItemProperty 'HKCU:\System\GameConfigStore' GameDVR_Enabled 0 -Type DWord
|
|
K 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR'; Set-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR' AppCaptureEnabled 0 -Type DWord
|
|
|
|
# Microsoft's bundled apps (for every user, and not reinstalled for new ones).
|
|
$bloat = 'Microsoft.XboxGameOverlay','Microsoft.XboxGamingOverlay','Microsoft.XboxSpeechToTextOverlay','Microsoft.Xbox.TCUI',
|
|
'Microsoft.XboxIdentityProvider','Microsoft.GamingApp','Microsoft.Edge.GameAssist','Microsoft.BingNews','Microsoft.BingWeather',
|
|
'Microsoft.BingSearch','Microsoft.MicrosoftSolitaireCollection','Clipchamp.Clipchamp','MicrosoftTeams','MSTeams','Microsoft.Copilot',
|
|
'Microsoft.OutlookForWindows','microsoft.windowscommunicationsapps','Microsoft.MicrosoftOfficeHub','Microsoft.People',
|
|
'Microsoft.YourPhone','MicrosoftWindows.CrossDevice','Microsoft.WindowsMaps','Microsoft.WindowsFeedbackHub','Microsoft.GetHelp',
|
|
'Microsoft.Getstarted','Microsoft.Todos','Microsoft.Whiteboard','Microsoft.MicrosoftJournal','Microsoft.Windows.DevHome',
|
|
'MicrosoftCorporationII.MicrosoftFamily','Microsoft.MixedReality.Portal','Microsoft.PowerAutomateDesktop','Microsoft.ZuneMusic',
|
|
'Microsoft.ZuneVideo','Microsoft.549981C3F5F10'
|
|
$prov = Get-AppxProvisionedPackage -Online
|
|
foreach ($x in $bloat) {
|
|
Get-AppxPackage -AllUsers -Name $x | Remove-AppxPackage -AllUsers
|
|
$prov | Where-Object DisplayName -eq $x | Remove-AppxProvisionedPackage -Online -AllUsers | Out-Null
|
|
}
|
|
|
|
# Power: never sleep or hibernate, disks never off, USB never suspended (DMX interfaces, capture cards).
|
|
foreach ($m in 'ac', 'dc') {
|
|
powercfg /change "standby-timeout-$m" 0; powercfg /change "hibernate-timeout-$m" 0; powercfg /change "disk-timeout-$m" 0
|
|
}
|
|
powercfg /setacvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
|
|
powercfg /setdcvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
|
|
powercfg /setactive SCHEME_CURRENT
|
|
|
|
# What it is now.
|
|
$q = { param($sub, $set) ((powercfg /query SCHEME_CURRENT $sub $set | Select-String 'Current AC' | Select-Object -First 1).Line -replace '.*: ','') }
|
|
$w = Get-ItemProperty $wu
|
|
'RESULT ' + $env:COMPUTERNAME
|
|
' updates: drivers excluded=' + $w.ExcludeWUDriversInQualityUpdate + ', active hours ' + $w.ActiveHoursStart + '-' + $w.ActiveHoursEnd +
|
|
', no restart while signed in=' + (Get-ItemProperty $au).NoAutoRebootWithLoggedOnUsers
|
|
' game DVR policy=' + (Get-ItemProperty $gd).AllowGameDVR + ', user=' + (Get-ItemProperty 'HKCU:\System\GameConfigStore').GameDVR_Enabled
|
|
' power: sleep=' + (& $q SUB_SLEEP STANDBYIDLE) + ' hibernate=' + (& $q SUB_SLEEP HIBERNATEIDLE) + ' disk=' + (& $q SUB_DISK DISKIDLE) +
|
|
' usb suspend=' + (& $q 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226)
|
|
' bundled apps left: ' + ((($bloat | Where-Object { Get-AppxPackage -AllUsers -Name $_ }) -join ', ') -replace '^$', 'none')
|
|
' ssh: ' + (Get-Service sshd).Status + ' / ' + (Get-Service sshd).StartType
|