728 lines
36 KiB
XML
728 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=de-DE&Locale=de-DE&Keyboard=00000407&GeoLocation=94&PEMode=Default&WindowsEditionMode=Generic&WindowsEdition=pro&ProcessorArchitecture=amd64&BypassRequirementsCheck=true&BypassNetworkCheck=true&ComputerNameMode=Random&TimeZoneMode=Explicit&TimeZone=W.+Europe+Standard+Time&UserAccountMode=Unattended&AccountName0=root&AccountDisplayName0=&AccountPassword0=root&AccountGroup0=Administrators&AutoLogonMode=Own&PasswordExpirationMode=Unlimited&LockoutMode=Default&HideFiles=Hidden&ShowFileExtensions=true&ClassicContextMenu=true&LaunchToThisPC=true&TaskbarSearch=Hide&TaskbarIconsMode=Empty&DisableWidgets=true&LeftTaskbar=true&StartTilesMode=Empty&StartPinsMode=Empty&DisableFastStartup=true&EnableLongPaths=true&EnableRemoteDesktop=true&PreventAutomaticReboot=true&DisableAppSuggestions=true&PreventDeviceEncryption=true&HideEdgeFre=true&DisableEdgeStartupBoost=true&EffectsMode=Default&DeleteEdgeDesktopIcon=true&DesktopIconsMode=Default&StartFoldersMode=Default&CoreIsolationMode=Enabled&WifiMode=Interactive&ExpressSettings=DisableAll&LockKeysMode=Skip&StickyKeysMode=Default&ColorMode=Default&WallpaperMode=Default&LockScreenMode=Default&Remove3DViewer=true&RemoveBingSearch=true&RemoveCopilot=true&RemoveCortana=true&RemoveWindowsHello=true&RemoveFamily=true&RemoveFeedbackHub=true&RemoveMailCalendar=true&RemoveMaps=true&RemoveMixedReality=true&RemoveZuneVideo=true&RemoveNews=true&RemoveOffice365=true&RemoveOneDrive=true&RemoveOneNote=true&RemoveOneSync=true&RemoveOutlook=true&RemovePeople=true&RemoveQuickAssist=true&RemoveRecall=true&RemoveSkype=true&RemoveSnippingTool=true&RemoveSolitaire=true&RemoveStickyNotes=true&RemoveGetStarted=true&RemoveToDo=true&RemoveWallet=true&RemoveWeather=true&RemoveWindowsMediaPlayer=true&RemoveZuneMusic=true&RemoveXboxApps=true&RemoveYourPhone=true&SystemScript0=%40echo+off%0D%0A%0D%0Arem+%2D%2D%2D%2D+Windows+11+Tweaks+%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%0D%0A%0D%0Arem+%2D%2D-+Startmen%C3%BC+links%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%5CAdvanced%22+%2Fv+TaskbarAl+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%5CAdvanced%22+%2Fv+TaskbarDa+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CClasses%5CCLSID%5C%7B86ca1aa0-34aa-4e8b-a509-50c905bae2a2%7D%5CInprocServer32%22+%2Fv+Standard+%2Ft+REG_SZ+%2Ff%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSOFTWARE%5CPolicies%5CMicrosoft%5CWindows%5CExplorer%22+%2Fv+DisableSearchBoxSuggestions+%2Ft+REG_DWORD+%2Fd+1+%2FF%0D%0Areg+add+%22HKEY_LOCAL_MACHINE%5CSOFTWARE%5CPolicies%5CMicrosoft%5CWindows%5CDataCollection%22+%2Fv+AllowTelemetry+%2Ft+REG_DWORD+%2Fd+1+%2FF%0D%0Areg+add+%22HKEY_LOCAL_MACHINE%5CSOFTWARE%5CPolicies%5CMicrosoft%5CWindows%5CWindowsSearch%22+%2Fv+AllowCortana+%2Ft+REG_DWORD+%2Fd+0+%2FF%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CPolicies%5CMicrosoft%5CTabletPC%22+%2Fv+DisableSnippingTool+%2Ft+REG_DWORD+%2Fd+1+%2FF%0D%0A%0D%0Arem+reg+add+%22HKEY_LOCAL_MACHINE%5CSYSTEM%5CSetup%5CMoSetup%22+%2Fv+AllowUpgradesWithUnsupportedTPMOrCPU+%2Ft+REG_DWORD+%2Fd+1%0D%0A%0D%0Arem+%2D%2D%2D%2D+OneDrive+deaktivieren+%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%0D%0Ataskkill+%2Ff+%2Fim+OneDrive.exe%0D%0AREG+DELETE+%22HKEY_CLASSES_ROOT%5CCLSID%5C%7B018D5C66-4533-4307-9B53-224DE2ED1FE6%7D%22+%2Ff+%0D%0AREG+DELETE+%22HKEY_CLASSES_ROOT%5CWow6432Node%5CCLSID%5C%7B018D5C66-4533-4307-9B53-224DE2ED1FE6%7D%22+%2Ff+%0D%0AREG+DELETE+%22HKEY_CURRENT_USER%5CSoftware%5CClasses%5CCLSID%5C%7B018D5C66-4533-4307-9B53-224DE2ED1FE6%7D%5CShellFolder%22+%2Ff+%0D%0AREG+DELETE+%22HKEY_CURRENT_USER%5CSoftware%5CClasses%5CWow6432Node%5CCLSID%5C%7B018D5C66-4533-4307-9B53-224DE2ED1FE6%7D%5CShellFolder%22+%2Ff+%0D%0AREG+DELETE+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CRun%22+%2Fv+%22OneDrive%22+%2Ff%0D%0A%0D%0Areg+add+%22HKCU%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%5CAdvanced%22+%2Fv+HideFileExt+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0A%0D%0Apowercfg+%2Fchange+standby-timeout-ac+0%0D%0Apowercfg+%2Fchange+standby-timeout-dc+10%0D%0Apowercfg+%2Fchange+hibernate-timeout-ac+0%0D%0Apowercfg+%2Fchange+hibernate-timeout-dc+10%0D%0Apowercfg+%2Fchange+monitor-timeout-ac+30%0D%0Apowercfg+%2Fchange+monitor-timeout-dc+10%0D%0Apowercfg+%2Fchange+disk-timeout-ac+0%0D%0Apowercfg+%2Fchange+disk-timeout-dc+20%0D%0A%0D%0Areg+add+%22HKLM%5CSystem%5CCurrentControlSet%5CControl%5CSession+Manager%5CPower%22+%2Fv+HiberbootEnabled+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0A%0D%0Apowercfg+%2FSETACTIVE+%2FSCHEME_MIN%0D%0Apowercfg+%2FSETDCVALUEINDEX+SCHEME_MIN+SUB_BUTTONS+LIDACTION+0%0D%0Apowercfg+%2FSETACVALUEINDEX+SCHEME_MIN+SUB_BUTTONS+LIDACTION+0%0D%0Apowercfg+%2FSETDCVALUEINDEX+SCHEME_MIN+SUB_BUTTONS+PBUTTONACTION+3%0D%0Apowercfg+%2FSETACVALUEINDEX+SCHEME_MIN+SUB_BUTTONS+PBUTTONACTION+3%0D%0A%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CSearch%22+%2Fv+SearchboxTaskbarMode+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%5CAdvanced%22+%2Fv+ShowCortanaButton+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%5CAdvanced%22+%2Fv+ShowTaskViewButton+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0A%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%22+%2Fv+EnableAutoTray+%2Ft+REG_DWORD+%2Fd+0+%2Ff%0D%0A%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSoftware%5CPolicies%5CMicrosoft%5CWindows%5CCurrentVersion%5CPushNotifications%22+%2Fv+NoTileApplicationNotification+%2Ft+REG_DWORD+%2Fd+1+%2Ff%0D%0A%0D%0Areg+delete+%22HKEY_LOCAL_MACHINE%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CExplorer%5CMyComputer%5CNameSpace%22+%2Fv+%7B0DB7E03F-FC29-4DC6-9020-FF41B59E513A%7D+%2Ff%0D%0A%0D%0Areg+add+%22HKEY_CURRENT_USER%5CSOFTWARE%5CMicrosoft%5CWindows%5CCurrentVersion%5CFeeds%22+%2Fv+ShellFeedsTaskbarViewMode+%2Ft+REG_DWORD+%2Fd+2+%2Ff%0D%0A%0D%0A%0D%0A&SystemScriptType0=Cmd&RestartExplorer=true&AppLockerMode=Skip-->
|
|
<settings pass="offlineServicing"></settings>
|
|
<settings pass="windowsPE">
|
|
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<UILanguage>de-DE</UILanguage>
|
|
</component>
|
|
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<UserData>
|
|
<ProductKey>
|
|
<Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
|
|
<WillShowUI>OnError</WillShowUI>
|
|
</ProductKey>
|
|
<AcceptEula>true</AcceptEula>
|
|
</UserData>
|
|
<UseConfigurationSet>false</UseConfigurationSet>
|
|
<RunSynchronous>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>1</Order>
|
|
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>2</Order>
|
|
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>3</Order>
|
|
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
|
|
</RunSynchronousCommand>
|
|
</RunSynchronous>
|
|
</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" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\Specialize.ps1"</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" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\DefaultUser.ps1"</Path>
|
|
</RunSynchronousCommand>
|
|
<RunSynchronousCommand wcm:action="add">
|
|
<Order>5</Order>
|
|
<Path>reg.exe unload "HKU\DefaultUser"</Path>
|
|
</RunSynchronousCommand>
|
|
</RunSynchronous>
|
|
</component>
|
|
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<TimeZone>W. Europe Standard Time</TimeZone>
|
|
</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>0407:00000407</InputLocale>
|
|
<SystemLocale>de-DE</SystemLocale>
|
|
<UILanguage>de-DE</UILanguage>
|
|
<UserLocale>de-DE</UserLocale>
|
|
</component>
|
|
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
|
<UserAccounts>
|
|
<LocalAccounts>
|
|
<LocalAccount wcm:action="add">
|
|
<Name>root</Name>
|
|
<DisplayName></DisplayName>
|
|
<Group>Administrators</Group>
|
|
<Password>
|
|
<Value>root</Value>
|
|
<PlainText>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 = & $getCommand;
|
|
foreach( $selector in $selectors ) {
|
|
$result = [ordered] @{
|
|
Selector = $selector;
|
|
};
|
|
if( $found = $installed | Where-Object -FilterScript $filterCommand ) {
|
|
$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;
|
|
}
|
|
</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 = & $getCommand;
|
|
foreach( $selector in $selectors ) {
|
|
$result = [ordered] @{
|
|
Selector = $selector;
|
|
};
|
|
if( $found = $installed | Where-Object -FilterScript $filterCommand ) {
|
|
$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;
|
|
}
|
|
</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 = & $getCommand;
|
|
foreach( $selector in $selectors ) {
|
|
$result = [ordered] @{
|
|
Selector = $selector;
|
|
};
|
|
if( $found = $installed | Where-Object -FilterScript $filterCommand ) {
|
|
$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;
|
|
}
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\TaskbarLayoutModification.xml">
|
|
<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">
|
|
<CustomTaskbarLayoutCollection PinListPlacement="Replace">
|
|
<defaultlayout:TaskbarLayout>
|
|
<taskbar:TaskbarPinList>
|
|
<taskbar:DesktopApp DesktopApplicationLinkPath="#leaveempty" />
|
|
</taskbar:TaskbarPinList>
|
|
</defaultlayout:TaskbarLayout>
|
|
</CustomTaskbarLayoutCollection>
|
|
</LayoutModificationTemplate>
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\UnlockStartLayout.vbs">
|
|
HKU = &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">
|
|
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
<Triggers>
|
|
<EventTrigger>
|
|
<Enabled>true</Enabled>
|
|
<Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Application"&gt;&lt;Select Path="Application"&gt;*[System[Provider[@Name='UnattendGenerator'] and EventID=1]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
|
|
</EventTrigger>
|
|
</Triggers>
|
|
<Principals>
|
|
<Principal id="Author">
|
|
<UserId>S-1-5-18</UserId>
|
|
<RunLevel>LeastPrivilege</RunLevel>
|
|
</Principal>
|
|
</Principals>
|
|
<Settings>
|
|
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
|
|
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
|
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
|
<AllowHardTerminate>true</AllowHardTerminate>
|
|
<StartWhenAvailable>false</StartWhenAvailable>
|
|
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
|
<IdleSettings>
|
|
<StopOnIdleEnd>true</StopOnIdleEnd>
|
|
<RestartOnIdle>false</RestartOnIdle>
|
|
</IdleSettings>
|
|
<AllowStartOnDemand>true</AllowStartOnDemand>
|
|
<Enabled>true</Enabled>
|
|
<Hidden>false</Hidden>
|
|
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
|
<WakeToRun>false</WakeToRun>
|
|
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
|
|
<Priority>7</Priority>
|
|
</Settings>
|
|
<Actions Context="Author">
|
|
<Exec>
|
|
<Command>C:\Windows\System32\wscript.exe</Command>
|
|
<Arguments>C:\Windows\Setup\Scripts\UnlockStartLayout.vbs</Arguments>
|
|
</Exec>
|
|
</Actions>
|
|
</Task>
|
|
</File>
|
|
<File path="C:\Windows\Setup\Scripts\MoveActiveHours.xml">
|
|
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
<Triggers>
|
|
<BootTrigger>
|
|
<Repetition>
|
|
<Interval>PT4H</Interval>
|
|
<StopAtDurationEnd>false</StopAtDurationEnd>
|
|
</Repetition>
|
|
<Enabled>true</Enabled>
|
|
</BootTrigger>
|
|
<RegistrationTrigger>
|
|
<Repetition>
|
|
<Interval>PT4H</Interval>
|
|
<StopAtDurationEnd>false</StopAtDurationEnd>
|
|
</Repetition>
|
|
<Enabled>true</Enabled>
|
|
</RegistrationTrigger>
|
|
</Triggers>
|
|
<Principals>
|
|
<Principal id="Author">
|
|
<UserId>S-1-5-19</UserId>
|
|
<RunLevel>LeastPrivilege</RunLevel>
|
|
</Principal>
|
|
</Principals>
|
|
<Settings>
|
|
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
|
|
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
|
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
|
<AllowHardTerminate>true</AllowHardTerminate>
|
|
<StartWhenAvailable>false</StartWhenAvailable>
|
|
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
|
<IdleSettings>
|
|
<StopOnIdleEnd>true</StopOnIdleEnd>
|
|
<RestartOnIdle>false</RestartOnIdle>
|
|
</IdleSettings>
|
|
<AllowStartOnDemand>true</AllowStartOnDemand>
|
|
<Enabled>true</Enabled>
|
|
<Hidden>false</Hidden>
|
|
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
|
<WakeToRun>false</WakeToRun>
|
|
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
|
|
<Priority>7</Priority>
|
|
</Settings>
|
|
<Actions Context="Author">
|
|
<Exec>
|
|
<Command>%windir%\System32\conhost.exe</Command>
|
|
<Arguments>--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;"</Arguments>
|
|
</Exec>
|
|
</Actions>
|
|
</Task>
|
|
</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\unattend-01.cmd">
|
|
@echo off
|
|
|
|
rem ---- Windows 11 Tweaks ----------------------------------------------------
|
|
|
|
rem --- Startmenü 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';
|
|
};
|
|
{
|
|
& 'C:\Windows\Setup\Scripts\RemovePackage.ps1';
|
|
};
|
|
{
|
|
& 'C:\Windows\Setup\Scripts\RemoveCapability.ps1';
|
|
};
|
|
{
|
|
& '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;
|
|
};
|
|
{
|
|
& 'C:\Windows\Setup\Scripts\SetStartPins.ps1';
|
|
};
|
|
{
|
|
C:\Windows\Setup\Scripts\unattend-01.cmd;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[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 «{0}».' -f $(
|
|
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1…';
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 | Out-String -Width 1KB -Stream >> "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;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[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 «{0}».' -f $(
|
|
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1…';
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 | Out-String -Width 1KB -Stream >> "$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;
|
|
};
|
|
);
|
|
|
|
& {
|
|
[float] $complete = 0;
|
|
[float] $increment = 100 / $scripts.Count;
|
|
foreach( $script in $scripts ) {
|
|
Write-Progress -Id 0 -Activity 'Running scripts to modify the default user’’s registry hive. Do not close this window.' -PercentComplete $complete;
|
|
'*** Will now execute command «{0}».' -f $(
|
|
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1…';
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 | Out-String -Width 1KB -Stream >> "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 -Id 0 -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete;
|
|
'*** Will now execute command «{0}».' -f $(
|
|
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1…';
|
|
);
|
|
$start = [datetime]::Now;
|
|
& $script;
|
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
|
"`r`n" * 3;
|
|
$complete += $increment;
|
|
}
|
|
} *>&1 | Out-String -Width 1KB -Stream >> "C:\Windows\Setup\Scripts\FirstLogon.log";
|
|
</File>
|
|
</Extensions>
|
|
</unattend> |