@@ -202,6 +202,23 @@ Function EnableBackgroundApps {
202202 }
203203}
204204
205+ # Disable location feature and scripting for the location feature
206+ Function DisableLocation {
207+ Write-Output " Disabling location services..."
208+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" )) {
209+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Force | Out-Null
210+ }
211+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - Type DWord - Value 1
212+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - Type DWord - Value 1
213+ }
214+
215+ # Enable location feature and scripting for the location feature
216+ Function EnableLocation {
217+ Write-Output " Enabling location services..."
218+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - ErrorAction SilentlyContinue
219+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - ErrorAction SilentlyContinue
220+ }
221+
205222# Disable Location Tracking
206223Function DisableLocationTracking {
207224 Write-Output " Disabling Location Tracking..."
@@ -334,6 +351,21 @@ Function EnableCortana {
334351 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" - Name " AllowCortana" - ErrorAction SilentlyContinue
335352}
336353
354+ # Disable biometric features in Windows. Note - it's recommended to create a password recovery disk, if you log on using biometrics.
355+ Function DisableBiometrics {
356+ Write-Output " Disabling biometric services..."
357+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" )) {
358+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Force | Out-Null
359+ }
360+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Name " Enabled" - Type DWord - Value 0
361+ }
362+
363+ # Enable biometric features
364+ Function EnableBiometrics {
365+ Write-Output " Enabling biometric services..."
366+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Name " Enabled" - ErrorAction SilentlyContinue
367+ }
368+
337369# Disable Error reporting
338370Function DisableErrorReporting {
339371 Write-Output " Disabling Error reporting..."
@@ -1324,6 +1356,24 @@ Function ShowShutdownOnLockScreen {
13241356 Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " ShutdownWithoutLogon" - Type DWord - Value 1
13251357}
13261358
1359+ # Disable screen auto rotation
1360+ Function DisableAutoRotation {
1361+ Write-Output " Disabling screen auto rotation..."
1362+ If (! (Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" )) {
1363+ New-Item - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" - Force | Out-Null
1364+ }
1365+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" - Name " Enable" - Type DWord - Value 0
1366+ }
1367+
1368+ # Enable screen auto rotation
1369+ Function EnableAutoRotation {
1370+ Write-Output " Enabling screen auto rotation..."
1371+ If (! (Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" )) {
1372+ New-Item - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" - Force | Out-Null
1373+ }
1374+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" - Name " Enable" - Type DWord - Value 1
1375+ }
1376+
13271377# Disable Aero Shake (minimizing other windows when one is dragged by mouse and shaken)
13281378Function DisableAeroShake {
13291379 Write-Output " Disabling Aero Shake..."
@@ -2695,6 +2745,21 @@ Function EnableIEFirstRun {
26952745 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" - Name " DisableFirstRunCustomize" - ErrorAction SilentlyContinue
26962746}
26972747
2748+ # Disable Windows Media Player's media sharing feature
2749+ Function DisableMediaSharing {
2750+ Write-Output " Disabling media sharing..."
2751+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" )) {
2752+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Force | Out-Null
2753+ }
2754+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - Type DWord - Value 1
2755+ }
2756+
2757+ # Enable Windows Media Player's media sharing feature
2758+ Function EnableMediaSharing {
2759+ Write-Output " Enabling media sharing..."
2760+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - ErrorAction SilentlyContinue
2761+ }
2762+
26982763# Uninstall Windows Media Player
26992764Function UninstallMediaPlayer {
27002765 Write-Output " Uninstalling Windows Media Player..."
0 commit comments