-
Notifications
You must be signed in to change notification settings - Fork 49
/
ConfigAsVDI.ps1
1037 lines (834 loc) · 44 KB
/
ConfigAsVDI.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#
.SYNOPSIS
This script configures Windows 10 with minimal configuration for VDI.
.DESCRIPTION
This script configures Windows 10 with minimal configuration for VDI.
// ==============
// General Advice
// ==============
Before finalizing the image perform the following tasks:
- Ensure no unwanted startup files by using autoruns.exe from SysInternals
- Run the Disk Cleanup tool as administrator and delete all temporary files and system restore points
- Run disk defrag and consolidate free space: defrag c: /v /x
- Reboot the machine 6 times and wait 120 seconds after logging on before performing the next reboot (boot prefetch training)
- Run disk defrag and optimize boot files: defrag c: /v /b
- If using a dynamic virtual disk, use the vendor's utilities to perform a "shrink" operation
- If including antivirus software, do a full scan after a def update to hash the disk - should improve disk perf
// *************
// * CAUTION *
// *************
THIS SCRIPT MAKES CONSIDERABLE CHANGES TO THE DEFAULT CONFIGURATION OF WINDOWS.
Please review this script THOROUGHLY before applying to your virtual machine, and disable changes below as necessary to suit your current
environment.
This script is provided AS-IS - usage of this source assumes that you are at the very least familiar with PowerShell, and the tools used
to create and debug this script.
In other words, if you break it, you get to keep the pieces.
.PARAMETER NoWarn
Removes the warning prompts at the beginning and end of the script - do this only when you're sure everything works properly!
.EXAMPLE
.\ConfigWin10asVDI.ps1 -NoWarn $true
.NOTES
Author: Carl Luberti
Last Update: Jeff Hagler
Date: 28th August 2018
Version: 1.0.8
.LOG
1.0.1 - modified sc command to sc.exe to prevent PS from invoking set-content
1.0.2 - modified UWP Application section to avoid issues with CopyProfile, updated onedrive removal, updated for TH2
1.0.3 - modified UWP Application section to disable "Consumer Experience" features, modified scheduled tasks to align with 1511 and further version supportability
1.0.4 - fixed duplicates / issues in service config
1.0.5 - updated applist for Win10 1607, moved some things out of the critical area (if you've run this before, please review!)
1.0.6 - blocked disabling of the Device Association service, disabling service can cause logon delays on domain-joined Win10 1607 systems
1.0.7 - Changed OneDrive section to remove issues plaguing 1709+ installs using Folder Redirection
1.0.8 - modified UWP Application section to remove Applications added in 1703, 1709, and 1803, added additional code to remove OneDrive
#>
# Parse Params:
[CmdletBinding()]
Param(
[Parameter(
Position=0,
Mandatory=$False,
HelpMessage="True or False, do you want to see the warning prompts"
)]
[bool] $NoWarn = $False
)
# Throw caution (to the wind?) - show if NoWarn param is not passed, or passed as $false:
If ($NoWarn -ne $True)
{
Write-Host "THIS SCRIPT MAKES CONSIDERABLE CHANGES TO THE DEFAULT CONFIGURATION OF WINDOWS." -ForegroundColor Yellow
Write-Host ""
Write-Host "Please review this script THOROUGHLY before applying to your virtual machine, and disable changes below as necessary to suit your current environment." -ForegroundColor Yellow
Write-Host ""
Write-Host "This script is provided AS-IS - usage of this source assumes that you are at the very least familiar with PowerShell, and the tools used to create and debug this script." -ForegroundColor Yellow
Write-Host ""
Write-Host ""
Write-Host "In other words, if you break it, you get to keep the pieces." -ForegroundColor Magenta
Write-Host ""
Write-Host ""
}
$ProgressPreference = "SilentlyContinue"
$ErrorActionPreference = "SilentlyContinue"
# Validate Windows 10 Enterprise:
$Edition = Get-WindowsEdition -Online
If ($Edition.Edition -ne "Enterprise")
{
Write-Host "This is not an Enterprise SKU of Windows 10, exiting." -ForegroundColor Red
Write-Host ""
Exit
}
# Get Windows 10 Release version
$OS = (Get-Item "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue('ReleaseID')
Write-Host "This system is running Windows 10 version" $OS -ForegroundColor Green
Write-Host ""
# Configure Constants:
$BranchCache = "False"
$Cortana = "False"
$DiagService = "False"
$EAPService = "False"
$EFS = "False"
$FileHistoryService = "False"
$iSCSI = "False"
$MachPass = "True"
$MSSignInService = "False"
$OneDrive = "False"
$PeerCache = "False"
$Search = "False"
$SMB1 = "False"
$SMBPerf = "False"
$Themes = "False"
$Touch = "False"
$TLS10 = "True"
$WindowsUpdate = "True"
$StartApps = "False"
$StoreApps = "False"
$Install_NetFX3 = "False"
$NetFX3_Source = "D:\Sources\SxS"
$RDPEnable = 1
$RDPFirewallOpen = 1
$NLAEnable = 1
# Set up additional registry drives:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
# Get list of Provisioned Start Screen Apps
$Apps = Get-ProvisionedAppxPackage -Online
# // ============
# // Begin Config
# // ============
# Set VM to High Perf scheme:
Write-Host "Setting VM to High Performance Power Scheme..." -ForegroundColor Green
Write-Host ""
POWERCFG -SetActive '8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c'
#Install NetFX3
If ($Install_NetFX3 -eq "True")
{
Write-Host "Installing .NET 3.5..." -ForegroundColor Green
dism /online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$NetFX3_Source /NoRestart
Write-Host ""
Write-Host ""
}
# Remove (Almost All) Inbox UWP Apps:
If ($StartApps -eq "True")
{
# Disable "Consumer Features" (aka downloading apps from the internet automatically)
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\' -Name 'CloudContent' | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' -Name 'DisableWindowsConsumerFeatures' -PropertyType DWORD -Value '1' | Out-Null
# Disable the "how to use Windows" contextual popups
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' -Name 'DisableSoftLanding' -PropertyType DWORD -Value '1' | Out-Null
Write-Host "Removing (most) built-in UWP Apps..." -ForegroundColor Yellow
Write-Host ""
ForEach ($App in $Apps)
{
# News / Sports / Weather
If ($App.DisplayName -eq "Microsoft.BingFinance")
{
Write-Host "Removing Finance App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.BingNews")
{
Write-Host "Removing News App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.BingSports")
{
Write-Host "Removing Sports App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.BingWeather")
{
Write-Host "Removing Weather App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
# Help / "Get" Apps
If ($App.DisplayName -eq "Microsoft.Getstarted")
{
Write-Host "Removing Get Started App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.SkypeApp")
{
Write-Host "Removing Get Skype App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.MicrosoftOfficeHub")
{
Write-Host "Removing Get Office App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.GetHelp")
{
Write-Host "Removing GetHelp App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
# Games / XBox apps
If ($App.DisplayName -eq "Microsoft.XboxApp")
{
Write-Host "Removing XBox App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.ZuneMusic")
{
Write-Host "Removing Groove Music App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.ZuneVideo")
{
Write-Host "Removing Movies & TV App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.MicrosoftSolitaireCollection")
{
Write-Host "Removing Microsoft Solitaire Collection App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Microsoft.XboxIdentityProvider")
{
Write-Host "Removing Xbox Identity Provider helper App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Xbox.TCUI")
{
Write-Host "Removing Xbox TCUI App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.XboxGameOverlay")
{
Write-Host "Removing XboxGameOverlay App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.XboxGamingOverlay")
{
Write-Host "Removing Xbox GamingOverlay App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.XboxSpeechToTextOverlay")
{
Write-Host "Removing XboxSpeechToTextOverlay App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
# Others
<#
# This will remove Mail and Calendar, and the ability to manage Microsoft Accounts from UWP...
If ($App.DisplayName -eq "Microsoft.windowscommunicationsapps")
{
Write-Host "Removing People, Mail, and Calendar Apps support..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
#>
If ($App.DisplayName -eq "Microsoft.Office.OneNote")
{
Write-Host "Removing OneNote App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.3DBuilder")
{
Write-Host "Removing 3D Builder App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.People")
{
Write-Host "Removing People App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Windows.Photos")
{
Write-Host "Removing Photos App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.WindowsAlarms")
{
Write-Host "Removing Alarms App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
<#
# Note there's no Win32 Calc.exe app in Win10 by default unless LTSB, so you might need this...
If ($App.DisplayName -eq "Microsoft.WindowsCalculator")
{
Write-Host "Removing Calculator Store App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
#>
If ($App.DisplayName -eq "Microsoft.WindowsCamera")
{
Write-Host "Removing Camera App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.WindowsMaps")
{
Write-Host "Removing Maps App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.WindowsPhone")
{
Write-Host "Removing Phone Companion App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.CommsPhone")
{
Write-Host "Removing Phone App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.WindowsSoundRecorder")
{
Write-Host "Removing Voice Recorder App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Office.Sway")
{
Write-Host "Removing Office Sway App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Messaging")
{
Write-Host "Removing Messaging App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.ConnectivityStore")
{
Write-Host "Removing Microsoft Wi-Fi App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.OneConnect")
{
Write-Host "Removing Paid Wi-Fi/Cellular helper App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.MicrosoftStickyNotes")
{
Write-Host "Removing Sticky Notes App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.WindowsFeedbackHub")
{
Write-Host "Removing Feedback Hub App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Microsoft3DViewer")
{
Write-Host "Removing Microsoft3DViewer..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Print3D")
{
Write-Host "Removing Print3D App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.Wallet")
{
Write-Host "Removing Microsoft Wallet App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.MSPaint")
{
Write-Host "Removing MSPaint App..." -ForegroundColor Yellow
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
}
Start-Sleep -Seconds 5
Write-Host ""
Write-Host ""
# !!!!!!!!!!!!!!! Remove store-based UWP apps - do this with caution, you cannot get the store back without a reinstall of the OS !!!!!!!!!!!!!!!
If ($StoreApps -eq "True")
{
Write-Host "Removing (the rest of the) built-in UWP Apps..." -ForegroundColor Magenta
Write-Host ""
ForEach ($App in $Apps)
{
If ($App.DisplayName -eq "Microsoft.DesktopAppInstaller")
{
Write-Host "Removing Desktop App Sideloading helper App..." -ForegroundColor Magenta
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
# Helps apps like Skype UWP access the Camera, for instance
If ($App.DisplayName -eq "Microsoft.Appconnector")
{
Write-Host "Removing AppX/Services Connectivity helper App..." -ForegroundColor Red
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.StorePurchaseApp")
{
Write-Host "Removing Store Purchase helper App..." -ForegroundColor Red
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
If ($App.DisplayName -eq "Microsoft.WindowsStore")
{
Write-Host "Removing Store App..." -ForegroundColor Red
Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null
Remove-AppxPackage -Package $App.PackageName | Out-Null
}
}
Start-Sleep -Seconds 5
Write-Host ""
Write-Host ""
}
}
# Disable Cortana:
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\' -Name 'Windows Search' | Out-Null
If ($Cortana -eq "True")
{
Write-Host "Disabling Cortana..." -ForegroundColor Yellow
Write-Host ""
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Name 'AllowCortana' -PropertyType DWORD -Value '0' | Out-Null
}
# Remove OneDrive:
If ($OneDrive -eq "True")
{
# Remove OneDrive (not guaranteed to be permanent - see https://support.office.com/en-US/article/Turn-off-or-uninstall-OneDrive-f32a17ce-3336-40fe-9c38-6efb09f944b0):
Write-Host "Removing OneDrive..." -ForegroundColor Yellow
C:\Windows\SysWOW64\OneDriveSetup.exe /uninstall
Start-Sleep -Seconds 30
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\' -Name 'Skydrive' | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Skydrive' -Name 'DisableFileSync' -PropertyType DWORD -Value '1' | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Skydrive' -Name 'DisableLibrariesDefaultSaveToSkyDrive' -PropertyType DWORD -Value '1' | Out-Null
reg load HKU\DefaultUser C:\users\default\ntuser.dat
Remove-Itemproperty -Path 'HKU:\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run\' -name 'OneDriveSetup'
Reg unload HKU\DefaultUser
If ($OS -le 1703)
{
Remove-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}' -Recurse
Remove-Item -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}' -Recurse
Set-ItemProperty -Path 'HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}' -Name 'System.IsPinnedToNameSpaceTree' -Value '0'
Set-ItemProperty -Path 'HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}' -Name 'System.IsPinnedToNameSpaceTree' -Value '0'
}
}
# Set PeerCaching to Disabled (0) or Local Network PCs only (1):
If ($PeerCache -eq "True")
{
Write-Host "Disabling PeerCaching..." -ForegroundColor Yellow
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' -Name 'DODownloadMode' -Value '0'
}
Else
{
Write-Host "Configuring PeerCaching..." -ForegroundColor Cyan
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' -Name 'DODownloadMode' -Value '1'
}
# Disable Services:
Write-Host "Configuring Services..." -ForegroundColor Cyan
Write-Host ""
Write-Host "Disabling AllJoyn Router Service..." -ForegroundColor Cyan
Set-Service AJRouter -StartupType Disabled
Write-Host "Disabling Application Layer Gateway Service..." -ForegroundColor Cyan
Set-Service ALG -StartupType Disabled
Write-Host "Disabling Background Intelligent Transfer Service..." -ForegroundColor Cyan
Set-Service BITS -StartupType Disabled
Write-Host "Disabling Bitlocker Drive Encryption Service..." -ForegroundColor Cyan
Set-Service BDESVC -StartupType Disabled
Write-Host "Disabling Block Level Backup Engine Service..." -ForegroundColor Cyan
Set-Service wbengine -StartupType Disabled
Write-Host "Disabling Bluetooth Handsfree Service..." -ForegroundColor Cyan
Set-Service BthHFSrv -StartupType Disabled
Write-Host "Disabling Bluetooth Support Service..." -ForegroundColor Cyan
Set-Service bthserv -StartupType Disabled
If ($BranchCache -eq "True")
{
Write-Host "Disabling BranchCache Service..." -ForegroundColor Yellow
Set-Service PeerDistSvc -StartupType Disabled
}
Write-Host "Disabling Computer Browser Service..." -ForegroundColor Cyan
Set-Service Browser -StartupType Disabled
# This service has been found in certain situations to cause logon delays on
# Windows 10 1607 systems - disabling this service on 1507 or 1511 still works
#Write-Host "Disabling Device Association Service..." -ForegroundColor Cyan
#Set-Service DeviceAssociationService -StartupType Disabled
Write-Host "Disabling Data Service..." -ForegroundColor Cyan
Set-Service DusmSvc -StartupType Disabled
Write-Host "Disabling Device Setup Manager Service..." -ForegroundColor Cyan
Set-Service DsmSvc -StartupType Disabled
Write-Host "Disabling Diagnostic Policy Service..." -ForegroundColor Cyan
Set-Service DPS -StartupType Disabled
Write-Host "Disabling Diagnostic Service Host Service..." -ForegroundColor Cyan
Set-Service WdiServiceHost -StartupType Disabled
Write-Host "Disabling Diagnostic System Host Service..." -ForegroundColor Cyan
Set-Service WdiSystemHost -StartupType Disabled
If ($DiagService -eq "True")
{
Write-Host "Disabling Diagnostics Tracking Service..." -ForegroundColor Yellow
Set-Service DiagTrack -StartupType Disabled
}
If ($EFS -eq "True")
{
Write-Host "Disabling Encrypting File System Service..." -ForegroundColor Yellow
Set-Service EFS -StartupType Disabled
}
If ($EAPService -eq "True")
{
Write-Host "Disabling Extensible Authentication Protocol Service..." -ForegroundColor Yellow
Set-Service Eaphost -StartupType Disabled
}
Write-Host "Disabling Fax Service..." -ForegroundColor Cyan
Set-Service Fax -StartupType Disabled
Write-Host "Disabling Function Discovery Resource Publication Service..." -ForegroundColor Cyan
Set-Service FDResPub -StartupType Disabled
If ($FileHistoryService -eq "True")
{
Write-Host "Disabling File History Service..." -ForegroundColor Yellow
Set-Service fhsvc -StartupType Disabled
}
Write-Host "Disabling Geolocation Service..." -ForegroundColor Cyan
Set-Service lfsvc -StartupType Disabled
Write-Host "Disabling Home Group Listener Service..." -ForegroundColor Cyan
Set-Service HomeGroupListener -StartupType Disabled
Write-Host "Disabling Home Group Provider Service..." -ForegroundColor Cyan
Set-Service HomeGroupProvider -StartupType Disabled
Write-Host "Disabling Infrared Monitoring Service..." -ForegroundColor Cyan
Set-Service irmon -StartupType Disabled
Write-Host "Disabling Internet Connection Sharing (ICS) Service..." -ForegroundColor Cyan
Set-Service SharedAccess -StartupType Disabled
If ($MSSignInService -eq "True")
{
Write-Host "Disabling Microsoft Account Sign-in Assistant Service..." -ForegroundColor Yellow
Set-Service wlidsvc -StartupType Disabled
}
If ($iSCSI -eq "True")
{
Write-Host "Disabling Microsoft iSCSI Initiator Service..." -ForegroundColor Yellow
Set-Service MSiSCSI -StartupType Disabled
}
Write-Host "Disabling Microsoft Software Shadow Copy Provider Service..." -ForegroundColor Cyan
Set-Service swprv -StartupType Disabled
Write-Host "Disabling Microsoft Storage Spaces SMP Service..." -ForegroundColor Cyan
Set-Service smphost -StartupType Disabled
Write-Host "Disabling Offline Files Service..." -ForegroundColor Cyan
Set-Service CscService -StartupType Disabled
Write-Host "Disabling Optimize drives Service..." -ForegroundColor Cyan
Set-Service defragsvc -StartupType Disabled
Write-Host "Disabling Payments and NFC/SE Manager Service..." -ForegroundColor Cyan
Set-Service SEMgrSvc -StartupType Disabled
Write-Host "Disabling Phone Service..." -ForegroundColor Cyan
Set-Service PhoneSvc -StartupType Disabled
Write-Host "Disabling Program Compatibility Assistant Service..." -ForegroundColor Cyan
Set-Service PcaSvc -StartupType Disabled
Write-Host "Disabling Quality Windows Audio Video Experience Service..." -ForegroundColor Cyan
Set-Service QWAVE -StartupType Disabled
Write-Host "Disabling Radio Management Service..." -ForegroundColor Cyan
Set-Service RmSvc -StartupType Disabled
Write-Host "Disabling Retail Demo Service..." -ForegroundColor Cyan
Set-Service RetailDemo -StartupType Disabled
Write-Host "Disabling Secure Socket Tunneling Protocol Service..." -ForegroundColor Cyan
Set-Service SstpSvc -StartupType Disabled
Write-Host "Disabling Sensor Data Service..." -ForegroundColor Cyan
Set-Service SensorDataService -StartupType Disabled
Write-Host "Disabling Sensor Monitoring Service..." -ForegroundColor Cyan
Set-Service SensrSvc -StartupType Disabled
Write-Host "Disabling Sensor Service..." -ForegroundColor Cyan
Set-Service SensorService -StartupType Disabled
Write-Host "Disabling Shell Hardware Detection Service..." -ForegroundColor Cyan
Set-Service ShellHWDetection -StartupType Disabled
Write-Host "Disabling SNMP Trap Service..." -ForegroundColor Cyan
Set-Service SNMPTRAP -StartupType Disabled
Write-Host "Disabling Spot Verifier Service..." -ForegroundColor Cyan
Set-Service svsvc -StartupType Disabled
Write-Host "Disabling SSDP Discovery Service..." -ForegroundColor Cyan
Set-Service SSDPSRV -StartupType Disabled
Write-Host "Disabling Still Image Acquisition Events Service..." -ForegroundColor Cyan
Set-Service WiaRpc -StartupType Disabled
Write-Host "Disabling Superfetch Service..." -ForegroundColor Cyan
Set-Service SysMain -StartupType Disabled
Write-Host "Disabling Telephony Service..." -ForegroundColor Cyan
Set-Service TapiSrv -StartupType Disabled
If ($Themes -eq "True")
{
Write-Host "Disabling Themes Service..." -ForegroundColor Yellow
Set-Service Themes -StartupType Disabled
}
If ($Touch -eq "True")
{
Write-Host "Disabling Touch Keyboard and Handwriting Panel Service..." -ForegroundColor Yellow
Set-Service TabletInputService -StartupType Disabled
}
Write-Host "Disabling UPnP Device Host Service..." -ForegroundColor Cyan
Set-Service upnphost -StartupType Disabled
Write-Host "Disabling Volume Shadow Copy Service..." -ForegroundColor Cyan
Set-Service VSS -StartupType Disabled
Write-Host "Disabling Wi-Fi Direct Services Connection Manager Service..." -ForegroundColor Cyan
Set-Service WFDSConMgrSvc -StartupType Disabled
Write-Host "Disabling Windows Color System Service..." -ForegroundColor Cyan
Set-Service WcsPlugInService -StartupType Disabled
Write-Host "Disabling Windows Connect Now - Config Registrar Service..." -ForegroundColor Cyan
Set-Service wcncsvc -StartupType Disabled
Write-Host "Disabling Windows Error Reporting Service..." -ForegroundColor Cyan
Set-Service WerSvc -StartupType Disabled
Write-Host "Disabling Windows Image Acquisition (WIA) Service..." -ForegroundColor Cyan
Set-Service stisvc -StartupType Disabled
Write-Host "Disabling Windows Media Player Network Sharing Service..." -ForegroundColor Cyan
Set-Service WMPNetworkSvc -StartupType Disabled
Write-Host "Disabling Windows Mobile Hotspot Service..." -ForegroundColor Cyan
Set-Service icssvc -StartupType Disabled
If ($Search -eq "True")
{
Write-Host "Disabling Windows Search Service..." -ForegroundColor Yellow
Set-Service WSearch -StartupType Disabled
}
If ($WindowsUpdate -eq "True")
{
Write-Host "Disabling Windows Update Service..." -ForegroundColor Yellow
Set-Service wuauserv -StartupType Disabled
}
Write-Host "Disabling WLAN AutoConfig Service..." -ForegroundColor Cyan
Set-Service WlanSvc -StartupType Disabled
Write-Host "Disabling WWAN AutoConfig Service..." -ForegroundColor Cyan
Set-Service WwanSvc -StartupType Disabled
Write-Host "Disabling Xbox Accessory Management Service..." -ForegroundColor Cyan
Set-Service XboxGipSvc -StartupType Disabled
Write-Host "Disabling Xbox Game Monitoring Service..." -ForegroundColor Cyan
Set-Service xbgm -StartupType Disabled
Write-Host "Disabling Xbox Live Auth Manager Service..." -ForegroundColor Cyan
Set-Service XblAuthManager -StartupType Disabled
Write-Host "Disabling Xbox Live Game Save Service..." -ForegroundColor Cyan
Set-Service XblGameSave -StartupType Disabled
Write-Host "Disabling Xbox Live Networking Service Service..." -ForegroundColor Cyan
Set-Service XboxNetApiSvc -StartupType Disabled
Write-Host ""
# Reconfigure / Change Services:
Write-Host "Configuring Network List Service to start Automatic..." -ForegroundColor Green
Write-Host ""
Set-Service netprofm -StartupType Automatic
Write-Host ""
Write-Host "Configuring Windows Update Service to run in standalone svchost..." -ForegroundColor Cyan
Write-Host ""
sc.exe config wuauserv type= own
Write-Host ""
# Configure WMI:
Write-Host "Modifying WMI Configuration..." -ForegroundColor Green
Write-Host ""
$oWMI=get-wmiobject -Namespace root -Class __ProviderHostQuotaConfiguration
$oWMI.MemoryPerHost=768*1024*1024
$oWMI.MemoryAllHosts=1536*1024*1024
$oWMI.put()
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Winmgmt -Name 'Group' -Value 'COM Infrastructure'
winmgmt /standalonehost
Write-Host ""
# Disable Scheduled Tasks:
Write-Host "Disabling Scheduled Tasks..." -ForegroundColor Cyan
Write-Host ""
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Autochk\Proxy" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Bluetooth\UninstallDeviceTask" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Defrag\ScheduledDefrag" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Diagnosis\Scheduled" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Location\Notifications" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Maintenance\WinSAT" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Maps\MapsToastTask" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Maps\MapsUpdateTask" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Ras\MobilityManager" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\RecoveryEnvironment\VerifyWinRE" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Registry\RegIdleBackup" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\RetailDemo\CleanupOfflineContent" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Shell\FamilySafetyMonitor" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Shell\FamilySafetyRefresh" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\SystemRestore\SR" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\UPnP\UPnPHostConfig" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\WDI\ResolutionHost" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\Windows Media Sharing\UpdateLibrary" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\WOF\WIM-Hash-Management" | Out-Null
Disable-ScheduledTask -TaskName "\Microsoft\Windows\WOF\WIM-Hash-Validation" | Out-Null
# Disable Hard Disk Timeouts:
Write-Host "Disabling Hard Disk Timeouts..." -ForegroundColor Yellow
Write-Host ""
POWERCFG /SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
POWERCFG /SETDCVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
# Disable Hibernate
Write-Host "Disabling Hibernate..." -ForegroundColor Green
Write-Host ""
POWERCFG -h off
# Disable Large Send Offload
Write-Host "Disabling TCP Large Send Offload..." -ForegroundColor Green
Write-Host ""
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -Name 'DisableTaskOffload' -PropertyType DWORD -Value '1' | Out-Null
# Disable System Restore
Write-Host "Disabling System Restore..." -ForegroundColor Green
Write-Host ""
Disable-ComputerRestore -Drive "C:\"
# Disable NTFS Last Access Timestamps
Write-Host "Disabling NTFS Last Access Timestamps..." -ForegroundColor Yellow
Write-Host ""
FSUTIL behavior set disablelastaccess 1 | Out-Null
If ($MachPass -eq "True")
{
# Disable Machine Account Password Changes
Write-Host "Disabling Machine Account Password Changes..." -ForegroundColor Yellow
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters' -Name 'DisablePasswordChange' -Value '1'
}
# Disable Memory Dumps
Write-Host "Disabling Memory Dump Creation..." -ForegroundColor Green
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'CrashDumpEnabled' -Value '1'
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'LogEvent' -Value '0'
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'SendAlert' -Value '0'
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'AutoReboot' -Value '1'
# Increase Service Startup Timeout:
Write-Host "Increasing Service Startup Timeout To 180 Seconds..." -ForegroundColor Yellow
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control' -Name 'ServicesPipeTimeout' -Value '180000'
# Increase Disk I/O Timeout to 200 Seconds:
Write-Host "Increasing Disk I/O Timeout to 200 Seconds..." -ForegroundColor Green
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Disk' -Name 'TimeOutValue' -Value '200'
# Disable IE First Run Wizard:
Write-Host "Disabling IE First Run Wizard..." -ForegroundColor Green
Write-Host ""
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft' -Name 'Internet Explorer' | Out-Null
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer' -Name 'Main' | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main' -Name DisableFirstRunCustomize -PropertyType DWORD -Value '1' | Out-Null
# Disable New Network Dialog:
Write-Host "Disabling New Network Dialog..." -ForegroundColor Green
Write-Host ""
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Network' -Name 'NewNetworkWindowOff' | Out-Null
# Modify SMB defaults
If ($SMB1 -eq "True")
{
# Disable SMB1:
Write-Host "Disabling SMB1 Support..." -ForegroundColor Yellow
dism /online /Disable-Feature /FeatureName:SMB1Protocol /NoRestart
Write-Host ""
Write-Host ""
}
If ($SMBPerf -eq "True")
{
# SMB Modifications for performance:
Write-Host "Changing SMB Parameters..."
Write-Host ""
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'DisableBandwidthThrottling' -PropertyType DWORD -Value '1' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'DisableLargeMtu' -PropertyType DWORD -Value '0' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'FileInfoCacheEntriesMax' -PropertyType DWORD -Value '8000' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'DirectoryCacheEntriesMax' -PropertyType DWORD -Value '1000' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'FileNotFoundcacheEntriesMax' -PropertyType DWORD -Value '1' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters' -Name 'MaxCmds' -PropertyType DWORD -Value '8000' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' -Name 'EnableWsd' -PropertyType DWORD -Value '0' | Out-Null
}
#Remove TLS 1.0
If ($TLS10 -eq "True")
{
Write-Host "Disabling TLS 1.0..." -ForegroundColor Yellow
Write-Host ""
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client' -Name 'Enabled' -PropertyType DWORD -Value '0' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client' -Name 'DisabledByDefault' -PropertyType DWORD -Value '1' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Name 'Enabled' -PropertyType DWORD -Value '0' | Out-Null
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server' -Name 'DisabledByDefault' -PropertyType DWORD -Value '1' | Out-Null
}
# Remove Previous Versions:
Write-Host "Removing Previous Versions Capability..." -ForegroundColor Yellow
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SOFTWARE\\Microsoft\Windows\CurrentVersion\Explorer' -Name 'NoPreviousVersionsPage' -Value '1'
# Change Explorer Default View:
Write-Host "Configuring Windows Explorer..." -ForegroundColor Green
Write-Host ""
New-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -PropertyType DWORD -Value '1' | Out-Null
# Configure Search Options:
Write-Host "Configuring Search Options..." -ForegroundColor Green
Write-Host ""
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Name 'AllowSearchToUseLocation' -PropertyType DWORD -Value '0' | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Name 'ConnectedSearchUseWeb' -PropertyType DWORD -Value '0' | Out-Null
New-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search' -Name 'SearchboxTaskbarMode' -PropertyType DWORD -Value '1' | Out-Null
# Use Solid Background Color:
Write-Host "Configuring Winlogon..." -ForegroundColor Green
Write-Host ""
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\System' -Name 'DisableLogonBackgroundImage' -Value '1'
# DisableTransparency:
Write-Host "Removing Transparency Effects..." -ForegroundColor Green
Write-Host ""
Set-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize' -Name 'EnableTransparency' -Value '0'