@@ -206,26 +206,36 @@ Function EnableBackgroundApps {
206206 }
207207}
208208
209- # Disable Location Tracking
210- Function DisableLocationTracking {
211- Write-Output " Disabling Location Tracking ..."
212- If (! (Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " )) {
213- New-Item - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " - Force | Out-Null
209+ # Disable sensor features, such as screen auto rotation
210+ Function DisableSensors {
211+ Write-Output " Disabling sensors ..."
212+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\ Microsoft\Windows\LocationAndSensors " )) {
213+ New-Item - Path " HKLM:\SOFTWARE\Policies\ Microsoft\Windows\LocationAndSensors " - Force | Out-Null
214214 }
215- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Name " Value" - Type String - Value " Deny"
216- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" - Name " SensorPermissionState" - Type DWord - Value 0
217- Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" - Name " Status" - Type DWord - Value 0
215+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - Type DWord - Value 1
218216}
219217
220- # Enable Location Tracking
221- Function EnableLocationTracking {
222- Write-Output " Enabling Location Tracking..."
223- If (! (Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" )) {
224- New-Item - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Force | Out-Null
218+ # Enable sensor features
219+ Function EnableSensors {
220+ Write-Output " Enabling sensors..."
221+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - ErrorAction SilentlyContinue
222+ }
223+
224+ # Disable location feature and scripting for the location feature
225+ Function DisableLocation {
226+ Write-Output " Disabling location services..."
227+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" )) {
228+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Force | Out-Null
225229 }
226- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Name " Value" - Type String - Value " Allow"
227- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" - Name " SensorPermissionState" - Type DWord - Value 1
228- Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" - Name " Status" - Type DWord - Value 1
230+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - Type DWord - Value 1
231+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - Type DWord - Value 1
232+ }
233+
234+ # Enable location feature and scripting for the location feature
235+ Function EnableLocation {
236+ Write-Output " Enabling location services..."
237+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - ErrorAction SilentlyContinue
238+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - ErrorAction SilentlyContinue
229239}
230240
231241# Disable automatic Maps updates
@@ -338,6 +348,36 @@ Function EnableCortana {
338348 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" - Name " AllowCortana" - ErrorAction SilentlyContinue
339349}
340350
351+ # Disable biometric features in Windows. Note - it's recommended to create a password recovery disk, if you log on using biometrics.
352+ Function DisableBiometrics {
353+ Write-Output " Disabling biometric services..."
354+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" )) {
355+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Force | Out-Null
356+ }
357+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Name " Enabled" - Type DWord - Value 0
358+ }
359+
360+ # Enable biometric features
361+ Function EnableBiometrics {
362+ Write-Output " Enabling biometric services..."
363+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Name " Enabled" - ErrorAction SilentlyContinue
364+ }
365+
366+ # Disable use of camera devices
367+ Function DisableCamera {
368+ Write-Output " Disabling camera devices..."
369+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" )) {
370+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" - Force | Out-Null
371+ }
372+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" - Name " AllowCamera" - Type DWord - Value 0
373+ }
374+
375+ # Enable use of camera devices
376+ Function EnableCamera {
377+ Write-Output " Enabling camera devices..."
378+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" - Name " AllowCamera" - ErrorAction SilentlyContinue
379+ }
380+
341381# Disable Error reporting
342382Function DisableErrorReporting {
343383 Write-Output " Disabling Error reporting..."
@@ -3001,6 +3041,21 @@ Function EnableFirstLogonAnimation {
30013041 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " EnableFirstLogonAnimation" - ErrorAction SilentlyContinue
30023042}
30033043
3044+ # Disable Windows Media Player's media sharing feature
3045+ Function DisableMediaSharing {
3046+ Write-Output " Disabling media sharing..."
3047+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" )) {
3048+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Force | Out-Null
3049+ }
3050+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - Type DWord - Value 1
3051+ }
3052+
3053+ # Enable Windows Media Player's media sharing feature
3054+ Function EnableMediaSharing {
3055+ Write-Output " Enabling media sharing..."
3056+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - ErrorAction SilentlyContinue
3057+ }
3058+
30043059# Uninstall Windows Media Player
30053060Function UninstallMediaPlayer {
30063061 Write-Output " Uninstalling Windows Media Player..."
0 commit comments