From aada2493cf4792a9b9279c7568585094897e256e Mon Sep 17 00:00:00 2001 From: Peter Reichart Date: Wed, 23 Sep 2026 12:06:00 +0000 Subject: [PATCH] Dateien nach "installmedia" hochladen --- installmedia/autounattend.xml | 728 ++++++++++++++++++++++++++++++++++ 1 file changed, 728 insertions(+) create mode 100644 installmedia/autounattend.xml diff --git a/installmedia/autounattend.xml b/installmedia/autounattend.xml new file mode 100644 index 0000000..3bedafe --- /dev/null +++ b/installmedia/autounattend.xml @@ -0,0 +1,728 @@ + + + + + + + de-DE + + + + + VK7JG-NPHTM-C97JM-9MPGT-3V66T + OnError + + true + + false + + + 1 + reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f + + + 2 + reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f + + + 3 + reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f + + + + + + + + + + 1 + powershell.exe -WindowStyle "Normal" -NoProfile -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;" + + + 2 + powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\Specialize.ps1" + + + 3 + reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" + + + 4 + powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\DefaultUser.ps1" + + + 5 + reg.exe unload "HKU\DefaultUser" + + + + + W. Europe Standard Time + + + + + + + 0407:00000407 + de-DE + de-DE + de-DE + + + + + + root + + Administrators + + root + true</PlainText> + </Password> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Username>root</Username> + <Enabled>true</Enabled> + <LogonCount>1</LogonCount> + <Password> + <Value>root</Value> + <PlainText>true</PlainText> + </Password> + </AutoLogon> + <OOBE> + <ProtectYourPC>3</ProtectYourPC> + <HideEULAPage>true</HideEULAPage> + <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE> + <HideOnlineAccountScreens>false</HideOnlineAccountScreens> + </OOBE> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <Order>1</Order> + <CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <Extensions xmlns="https://schneegans.de/windows/unattend-generator/"> + <Build> + <Commit> + <Hash>538f930aeea9c3d51fdd0b4822e2d076fef999e8</Hash> + <GitHubUrl>https://github.com/cschneegans/unattend-generator/commit/538f930aeea9c3d51fdd0b4822e2d076fef999e8</GitHubUrl> + </Commit> + </Build> + <ExtractScript> +param( + [xml] $Document +); + +foreach( $file in $Document.unattend.Extensions.File ) { + $path = [System.Environment]::ExpandEnvironmentVariables( $file.GetAttribute( 'path' ) ); + mkdir -Path( $path | Split-Path -Parent ) -ErrorAction 'SilentlyContinue'; + $encoding = switch( [System.IO.Path]::GetExtension( $path ) ) { + { $_ -in '.ps1', '.xml' } { [System.Text.Encoding]::UTF8; } + { $_ -in '.reg', '.vbs', '.js' } { [System.Text.UnicodeEncoding]::new( $false, $true ); } + default { [System.Text.Encoding]::Default; } + }; + $bytes = $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() ); + [System.IO.File]::WriteAllBytes( $path, $bytes ); +} + </ExtractScript> + <File path="C:\Windows\Setup\Scripts\RemovePackage.ps1"> +$selectors = @( + 'Microsoft.Microsoft3DViewer'; + 'Microsoft.BingSearch'; + 'Microsoft.Copilot'; + 'Microsoft.549981C3F5F10'; + 'MicrosoftCorporationII.MicrosoftFamily'; + 'Microsoft.WindowsFeedbackHub'; + 'Microsoft.Getstarted'; + 'microsoft.windowscommunicationsapps'; + 'Microsoft.WindowsMaps'; + 'Microsoft.MixedReality.Portal'; + 'Microsoft.BingNews'; + 'Microsoft.MicrosoftOfficeHub'; + 'Microsoft.Office.OneNote'; + 'Microsoft.OutlookForWindows'; + 'Microsoft.People'; + 'MicrosoftCorporationII.QuickAssist'; + 'Microsoft.SkypeApp'; + 'Microsoft.ScreenSketch'; + 'Microsoft.MicrosoftSolitaireCollection'; + 'Microsoft.MicrosoftStickyNotes'; + 'Microsoft.Todos'; + 'Microsoft.Wallet'; + 'Microsoft.BingWeather'; + 'Microsoft.Xbox.TCUI'; + 'Microsoft.XboxApp'; + 'Microsoft.XboxGameOverlay'; + 'Microsoft.XboxGamingOverlay'; + 'Microsoft.XboxIdentityProvider'; + 'Microsoft.XboxSpeechToTextOverlay'; + 'Microsoft.GamingApp'; + 'Microsoft.YourPhone'; + 'Microsoft.ZuneMusic'; + 'Microsoft.ZuneVideo'; +); +$getCommand = { + Get-AppxProvisionedPackage -Online; +}; +$filterCommand = { + $_.DisplayName -eq $selector; +}; +$removeCommand = { + [CmdletBinding()] + param( + [Parameter( Mandatory, ValueFromPipeline )] + $InputObject + ); + process { + $InputObject | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction 'Continue'; + } +}; +$type = 'Package'; +$installed = &amp; $getCommand; +foreach( $selector in $selectors ) { + $result = [ordered] @{ + Selector = $selector; + }; + if( $found = $installed | Where-Object -FilterScript $filterCommand ) { + $result.Output = $found | &amp; $removeCommand; + if( $? ) { + $result.Message = "${type} removed."; + } else { + $result.Message = "${type} not removed."; + $result.Error = $Error[0]; + } + } else { + $result.Message = "${type} not installed."; + } + $result | ConvertTo-Json -Depth 3 -Compress; +} + </File> + <File path="C:\Windows\Setup\Scripts\RemoveCapability.ps1"> +$selectors = @( + 'OneCoreUAP.OneSync'; + 'App.Support.QuickAssist'; + 'Microsoft.Windows.SnippingTool'; + 'Hello.Face.18967'; + 'Hello.Face.Migration.18967'; + 'Hello.Face.20134'; + 'Media.WindowsMediaPlayer'; +); +$getCommand = { + Get-WindowsCapability -Online | Where-Object -Property 'State' -NotIn -Value @( + 'NotPresent'; + 'Removed'; + ); +}; +$filterCommand = { + ($_.Name -split '~')[0] -eq $selector; +}; +$removeCommand = { + [CmdletBinding()] + param( + [Parameter( Mandatory, ValueFromPipeline )] + $InputObject + ); + process { + $InputObject | Remove-WindowsCapability -Online -ErrorAction 'Continue'; + } +}; +$type = 'Capability'; +$installed = &amp; $getCommand; +foreach( $selector in $selectors ) { + $result = [ordered] @{ + Selector = $selector; + }; + if( $found = $installed | Where-Object -FilterScript $filterCommand ) { + $result.Output = $found | &amp; $removeCommand; + if( $? ) { + $result.Message = "${type} removed."; + } else { + $result.Message = "${type} not removed."; + $result.Error = $Error[0]; + } + } else { + $result.Message = "${type} not installed."; + } + $result | ConvertTo-Json -Depth 3 -Compress; +} + </File> + <File path="C:\Windows\Setup\Scripts\RemoveFeature.ps1"> +$selectors = @( + 'Recall'; + 'Microsoft-SnippingTool'; +); +$getCommand = { + Get-WindowsOptionalFeature -Online | Where-Object -Property 'State' -NotIn -Value @( + 'Disabled'; + 'DisabledWithPayloadRemoved'; + ); +}; +$filterCommand = { + $_.FeatureName -eq $selector; +}; +$removeCommand = { + [CmdletBinding()] + param( + [Parameter( Mandatory, ValueFromPipeline )] + $InputObject + ); + process { + $InputObject | Disable-WindowsOptionalFeature -Online -Remove -NoRestart -ErrorAction 'Continue'; + } +}; +$type = 'Feature'; +$installed = &amp; $getCommand; +foreach( $selector in $selectors ) { + $result = [ordered] @{ + Selector = $selector; + }; + if( $found = $installed | Where-Object -FilterScript $filterCommand ) { + $result.Output = $found | &amp; $removeCommand; + if( $? ) { + $result.Message = "${type} removed."; + } else { + $result.Message = "${type} not removed."; + $result.Error = $Error[0]; + } + } else { + $result.Message = "${type} not installed."; + } + $result | ConvertTo-Json -Depth 3 -Compress; +} + </File> + <File path="C:\Windows\Setup\Scripts\TaskbarLayoutModification.xml"> +&lt;LayoutModificationTemplate xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" Version="1"&gt; + &lt;CustomTaskbarLayoutCollection PinListPlacement="Replace"&gt; + &lt;defaultlayout:TaskbarLayout&gt; + &lt;taskbar:TaskbarPinList&gt; + &lt;taskbar:DesktopApp DesktopApplicationLinkPath="#leaveempty" /&gt; + &lt;/taskbar:TaskbarPinList&gt; + &lt;/defaultlayout:TaskbarLayout&gt; + &lt;/CustomTaskbarLayoutCollection&gt; +&lt;/LayoutModificationTemplate&gt; + </File> + <File path="C:\Windows\Setup\Scripts\UnlockStartLayout.vbs"> +HKU = &amp;H80000003 +Set reg = GetObject("winmgmts://./root/default:StdRegProv") +Set fso = CreateObject("Scripting.FileSystemObject") + +If reg.EnumKey(HKU, "", sids) = 0 Then + If Not IsNull(sids) Then + For Each sid In sids + key = sid + "\Software\Policies\Microsoft\Windows\Explorer" + name = "LockedStartLayout" + If reg.GetDWORDValue(HKU, key, name, existing) = 0 Then + reg.SetDWORDValue HKU, key, name, 0 + End If + Next + End If +End If + </File> + <File path="C:\Windows\Setup\Scripts\UnlockStartLayout.xml"> +&lt;Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"&gt; + &lt;Triggers&gt; + &lt;EventTrigger&gt; + &lt;Enabled&gt;true&lt;/Enabled&gt; + &lt;Subscription&gt;&amp;lt;QueryList&amp;gt;&amp;lt;Query Id="0" Path="Application"&amp;gt;&amp;lt;Select Path="Application"&amp;gt;*[System[Provider[@Name='UnattendGenerator'] and EventID=1]]&amp;lt;/Select&amp;gt;&amp;lt;/Query&amp;gt;&amp;lt;/QueryList&amp;gt;&lt;/Subscription&gt; + &lt;/EventTrigger&gt; + &lt;/Triggers&gt; + &lt;Principals&gt; + &lt;Principal id="Author"&gt; + &lt;UserId&gt;S-1-5-18&lt;/UserId&gt; + &lt;RunLevel&gt;LeastPrivilege&lt;/RunLevel&gt; + &lt;/Principal&gt; + &lt;/Principals&gt; + &lt;Settings&gt; + &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt; + &lt;DisallowStartIfOnBatteries&gt;false&lt;/DisallowStartIfOnBatteries&gt; + &lt;StopIfGoingOnBatteries&gt;false&lt;/StopIfGoingOnBatteries&gt; + &lt;AllowHardTerminate&gt;true&lt;/AllowHardTerminate&gt; + &lt;StartWhenAvailable&gt;false&lt;/StartWhenAvailable&gt; + &lt;RunOnlyIfNetworkAvailable&gt;false&lt;/RunOnlyIfNetworkAvailable&gt; + &lt;IdleSettings&gt; + &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt; + &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt; + &lt;/IdleSettings&gt; + &lt;AllowStartOnDemand&gt;true&lt;/AllowStartOnDemand&gt; + &lt;Enabled&gt;true&lt;/Enabled&gt; + &lt;Hidden&gt;false&lt;/Hidden&gt; + &lt;RunOnlyIfIdle&gt;false&lt;/RunOnlyIfIdle&gt; + &lt;WakeToRun&gt;false&lt;/WakeToRun&gt; + &lt;ExecutionTimeLimit&gt;PT72H&lt;/ExecutionTimeLimit&gt; + &lt;Priority&gt;7&lt;/Priority&gt; + &lt;/Settings&gt; + &lt;Actions Context="Author"&gt; + &lt;Exec&gt; + &lt;Command&gt;C:\Windows\System32\wscript.exe&lt;/Command&gt; + &lt;Arguments&gt;C:\Windows\Setup\Scripts\UnlockStartLayout.vbs&lt;/Arguments&gt; + &lt;/Exec&gt; + &lt;/Actions&gt; +&lt;/Task&gt; + </File> + <File path="C:\Windows\Setup\Scripts\MoveActiveHours.xml"> +&lt;Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"&gt; + &lt;Triggers&gt; + &lt;BootTrigger&gt; + &lt;Repetition&gt; + &lt;Interval&gt;PT4H&lt;/Interval&gt; + &lt;StopAtDurationEnd&gt;false&lt;/StopAtDurationEnd&gt; + &lt;/Repetition&gt; + &lt;Enabled&gt;true&lt;/Enabled&gt; + &lt;/BootTrigger&gt; + &lt;RegistrationTrigger&gt; + &lt;Repetition&gt; + &lt;Interval&gt;PT4H&lt;/Interval&gt; + &lt;StopAtDurationEnd&gt;false&lt;/StopAtDurationEnd&gt; + &lt;/Repetition&gt; + &lt;Enabled&gt;true&lt;/Enabled&gt; + &lt;/RegistrationTrigger&gt; + &lt;/Triggers&gt; + &lt;Principals&gt; + &lt;Principal id="Author"&gt; + &lt;UserId&gt;S-1-5-19&lt;/UserId&gt; + &lt;RunLevel&gt;LeastPrivilege&lt;/RunLevel&gt; + &lt;/Principal&gt; + &lt;/Principals&gt; + &lt;Settings&gt; + &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt; + &lt;DisallowStartIfOnBatteries&gt;false&lt;/DisallowStartIfOnBatteries&gt; + &lt;StopIfGoingOnBatteries&gt;false&lt;/StopIfGoingOnBatteries&gt; + &lt;AllowHardTerminate&gt;true&lt;/AllowHardTerminate&gt; + &lt;StartWhenAvailable&gt;false&lt;/StartWhenAvailable&gt; + &lt;RunOnlyIfNetworkAvailable&gt;false&lt;/RunOnlyIfNetworkAvailable&gt; + &lt;IdleSettings&gt; + &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt; + &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt; + &lt;/IdleSettings&gt; + &lt;AllowStartOnDemand&gt;true&lt;/AllowStartOnDemand&gt; + &lt;Enabled&gt;true&lt;/Enabled&gt; + &lt;Hidden&gt;false&lt;/Hidden&gt; + &lt;RunOnlyIfIdle&gt;false&lt;/RunOnlyIfIdle&gt; + &lt;WakeToRun&gt;false&lt;/WakeToRun&gt; + &lt;ExecutionTimeLimit&gt;PT72H&lt;/ExecutionTimeLimit&gt; + &lt;Priority&gt;7&lt;/Priority&gt; + &lt;/Settings&gt; + &lt;Actions Context="Author"&gt; + &lt;Exec&gt; + &lt;Command&gt;%windir%\System32\conhost.exe&lt;/Command&gt; + &lt;Arguments&gt;--headless %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoProfile -NonInteractive -Command "$p = @{ LiteralPath = 'Registry::HKLM\Software\Microsoft\WindowsUpdate\UX\Settings'; Type = 'DWord'; }; $h = [datetime]::Now.Hour; Set-ItemProperty @p -Name 'ActiveHoursStart' -Value (($h + 23) % 24); Set-ItemProperty @p -Name 'ActiveHoursEnd' -Value (($h + 11) % 24); Set-ItemProperty @p -Name 'SmartActiveHoursState' -Value 0;"&lt;/Arguments&gt; + &lt;/Exec&gt; + &lt;/Actions&gt; +&lt;/Task&gt; + </File> + <File path="C:\Windows\Setup\Scripts\SetStartPins.ps1"> +$json = '{"pinnedList":[]}'; +if( [System.Environment]::OSVersion.Version.Build -lt 20000 ) { + return; +} +$key = 'Registry::HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start'; +New-Item -Path $key -ItemType 'Directory' -ErrorAction 'SilentlyContinue'; +Set-ItemProperty -LiteralPath $key -Name 'ConfigureStartPins' -Value $json -Type 'String'; + </File> + <File path="C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml"> +&lt;LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"&gt; + &lt;LayoutOptions StartTileGroupCellWidth="6" /&gt; + &lt;DefaultLayoutOverride&gt; + &lt;StartLayoutCollection&gt; + &lt;StartLayout GroupCellWidth="6" xmlns="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" /&gt; + &lt;/StartLayoutCollection&gt; + &lt;/DefaultLayoutOverride&gt; +&lt;/LayoutModificationTemplate&gt; + </File> + <File path="C:\Windows\Setup\Scripts\unattend-01.cmd"> +@echo off + +rem ---- Windows 11 Tweaks ---------------------------------------------------- + +rem --- Startmen&#xFC; links +reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f +reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarDa /t REG_DWORD /d 0 /f +reg add "HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /v Standard /t REG_SZ /f +reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /F +reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 1 /F +reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsSearch" /v AllowCortana /t REG_DWORD /d 0 /F +reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\TabletPC" /v DisableSnippingTool /t REG_DWORD /d 1 /F + +rem reg add "HKEY_LOCAL_MACHINE\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 + +rem ---- OneDrive deaktivieren ------------------------------------------------ +taskkill /f /im OneDrive.exe +REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f +REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f +REG DELETE "HKEY_CURRENT_USER\Software\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f +REG DELETE "HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder" /f +REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /f + +reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f + +powercfg /change standby-timeout-ac 0 +powercfg /change standby-timeout-dc 10 +powercfg /change hibernate-timeout-ac 0 +powercfg /change hibernate-timeout-dc 10 +powercfg /change monitor-timeout-ac 30 +powercfg /change monitor-timeout-dc 10 +powercfg /change disk-timeout-ac 0 +powercfg /change disk-timeout-dc 20 + +reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f + +powercfg /SETACTIVE /SCHEME_MIN +powercfg /SETDCVALUEINDEX SCHEME_MIN SUB_BUTTONS LIDACTION 0 +powercfg /SETACVALUEINDEX SCHEME_MIN SUB_BUTTONS LIDACTION 0 +powercfg /SETDCVALUEINDEX SCHEME_MIN SUB_BUTTONS PBUTTONACTION 3 +powercfg /SETACVALUEINDEX SCHEME_MIN SUB_BUTTONS PBUTTONACTION 3 + +reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search" /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f +reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowCortanaButton /t REG_DWORD /d 0 /f +reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowTaskViewButton /t REG_DWORD /d 0 /f + +reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer" /v EnableAutoTray /t REG_DWORD /d 0 /f + +reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" /v NoTileApplicationNotification /t REG_DWORD /d 1 /f + +reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace" /v {0DB7E03F-FC29-4DC6-9020-FF41B59E513A} /f + +reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Feeds" /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2 /f + </File> + <File path="C:\Windows\Setup\Scripts\Specialize.ps1"> +$scripts = @( + { + reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f; + }; + { + @( + 'C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk'; + 'C:\Windows\System32\OneDriveSetup.exe'; + 'C:\Windows\SysWOW64\OneDriveSetup.exe'; + ) | Where-Object -FilterScript { [System.IO.File]::Exists( $_ ); } | Remove-Item -Verbose -ErrorAction 'Continue'; + }; + { + Remove-Item -LiteralPath 'Registry::HKLM\Software\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' -Force -ErrorAction 'SilentlyContinue'; + }; + { + &amp; 'C:\Windows\Setup\Scripts\RemovePackage.ps1'; + }; + { + &amp; 'C:\Windows\Setup\Scripts\RemoveCapability.ps1'; + }; + { + &amp; 'C:\Windows\Setup\Scripts\RemoveFeature.ps1'; + }; + { + net.exe accounts /maxpwage:UNLIMITED; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableCloudOptimizedContent" /t REG_DWORD /d 1 /f; + [System.Diagnostics.EventLog]::CreateEventSource( 'UnattendGenerator', 'Application' ); + }; + { + Register-ScheduledTask -TaskName 'UnlockStartLayout' -Xml $( Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\UnlockStartLayout.xml' -Raw ); + }; + { + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f + }; + { + netsh.exe advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes; + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f; + }; + { + Remove-Item -LiteralPath 'C:\Users\Public\Desktop\Microsoft Edge.lnk' -ErrorAction 'SilentlyContinue' -Verbose; + }; + { + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 4 /f; + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 1 /f; + }; + { + Register-ScheduledTask -TaskName 'MoveActiveHours' -Xml $( Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\MoveActiveHours.xml' -Raw ); + }; + { + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f; + }; + { + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\BitLocker" /v "PreventDeviceEncryption" /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Edge" /v HideFirstRunExperience /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v BackgroundModeEnabled /t REG_DWORD /d 0 /f; + reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v StartupBoostEnabled /t REG_DWORD /d 0 /f; + }; + { + &amp; 'C:\Windows\Setup\Scripts\SetStartPins.ps1'; + }; + { + C:\Windows\Setup\Scripts\unattend-01.cmd; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\Specialize.log"; + </File> + <File path="C:\Windows\Setup\Scripts\UserOnce.ps1"> +$scripts = @( + { + Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' | Remove-AppxPackage; + }; + { + [System.Diagnostics.EventLog]::WriteEntry( 'UnattendGenerator', "User '$env:USERNAME' has requested to unlock the Start menu layout.", [System.Diagnostics.EventLogEntryType]::Information, 1 ); + }; + { + Remove-Item -LiteralPath "${env:USERPROFILE}\Desktop\Microsoft Edge.lnk" -ErrorAction 'SilentlyContinue' -Verbose; + }; + { + reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /f; + }; + { + Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -Type 'DWord' -Value 1; + }; + { + Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Search' -Name 'SearchboxTaskbarMode' -Type 'DWord' -Value 0; + }; + { + Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript { + $_.SessionId -eq ( Get-Process -Id $PID ).SessionId; + } | Stop-Process -Force; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to configure this user account. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "$env:TEMP\UserOnce.log"; + </File> + <File path="C:\Windows\Setup\Scripts\DefaultUser.ps1"> +$scripts = @( + { + reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\WindowsCopilot" /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f; + }; + { + Remove-ItemProperty -LiteralPath 'Registry::HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run' -Name 'OneDriveSetup' -Force -ErrorAction 'Continue'; + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\GameDVR" /v AppCaptureEnabled /t REG_DWORD /d 0 /f; + }; + { + reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v "StartLayoutFile" /t REG_SZ /d "C:\Windows\Setup\Scripts\TaskbarLayoutModification.xml" /f; + reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v "LockedStartLayout" /t REG_DWORD /d 1 /f; + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f; + }; + { + $names = @( + 'ContentDeliveryAllowed'; + 'FeatureManagementEnabled'; + 'OEMPreInstalledAppsEnabled'; + 'PreInstalledAppsEnabled'; + 'PreInstalledAppsEverEnabled'; + 'SilentInstalledAppsEnabled'; + 'SoftLandingEnabled'; + 'SubscribedContentEnabled'; + 'SubscribedContent-310093Enabled'; + 'SubscribedContent-338387Enabled'; + 'SubscribedContent-338388Enabled'; + 'SubscribedContent-338389Enabled'; + 'SubscribedContent-338393Enabled'; + 'SubscribedContent-353694Enabled'; + 'SubscribedContent-353696Enabled'; + 'SubscribedContent-353698Enabled'; + 'SystemPaneSuggestionsEnabled'; + ); + + foreach( $name in $names ) { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v $name /t REG_DWORD /d 0 /f; + } + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f; + }; + { + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle \""Normal\"" -ExecutionPolicy \""Unrestricted\"" -NoProfile -File \""C:\Windows\Setup\Scripts\UserOnce.ps1\""" /f; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to modify the default user&#x2019;&#x2019;s registry hive. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\DefaultUser.log"; + </File> + <File path="C:\Windows\Setup\Scripts\FirstLogon.ps1"> +$scripts = @( + { + Set-ItemProperty -LiteralPath 'Registry::HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'AutoLogonCount' -Type 'DWord' -Force -Value 0; + }; + { + Remove-Item -LiteralPath @( + 'C:\Windows\Panther\unattend.xml'; + 'C:\Windows\Panther\unattend-original.xml'; + 'C:\Windows\Setup\Scripts\Wifi.xml'; + ) -Force -ErrorAction 'SilentlyContinue' -Verbose; + }; +); + +&amp; { + [float] $complete = 0; + [float] $increment = 100 / $scripts.Count; + foreach( $script in $scripts ) { + Write-Progress -Id 0 -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete; + '*** Will now execute command &#xAB;{0}&#xBB;.' -f $( + $script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;'; + ); + $start = [datetime]::Now; + &amp; $script; + '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds; + "`r`n" * 3; + $complete += $increment; + } +} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\FirstLogon.log"; + </File> + </Extensions> +</unattend> \ No newline at end of file