Skip to content

Commit ea7c33b

Browse files
updated all areas
1 parent a2c7d6a commit ea7c33b

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

Svr16OptimizeAndConfig.ps1

47.8 KB
Binary file not shown.

Win10OptimizeAndConfig.ps1

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ Write-Host "logging to file: $LogFilePath" -ForegroundColor Cyan
11571157
[boolean]$ApplyPrivacyMitigations = $false
11581158
[boolean]$RemoveRebootOnLockScreen = $false
11591159
[boolean]$RemoveUnusedPrinters = $false
1160+
[boolean]$RemoveVMToolsTrayIcon = $false
11601161
# System Adv Settings
11611162
[boolean]$DisableSmartCardLogon = $false
11621163
[boolean]$ForceStrictSmartCardLogon = $false
@@ -1246,6 +1247,8 @@ If(Get-SMSTSENV){
12461247
If($tsenv:CFG_ApplyPrivacyMitigations){[boolean]$ApplyPrivacyMitigations = [boolean]::Parse($tsenv.Value("CFG_ApplyPrivacyMitigations"))}
12471248
If($tsenv:CFG_RemoveRebootOnLockScreen){[boolean]$RemoveRebootOnLockScreen = [boolean]::Parse($tsenv.Value("CFG_RemoveRebootOnLockScreen"))}
12481249
If($tsenv:CFG_RemoveUnusedPrinters){[boolean]$RemoveUnusedPrinters = [boolean]::Parse($tsenv.Value("CFG_RemoveUnusedPrinters"))}
1250+
If($tsenv:CFG_RemoveVMToolsTrayIcon){[boolean]$RemoveVMToolsTrayIcon = [boolean]::Parse($tsenv.Value("CFG_RemoveVMToolsTrayIcon"))}
1251+
12491252
# System Adv Settings
12501253
If($tsenv:CFG_DisableSmartCardLogon){[boolean]$DisableSmartCardLogon = [boolean]::Parse($tsenv.Value("CFG_DisableSmartCardLogon"))}
12511254
If($tsenv:CFG_ForceStrictSmartCardLogon){[boolean]$ForceStrictSmartCardLogon = [boolean]::Parse($tsenv.Value("CFG_ForceStrictSmartCardLogon"))}
@@ -1400,7 +1403,7 @@ If($DisableWindowsUpgrades)
14001403
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' -Name 'DisableOSUpgrade' -Type DWord -Value 1 -Force | Out-Null
14011404

14021405
Write-LogEntry "Disabling access the Insider build controls in the Advanced Options"
1403-
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' -Name 'LimitEnhancedDiagnosticDataWindowsAnalytics' -Type DWord -Value 1 -Force | Out-Null
1406+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' -Name 'LimitEnhancedDiagnosticDataWindowsAnalytics' -Type DWord -Value 1 -Force -TryLGPO:$true
14041407
}
14051408
Else{$stepCounter++}
14061409

@@ -1705,6 +1708,7 @@ If($DisableAllNotifications)
17051708
"Windows.SystemToast.RasToastNotifier"="VPN Notifications"
17061709
"Windows.SystemToast.HelloFace"="Windows Hello Notifications"
17071710
"Windows.SystemToast.WiFiNetworkManager"="Wireless Notifications"
1711+
17081712
}
17091713
Show-ProgressStatus -Message "Disabling Toast Notifications" -Step ($stepCounter++) -MaxStep $script:Maxsteps
17101714
$i = 1
@@ -2764,7 +2768,6 @@ If ($OptimizeForVDI)
27642768
{
27652769
Show-ProgressStatus -Message "Configuring VDI Optimizations" -Step ($stepCounter++) -MaxStep $script:Maxsteps
27662770

2767-
27682771
Write-LogEntry "VDI Optimizations :: Hiding network options from Lock Screen"
27692772
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'DontDisplayNetworkSelectionUI' -Type DWord -Value 1 -Force -TryLGPO:$true
27702773

@@ -2777,7 +2780,7 @@ If ($OptimizeForVDI)
27772780
Write-LogEntry "VDI Optimizations [OSOT ID:30] :: Disabling Background Layout Service"
27782781
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OptimalLayout' -Name 'EnableAutoLayout' -Type DWord -Value 0 -Force
27792782

2780-
Write-LogEntry "VDI Optimizations [OSOT ID:31] :: Disabling CIFS Change Notifications"
2783+
Write-LogEntry "VDI Optimizations [OSOT ID:31] :: Disabling CIfS Change Notifications"
27812784
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoRemoteRecursiveEvents' -Type DWord -Value 0 -Force
27822785

27832786
Write-LogEntry ("VDI Optimizations :: Disabling Storage Sense")
@@ -2825,31 +2828,31 @@ If ($OptimizeForVDI)
28252828
Write-LogEntry "VDI Optimizations [OSOT ID:287] :: Disabling Boot Optimize Function"
28262829
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction' -Name 'Enable' -Type String -Value '0' -Force
28272830

2828-
Write-LogEntry "VDI Optimizations :: Disable Superfetch"
2831+
Write-LogEntry "VDI Optimizations :: Disabling Superfetch"
28292832
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters' -Name 'EnableSuperfetch' -Type DWord -Value 0 -Force
28302833

28312834
Write-LogEntry "VDI Optimizations :: Disabling Paging Executive"
28322835
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' -Name 'DisablePagingExecutive' -Value 1 -Force
28332836

2834-
Write-LogEntry "VDI Optimizations :: Disable Storing Recycle Bin Files"
2837+
Write-LogEntry "VDI Optimizations :: Disabling Storing Recycle Bin Files"
28352838
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer' -Name 'NoRecycleFiles' -Type DWord -Value 1 -Force
28362839

2837-
Write-LogEntry "VDI Optimizations :: Disk Timeout Value"
2840+
Write-LogEntry "VDI Optimizations :: Reducing Disk Timeout Value"
28382841
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\services\Disk' -Name 'TimeOutValue' -Type DWord -Value 200 -Force
28392842

2840-
Write-LogEntry "VDI Optimizations :: Application Event Log Max Size"
2843+
Write-LogEntry "VDI Optimizations :: Reducing Application Event Log Max Size"
28412844
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application' -Name 'MaxSize' -Type DWord -Value 100000 -Force
28422845

2843-
Write-LogEntry "VDI Optimizations :: Application Event Log Retention"
2846+
Write-LogEntry "VDI Optimizations :: Disabling Application Event Log Retention"
28442847
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application' -Name 'Retention' -Type DWord -Value 0 -Force
28452848

2846-
Write-LogEntry "VDI Optimizations :: System Event Log Max Size"
2849+
Write-LogEntry "VDI Optimizations :: Reducing System Event Log Max Size"
28472850
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\System' -Name 'MaxSize' -Type DWord -Value 100000 -Force
28482851

2849-
Write-LogEntry "VDI Optimizations :: System Event Log Retention"
2852+
Write-LogEntry "VDI Optimizations :: Disabling System Event Log Retention"
28502853
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\System' -Name 'Retention' -Type DWord -Value 0 -Force
28512854

2852-
Write-LogEntry "VDI Optimizations :: Security Event Log Max Size"
2855+
Write-LogEntry "VDI Optimizations :: Reducing Security Event Log Max Size"
28532856
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Security' -Name 'MaxSize' -Type DWord -Value 100000 -Force
28542857

28552858
Write-LogEntry "VDI Optimizations :: Disabling Security Event Log Retention"
@@ -2889,26 +2892,30 @@ If ($OptimizeForVDI)
28892892
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\UBPM' -Name Start -Type DWord -Value 0 -Force
28902893
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\WiFiDriverIHVSession' -Name Start -Type DWord -Value 0 -Force
28912894
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\WiFiSession' -Name Start -Type DWord -Value 0 -Force
2892-
#>
28932895
2894-
2896+
#>
28952897

28962898
Write-LogEntry "VDI Optimizations :: Disabling TLS 1.0"
28972899
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client' -Name 'Enabled' -Type DWORD -Value '0' -Force
28982900
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client' -Name 'DisabledByDefault' -Type DWORD -Value '1' -Force
28992901
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Name 'Enabled' -Type DWORD -Value '0' -Force
29002902
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Name 'DisabledByDefault' -Type DWORD -Value '1' -Force
29012903

2902-
29032904
Set-UserSetting -Message "VDI Optimizations :: Change Explorer Default View" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -Type DWord -Value 1 -Force
2904-
Set-UserSetting -Message "VDI Optimizations :: Settings Temporary Internet Files to Non Persistent" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache' -Name 'Persistent' -Type DWord -Value 0 -Force
29052905
Set-UserSetting -Message "VDI Optimizations [OSOT 11] :: Disable RSS Feeds" -Path 'SOFTWARE\Microsoft\Feeds' -Name 'SyncStatus' -Type DWord -Value 0 -Force
29062906
Set-UserSetting -Message "VDI Optimizations [OSOT ID:8] :: Disabling show most used apps at start menu" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'Start_TrackProgs' -Type DWord -Value 0 -Force
29072907
Set-UserSetting -Message "VDI Optimizations [OSOT ID:9] :: Disabling show recent items at start menu" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'Start_TrackDocs' -Type DWord -Value 0 -Force
29082908
Set-UserSetting -Message "VDI Optimizations [OSOT ID:30] :: Disabling Toast notifications to the lock screen" -Path 'SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' -Name 'NoToastApplicationNotificationOnLockScreen' -Type DWord -Value '1' -Force
29092909
Set-UserSetting -Message "VDI Optimizations [VDIGUYS] :: Remove People Button From the Task Bar in Windows" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People' -Name 'PeopleBand' -Type DWord -Value 0 -Force
2910-
2911-
2910+
Set-UserSetting -Message "VDI Optimizations :: Settings Temporary Internet Files to Non Persistent" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache' -Name 'Persistent' -Type DWord -Value 0 -Force
2911+
2912+
Write-LogEntry "VDI Optimizations :: Reduce IE Temp File."
2913+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths' -Name Paths -Type DWord -Value 0x4 -Force
2914+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path1' -Name CacheLimit -Type DWord -Value 0x100 -Force
2915+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path2' -Name CacheLimit -Type DWord -Value 0x100 -Force
2916+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path3' -Name CacheLimit -Type DWord -Value 0x100 -Force
2917+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path4' -Name CacheLimit -Type DWord -Value 0x100 -Force
2918+
29122919
Set-UserSetting -Message "VDI Optimizations :: Disabling Storage Sense [01]" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy' -Name 01 -Type DWord -Value 0 -Force
29132920
Set-UserSetting -Message "VDI Optimizations :: Disabling Storage Sense [02]" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy' -Name 02 -Type DWord -Value 0 -Force
29142921
Set-UserSetting -Message "VDI Optimizations :: Disabling Storage Sense [04]" -Path 'SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy' -Name 04 -Type DWord -Value 0 -Force
@@ -2923,7 +2930,7 @@ If ($OptimizeForVDI)
29232930
Else{$stepCounter++}
29242931

29252932

2926-
IF($OptimizeNetwork){
2933+
If($OptimizeNetwork){
29272934

29282935
Write-LogEntry "VDI Optimizations :: Configuring SMB Modifications for performance"
29292936
Set-SystemSetting -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'DisableBandwidthThrottling' -Type "DWORD" -Value "1" -Force
@@ -3140,6 +3147,14 @@ If($ShowHiddenFiles)
31403147
Else{$stepCounter++}
31413148

31423149

3150+
If($RemoveVMToolsTrayIcon){
3151+
if ( Test-Path "$Env:Programfiles\VMware\VMware Tools" ){
3152+
Write-LogEntry ("Removing VM Tools Tray icon from taskbar...") -Severity 1 -Outhost
3153+
Set-SystemSetting -Path 'HKLM:\SOFTWARE\VMware, Inc.\VMware Tools' -Name 'ShowTray' -Type DWord -Value 0 -Force
3154+
}
3155+
}
3156+
Else{$stepCounter++}
3157+
31433158
If($ShowThisPCOnDesktop)
31443159
{
31453160
Show-ProgressStatus -Message "Adding 'This PC' desktop shortcut" -Step ($stepCounter++) -MaxStep $script:Maxsteps

0 commit comments

Comments
 (0)