727 lines
36 KiB
XML
727 lines
36 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
|
<!--https://schneegans.de/windows/unattend-generator/?LanguageMode=Unattended&UILanguage=en-US&Locale=en-GB&Keyboard=00000809&GeoLocation=242&ProcessorArchitecture=amd64&ComputerNameMode=Random&CompactOsMode=Default&TimeZoneMode=Implicit&PartitionMode=Interactive&DiskAssertionMode=Skip&WindowsEditionMode=Firmware&InstallFromMode=Automatic&PEMode=Default&UserAccountMode=Unattended&AccountName0=LocalAdmin&AccountDisplayName0=Local+Admin&AccountPassword0=&AccountGroup0=Administrators&AutoLogonMode=Own&PasswordExpirationMode=Unlimited&LockoutMode=Custom&LockoutThreshold=5&LockoutWindow=10&LockoutDuration=30&HideFiles=Hidden&TaskbarSearch=Icon&TaskbarIconsMode=Default&DisableWidgets=true&LeftTaskbar=true&HideTaskViewButton=true&DisableBingResults=true&StartTilesMode=Empty&StartPinsMode=Empty&DisableFastStartup=true&EnableLongPaths=true&HardenSystemDriveAcl=true&TurnOffSystemSounds=true&DisableAppSuggestions=true&HideEdgeFre=true&DisableEdgeStartupBoost=true&EffectsMode=Custom&ListviewShadow=true&ThumbnailsOrIcon=true&DragFullWindows=true&FontSmoothing=true&ListBoxSmoothScrolling=true&DesktopIconsMode=Default&StartFoldersMode=Custom&StartFolderDocuments=true&StartFolderDownloads=true&StartFolderFileExplorer=true&StartFolderNetwork=true&StartFolderSettings=true&WifiMode=Skip&ExpressSettings=DisableAll&LockKeysMode=Configure&CapsLockInitial=Off&CapsLockBehavior=Toggle&NumLockInitial=On&NumLockBehavior=Toggle&ScrollLockInitial=Off&ScrollLockBehavior=Toggle&StickyKeysMode=Disabled&ColorMode=Custom&SystemColorTheme=Dark&AppsColorTheme=Dark&AccentColor=%230078d4&WallpaperMode=Default&LockScreenMode=Default&Remove3DViewer=true&RemoveBingSearch=true&RemoveCamera=true&RemoveClipchamp=true&RemoveCopilot=true&RemoveCortana=true&RemoveDevHome=true&RemoveWindowsHello=true&RemoveFamily=true&RemoveFeedbackHub=true&RemoveGameAssist=true&RemoveGetHelp=true&RemoveHandwriting=true&RemoveInternetExplorer=true&RemoveMailCalendar=true&RemoveMaps=true&RemoveMathInputPanel=true&RemoveMediaFeatures=true&RemoveMixedReality=true&RemoveZuneVideo=true&RemoveNews=true&RemoveOffice365=true&RemoveOneNote=true&RemoveOneSync=true&RemovePaint3D=true&RemovePeople=true&RemovePowerAutomate=true&RemovePowerShell2=true&RemoveRecall=true&RemoveSkype=true&RemoveSolitaire=true&RemoveSpeech=true&RemoveStepsRecorder=true&RemoveStickyNotes=true&RemoveTeams=true&RemoveGetStarted=true&RemoveToDo=true&RemoveVoiceRecorder=true&RemoveWallet=true&RemoveWeather=true&RemoveFaxAndScan=true&RemoveWindowsMediaPlayer=true&RemoveZuneMusic=true&RemoveWordPad=true&RemoveXboxApps=true&RemoveYourPhone=true&WdacMode=Skip-->
|
|
<settings pass="offlineServicing"></settings>
|
|
<settings pass="windowsPE">
|
|
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<UILanguage>en-US</UILanguage>
|
|
</component>
|
|
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<UserData>
|
|
<ProductKey>
|
|
<Key>00000-00000-00000-00000-00000</Key>
|
|
<WillShowUI>OnError</WillShowUI>
|
|
</ProductKey>
|
|
<AcceptEula>true</AcceptEula>
|
|
</UserData>
|
|
<UseConfigurationSet>false</UseConfigurationSet>
|
|
</component>
|
|
</settings>
|
|
<settings pass="generalize"></settings>
|
|
<settings pass="specialize">
|
|
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<RunSynchronous>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>1</Order>
|
|
<Path>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;"</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>2</Order>
|
|
<Path>powershell.exe -WindowStyle Normal -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\Specialize.ps1' -Raw | Invoke-Expression;"</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>3</Order>
|
|
<Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT"</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>4</Order>
|
|
<Path>powershell.exe -WindowStyle Normal -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\DefaultUser.ps1' -Raw | Invoke-Expression;"</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>5</Order>
|
|
<Path>reg.exe unload "HKU\DefaultUser"</Path>
|
|
</RunSynchronousCommand>
|
|
</RunSynchronous>
|
|
</component>
|
|
</settings>
|
|
<settings pass="auditSystem"></settings>
|
|
<settings pass="auditUser"></settings>
|
|
<settings pass="oobeSystem">
|
|
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<InputLocale>0809:00000809</InputLocale>
|
|
<SystemLocale>en-GB</SystemLocale>
|
|
<UILanguage>en-US</UILanguage>
|
|
<UserLocale>en-GB</UserLocale>
|
|
</component>
|
|
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<UserAccounts>
|
|
<LocalAccounts>
|
|
<LocalAccount wcm:action="add">
|
|
<Name>LocalAdmin</Name>
|
|
<DisplayName>Local Admin</DisplayName>
|
|
<Group>Administrators</Group>
|
|
<Password>
|
|
<Value></Value>
|
|
<PlainText>true</PlainText>
|
|
</Password>
|
|
</LocalAccount>
|
|
</LocalAccounts>
|
|
</UserAccounts>
|
|
<AutoLogon>
|
|
<Username>LocalAdmin</Username>
|
|
<Enabled>true</Enabled>
|
|
<LogonCount>1</LogonCount>
|
|
<Password>
|
|
<Value></Value>
|
|
<PlainText>true</PlainText>
|
|
</Password>
|
|
</AutoLogon>
|
|
<OOBE>
|
|
<ProtectYourPC>3</ProtectYourPC>
|
|
<HideEULAPage>true</HideEULAPage>
|
|
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
|
<HideOnlineAccountScreens>false</HideOnlineAccountScreens>
|
|
</OOBE>
|
|
<FirstLogonCommands>
|
|
<SynchronousCommand wcm:action="add">
|
|
<Order>1</Order>
|
|
<CommandLine>powershell.exe -WindowStyle Normal -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\FirstLogon.ps1' -Raw | Invoke-Expression;"</CommandLine>
|
|
</SynchronousCommand>
|
|
</FirstLogonCommands>
|
|
</component>
|
|
</settings>
|
|
<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
|
|
<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\RemovePackages.ps1">
|
|
$selectors = @(
|
|
'Microsoft.Microsoft3DViewer';
|
|
'Microsoft.BingSearch';
|
|
'Microsoft.WindowsCamera';
|
|
'Clipchamp.Clipchamp';
|
|
'Microsoft.Copilot';
|
|
'Microsoft.549981C3F5F10';
|
|
'Microsoft.Windows.DevHome';
|
|
'MicrosoftCorporationII.MicrosoftFamily';
|
|
'Microsoft.WindowsFeedbackHub';
|
|
'Microsoft.Edge.GameAssist';
|
|
'Microsoft.GetHelp';
|
|
'Microsoft.Getstarted';
|
|
'microsoft.windowscommunicationsapps';
|
|
'Microsoft.WindowsMaps';
|
|
'Microsoft.MixedReality.Portal';
|
|
'Microsoft.BingNews';
|
|
'Microsoft.MicrosoftOfficeHub';
|
|
'Microsoft.Office.OneNote';
|
|
'Microsoft.MSPaint';
|
|
'Microsoft.People';
|
|
'Microsoft.PowerAutomateDesktop';
|
|
'Microsoft.SkypeApp';
|
|
'Microsoft.MicrosoftSolitaireCollection';
|
|
'Microsoft.MicrosoftStickyNotes';
|
|
'MicrosoftTeams';
|
|
'MSTeams';
|
|
'Microsoft.Todos';
|
|
'Microsoft.WindowsSoundRecorder';
|
|
'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';
|
|
$logfile = 'C:\Windows\Setup\Scripts\RemovePackages.log';
|
|
& {
|
|
$installed = & $getCommand;
|
|
foreach( $selector in $selectors ) {
|
|
$result = [ordered] @{
|
|
Selector = $selector;
|
|
};
|
|
$found = $installed | Where-Object -FilterScript $filterCommand;
|
|
if( $found ) {
|
|
$result.Output = $found | & $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;
|
|
}
|
|
} *>&1 >> $logfile;
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\RemoveCapabilities.ps1">
|
|
$selectors = @(
|
|
'Print.Fax.Scan';
|
|
'Language.Handwriting';
|
|
'Browser.InternetExplorer';
|
|
'MathRecognizer';
|
|
'OneCoreUAP.OneSync';
|
|
'Language.Speech';
|
|
'Language.TextToSpeech';
|
|
'App.StepsRecorder';
|
|
'Hello.Face.18967';
|
|
'Hello.Face.Migration.18967';
|
|
'Hello.Face.20134';
|
|
'Media.WindowsMediaPlayer';
|
|
'Microsoft.Windows.WordPad';
|
|
);
|
|
$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';
|
|
$logfile = 'C:\Windows\Setup\Scripts\RemoveCapabilities.log';
|
|
& {
|
|
$installed = & $getCommand;
|
|
foreach( $selector in $selectors ) {
|
|
$result = [ordered] @{
|
|
Selector = $selector;
|
|
};
|
|
$found = $installed | Where-Object -FilterScript $filterCommand;
|
|
if( $found ) {
|
|
$result.Output = $found | & $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;
|
|
}
|
|
} *>&1 >> $logfile;
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\RemoveFeatures.ps1">
|
|
$selectors = @(
|
|
'MediaPlayback';
|
|
'MicrosoftWindowsPowerShellV2Root';
|
|
'Recall';
|
|
);
|
|
$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';
|
|
$logfile = 'C:\Windows\Setup\Scripts\RemoveFeatures.log';
|
|
& {
|
|
$installed = & $getCommand;
|
|
foreach( $selector in $selectors ) {
|
|
$result = [ordered] @{
|
|
Selector = $selector;
|
|
};
|
|
$found = $installed | Where-Object -FilterScript $filterCommand;
|
|
if( $found ) {
|
|
$result.Output = $found | & $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;
|
|
}
|
|
} *>&1 >> $logfile;
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\TurnOffSystemSounds.ps1">
|
|
$excludes = Get-ChildItem -LiteralPath 'Registry::HKU\DefaultUser\AppEvents\EventLabels' |
|
|
Where-Object -FilterScript { ($_ | Get-ItemProperty).ExcludeFromCPL -eq 1; } |
|
|
Select-Object -ExpandProperty 'PSChildName';
|
|
Get-ChildItem -Path 'Registry::HKU\DefaultUser\AppEvents\Schemes\Apps\*\*' |
|
|
Where-Object -Property 'PSChildName' -NotIn $excludes |
|
|
Get-ChildItem -Include '.Current' | Set-ItemProperty -Name '(Default)' -Value '';
|
|
</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">
|
|
<LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
|
|
<LayoutOptions StartTileGroupCellWidth="6" />
|
|
<DefaultLayoutOverride>
|
|
<StartLayoutCollection>
|
|
<StartLayout GroupCellWidth="6" xmlns="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" />
|
|
</StartLayoutCollection>
|
|
</DefaultLayoutOverride>
|
|
</LayoutModificationTemplate>
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\SetColorTheme.ps1">
|
|
$lightThemeSystem = 0;
|
|
$lightThemeApps = 0;
|
|
$accentColorOnStart = 0;
|
|
$enableTransparency = 0;
|
|
$htmlAccentColor = '#0078D4';
|
|
& {
|
|
$params = @{
|
|
LiteralPath = 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize';
|
|
Force = $true;
|
|
Type = 'DWord';
|
|
};
|
|
Set-ItemProperty @params -Name 'SystemUsesLightTheme' -Value $lightThemeSystem;
|
|
Set-ItemProperty @params -Name 'AppsUseLightTheme' -Value $lightThemeApps;
|
|
Set-ItemProperty @params -Name 'ColorPrevalence' -Value $accentColorOnStart;
|
|
Set-ItemProperty @params -Name 'EnableTransparency' -Value $enableTransparency;
|
|
};
|
|
& {
|
|
Add-Type -AssemblyName 'System.Drawing';
|
|
$accentColor = [System.Drawing.ColorTranslator]::FromHtml( $htmlAccentColor );
|
|
|
|
function ConvertTo-DWord {
|
|
param(
|
|
[System.Drawing.Color]
|
|
$Color
|
|
);
|
|
|
|
[byte[]] $bytes = @(
|
|
$Color.R;
|
|
$Color.G;
|
|
$Color.B;
|
|
$Color.A;
|
|
);
|
|
return [System.BitConverter]::ToUInt32( $bytes, 0);
|
|
}
|
|
|
|
$startColor = [System.Drawing.Color]::FromArgb( 0xD2, $accentColor );
|
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent' -Name 'StartColorMenu' -Value( ConvertTo-DWord -Color $accentColor ) -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent' -Name 'AccentColorMenu' -Value( ConvertTo-DWord -Color $accentColor ) -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\DWM' -Name 'AccentColor' -Value( ConvertTo-DWord -Color $accentColor ) -Type 'DWord' -Force;
|
|
$params = @{
|
|
LiteralPath = 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent';
|
|
Name = 'AccentPalette';
|
|
};
|
|
$palette = Get-ItemPropertyValue @params;
|
|
$index = 20;
|
|
$palette[ $index++ ] = $accentColor.R;
|
|
$palette[ $index++ ] = $accentColor.G;
|
|
$palette[ $index++ ] = $accentColor.B;
|
|
$palette[ $index++ ] = $accentColor.A;
|
|
Set-ItemProperty @params -Value $palette -Type 'Binary' -Force;
|
|
};
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\Specialize.ps1">
|
|
$scripts = @(
|
|
{
|
|
Remove-Item -LiteralPath 'Registry::HKLM\Software\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate' -Force -ErrorAction 'SilentlyContinue';
|
|
};
|
|
{
|
|
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f;
|
|
};
|
|
{
|
|
Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\RemovePackages.ps1' -Raw | Invoke-Expression;
|
|
};
|
|
{
|
|
Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\RemoveCapabilities.ps1' -Raw | Invoke-Expression;
|
|
};
|
|
{
|
|
Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\RemoveFeatures.ps1' -Raw | Invoke-Expression;
|
|
};
|
|
{
|
|
net.exe accounts /lockoutthreshold:5 /lockoutduration:30 /lockoutwindow:10;
|
|
};
|
|
{
|
|
net.exe accounts /maxpwage:UNLIMITED;
|
|
};
|
|
{
|
|
reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
|
|
};
|
|
{
|
|
icacls.exe C:\ /remove:g "*S-1-5-11"
|
|
};
|
|
{
|
|
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\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" /v DisableStartupSound /t REG_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EditionOverrides" /v UserSetting_DisableStartupSound /t REG_DWORD /d 1 /f;
|
|
};
|
|
{
|
|
reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /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;
|
|
};
|
|
{
|
|
Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\SetStartPins.ps1' -Raw | Invoke-Expression;
|
|
};
|
|
{
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow" -Name 'DefaultValue' -Value 1 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon" -Name 'DefaultValue' -Value 1 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows" -Name 'DefaultValue' -Value 1 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing" -Name 'DefaultValue' -Value 1 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling" -Name 'DefaultValue' -Value 1 -Type 'DWord' -Force;
|
|
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
|
|
};
|
|
{
|
|
reg.exe add "HKU\.DEFAULT\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 10 /f;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[float] $complete = 0;
|
|
[float] $increment = 100 / $scripts.Count;
|
|
foreach( $script in $scripts ) {
|
|
Write-Progress -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete;
|
|
'*** Will now execute command «{0}».' -f $(
|
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
|
$max = 100;
|
|
if( $str.Length -le $max ) {
|
|
$str;
|
|
} else {
|
|
$str.Substring( 0, $max - 1 ) + '…';
|
|
}
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 >> "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;
|
|
};
|
|
{
|
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\AppEvents\Schemes' -Name '(Default)' -Type 'String' -Value '.None';
|
|
};
|
|
{
|
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Search' -Name 'SearchboxTaskbarMode' -Type 'DWord' -Value 1;
|
|
};
|
|
{
|
|
Set-ItemProperty -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Type 'DWord' -Value 3 -Force;
|
|
};
|
|
{
|
|
Set-ItemProperty -Path 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Start' -Name 'VisiblePlaces' -Value $( [convert]::FromBase64String('ztU0LVr6Q0WC8iLm6vd3PC+zZ+PeiVVDv85h83sYqTe8JIoUDNaJQqCAbtm7okiCRIF1/g0IrkKL2jTtl7ZjlIYIc1KqUUNCn3sndlhGWdQ=') ) -Type 'Binary';
|
|
};
|
|
{
|
|
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;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[float] $complete = 0;
|
|
[float] $increment = 100 / $scripts.Count;
|
|
foreach( $script in $scripts ) {
|
|
Write-Progress -Activity 'Running scripts to configure this user account. Do not close this window.' -PercentComplete $complete;
|
|
'*** Will now execute command «{0}».' -f $(
|
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
|
$max = 100;
|
|
if( $str.Length -le $max ) {
|
|
$str;
|
|
} else {
|
|
$str.Substring( 0, $max - 1 ) + '…';
|
|
}
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 >> "$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;
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /f;
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\GameDVR" /v AppCaptureEnabled /t REG_DWORD /d 0 /f;
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowTaskViewButton /t REG_DWORD /d 0 /f;
|
|
};
|
|
{
|
|
Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\TurnOffSystemSounds.ps1' -Raw | Invoke-Expression;
|
|
};
|
|
{
|
|
$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;
|
|
};
|
|
{
|
|
foreach( $root in 'Registry::HKU\.DEFAULT', 'Registry::HKU\DefaultUser' ) {
|
|
Set-ItemProperty -LiteralPath "$root\Control Panel\Keyboard" -Name 'InitialKeyboardIndicators' -Type 'String' -Value 2 -Force;
|
|
}
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f;
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 10 /f;
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\DWM" /v ColorPrevalence /t REG_DWORD /d 0 /f;
|
|
};
|
|
<!-- Custom Part to disable Windows telemetry -->
|
|
{
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v AllowTelemetry /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\SQMClient\Windows" /v CEIPEnable /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" /v Enabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowDeviceNameInTelemetry /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v LimitDiagnosticLogCollection /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v LimitDumpCollection /t reg_DWORD /d 0 /f;
|
|
};
|
|
{
|
|
reg.exe add "HKLM\Software\Policies\Microsoft\Windows\DataCollection" /v DoNotShowFeedbackNotifications /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\Policies\Microsoft\Windows\AdvertisingInfo" /v DisabledByGroupPolicy /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /v Disabled /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /v DODownloadMode /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\Software\Policies\Microsoft\Windows\DeliveryOptimization" /v DODownloadMode /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\System\CurrentControlSet\Control\Remote Assistance" /v fAllowToGetHelp /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\System\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v SystemResponsiveness /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v NetworkThrottlingIndex /t reg_DWORD /d 4294967295 /f;
|
|
reg.exe add "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" /v ClearPageFileAtShutdown /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKLM\System\ControlSet001\Services\Ndu" /v Start /t reg_DWORD /d 2 /f;
|
|
reg.exe add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v IRPStackSize /t reg_DWORD /d 30 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v VerboseStatus /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\\PolicyManager\\current\\device\\Start" /v HideRecommendedSection /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\Microsoft\\PolicyManager\\current\\device\\IsEducationEnvironment" /v Start /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\Software\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer" /v HideRecommendedSection /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\System\CurrentControlSet\\Control\\CrashControl" /v DisplayParameters /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKLM\System\CurrentControlSet\\Control\\CrashControl" /v DisableEmoticon /t reg_DWORD /d 1 /f;
|
|
};
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Windows Feeds" /v EnableFeeds /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Feeds" /v ShellFeedsTaskbarViewMode /t reg_DWORD /d 2 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v HideSCAMeetNow /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" /v ScoobeSystemSettingEnabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v ContentDeliveryAllowed /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreInstalledAppsEnabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreInstalledAppsEnabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreInstalledAppsEverEnabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SubscribedContent-338387Enabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SubscribedContent-338388Enabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SubscribedContent-338389Enabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SubscribedContent-353698Enabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SystemPaneSuggestionsEnabled /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\CloudContent" /v DisableTailoredExperiencesWithDiagnosticData /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" /v EnthusiastMode /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowTaskViewButton /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" /v PeopleBand /t reg_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKU\DefaultUser\Control Panel\Desktop" /v AutoEndTasks /t reg_DWORD /d 1 /f;
|
|
reg.exe add "HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v CortanaConsent /t REG_DWORD /d 0 /f;
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\TaskbarDeveloperSettings" /v TaskbarEndTask /t REG_DWORD /d 1 /f;
|
|
};
|
|
{
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\MareBackup" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\StartupAppTask" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\PcaPatchDbTask" -ErrorAction SilentlyContinue;
|
|
Disable-ScheduledTask -TaskName "Microsoft\Windows\Maps\MapsUpdateTask" -ErrorAction SilentlyContinue;
|
|
};
|
|
{
|
|
Stop-Service "dmwappushservice" -Force;
|
|
Set-Service "dmwappushservice" -StartupType Disabled -Force;
|
|
};
|
|
<!-- End of custom part ( different from the web xml generator) -->
|
|
{
|
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle Normal -NoProfile -Command \""Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\UserOnce.ps1' -Raw | Invoke-Expression;\""" /f;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[float] $complete = 0;
|
|
[float] $increment = 100 / $scripts.Count;
|
|
foreach( $script in $scripts ) {
|
|
Write-Progress -Activity 'Running scripts to modify the default user’’s registry hive. Do not close this window.' -PercentComplete $complete;
|
|
'*** Will now execute command «{0}».' -f $(
|
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
|
$max = 100;
|
|
if( $str.Length -le $max ) {
|
|
$str;
|
|
} else {
|
|
$str.Substring( 0, $max - 1 ) + '…';
|
|
}
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 >> "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;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[float] $complete = 0;
|
|
[float] $increment = 100 / $scripts.Count;
|
|
foreach( $script in $scripts ) {
|
|
Write-Progress -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete;
|
|
'*** Will now execute command «{0}».' -f $(
|
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
|
$max = 100;
|
|
if( $str.Length -le $max ) {
|
|
$str;
|
|
} else {
|
|
$str.Substring( 0, $max - 1 ) + '…';
|
|
}
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 >> "C:\Windows\Setup\Scripts\FirstLogon.log";
|
|
</File>
|
|
</Extensions>
|
|
</unattend> |