Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Disable IE ESC
- #
- function Disable-InternetExplorerESC {
- $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
- $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
- Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force
- Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
- Stop-Process -Name Explorer -Force
- Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green
- }
- function Enable-InternetExplorerESC {
- $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
- $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
- Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 1 -Force
- Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 1 -Force
- Stop-Process -Name Explorer
- Write-Host "IE Enhanced Security Configuration (ESC) has been enabled." -ForegroundColor Green
- }
- function Disable-UserAccessControl {
- Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 -Force
- Write-Host "User Access Control (UAC) has been disabled." -ForegroundColor Green
- }
- Disable-UserAccessControl
- Disable-InternetExplorerESC
- #
- # Set Time Zone
- #
- Set-WinHomeLocation -GeoId 0xc
- Set-WinSystemLocale -SystemLocale en-au
- Set-Culture en-au
- Set-TimeZone -Id 'AUS Eastern Standard Time'
- #
- # Hide Taskbar Search
- #
- Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name SearchBoxTaskbarMode -Value 0 -Type DWord -Force
- #
- # Unpin Edge and MS Store
- #
- function Unpin-App([string]$appname) {
- ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() |
- ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from taskbar'} | %{$_.DoIt()}
- }
- Unpin-App("Microsoft Edge")
- Unpin-App("Microsoft Store")
- #
- # Disable Shutdown Reason Prompt
- #
- reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutDownReasonOn /t REG_DWORD /d 0 /f
- #
- # Explorer Settings
- #
- # Show File Extensions
- function ShowFileExtensions()
- {
- Push-Location
- Set-Location HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
- Set-ItemProperty . HideFileExt "0"
- Pop-Location
- Stop-Process -processName: Explorer -force # This will restart the Explorer service to make this work.
- }
- ShowFileExtensions
- # Launch Explorer to This PC
- $sipParams = @{
- Path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
- Name = 'LaunchTo'
- Value = 1 # Set the LaunchTo value for "This PC"
- }
- Set-ItemProperty @sipParams
- # Disable Sharing Wizard
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /T REG_DWORD /V "SharingWizardOn" /D 0 /F
- #
- # Disable Screen Timeout & Standby
- #
- powercfg -change -monitor-timeout-ac 0
- powercfg -Change -standby-timeout-ac 0
- powercfg -Change -standby-timeout-dc 0
- #
- # Disable Server Manager on Startup
- #
- Get-ScheduledTask -TaskName ServerManager | Disable-ScheduledTask -Verbose
- #
- # Enable Remote Desktop
- #
- Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
- Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
- Add-LocalGroupMember -Group "Remote Desktop Users" -Member $env:UserName
- #
- # Disable Multitasking Preferences
- #
- # Disable "When I resize a snapped window, simultaneously resize any adjacent snapped window"
- reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "JointResize" /T REG_DWORD /D "0" /F
- # Disable "When I snap a window, show what I can snap next to it":
- reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "SnapAssist" /T REG_DWORD /D "0" /F
- # Disable "When I snap a window, automatically size it to fit available space":
- reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "SnapFill" /T REG_DWORD /D "0" /F
- # Disable "Snap windows" toggle button:
- #reg add "HKCU\Control Panel\Desktop" /V "WindowArrangementActive" /D "0" /F
- # Alt +Tab not include edge
- reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" /f /v "MultiTaskingAltTabFilter" /t REG_DWORD /d 4
- #
- # Enable Ping
- #
- netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow
- #
- # Disable Activity History
- #
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System" /V "EnableActivityFeed" /T REG_DWORD /D "0" /F
- reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\System" /V "EnableActivityFeed" /T REG_DWORD /D "0" /F
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System" /V "PublishUserActivities" /T REG_DWORD /D "0" /F
- reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\System" /V "PublishUserActivities" /T REG_DWORD /D "0" /F
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /f /v "BingSearchEnabled" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /f /v "AllowSearchToUseLocation" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /f /v "CortanaConsent" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" /f /v "DisableSearchBoxSuggestions" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /f /v "Start_TrackDocs" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /f /v "NoRecentDocsHistory" /t REG_DWORD /d 1
- reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /f /v "NoRecentDocsHistory" /t REG_DWORD /d 1
- reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Explorer" /f /v "HideRecentlyAddedApps" /t REG_DWORD /d 1
- reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" /f /v "HideRecentlyAddedApps" /t REG_DWORD /d 1
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Personalization\Settings" /f /v "AcceptedPrivacyPolicy" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\InputPersonalization" /f /v "RestrictImplicitTextCollection" /t REG_DWORD /d 1
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\InputPersonalization" /f /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" /f /v "HarvestContacts" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /f /v "Enabled" /t REG_DWORD /d 0
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /f /v "WiFiSenseCredShared" /t REG_DWORD /d 0
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /f /v "WiFiSenseOpen" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings" /f /v "SafeSearchMode" /t REG_DWORD /d 0
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows" /f /v "AllowCloudSearch" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /f /v "IsMSACloudSearchEnabled" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /f /v "IsAADCloudSearchEnabled" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SearchSettings" /f /v "IsDeviceSearchHistoryEnabled" /t REG_DWORD /d 0
- reg add "HKEY_CURRENT_USER\Control Panel\International\User Profile" /f /v "HttpAcceptLanguageOptOut" /t REG_DWORD /d 1
- reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /f /v "DisableMFUTracking" /t REG_DWORD /d 1
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EdgeUI" /f /v "DisableMFUTracking" /t REG_DWORD /d 1
- #
- # Disable UAC Prompts
- #
- Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 0
- # TODO
- #
- # W11/S2022 App Uninstall
- #
- #winget uninstall "Cortana"
- #winget uninstall "Get Help"
- #winget uninstall "OneDrive"
- #winget uninstall "Microsoft People"
- #winget uninstall "Xbox Game Bar Plugin"
- #winget uninstall "Xbox Game Bar"
- #winget uninstall "Xbox Identity Provider"
- #winget uninstall "Xbox Game Speech Window"
- #winget uninstall "Phone Link"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement