@@ -206,6 +206,23 @@ Function EnableBackgroundApps {
206206 }
207207}
208208
209+ # Disable location feature and scripting for the location feature
210+ Function DisableLocation {
211+ Write-Output " Disabling location services..."
212+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" )) {
213+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Force | Out-Null
214+ }
215+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - Type DWord - Value 1
216+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - Type DWord - Value 1
217+ }
218+
219+ # Enable location feature and scripting for the location feature
220+ Function EnableLocation {
221+ Write-Output " Enabling location services..."
222+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - ErrorAction SilentlyContinue
223+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - ErrorAction SilentlyContinue
224+ }
225+
209226# Disable Location Tracking
210227Function DisableLocationTracking {
211228 Write-Output " Disabling Location Tracking..."
@@ -338,6 +355,36 @@ Function EnableCortana {
338355 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" - Name " AllowCortana" - ErrorAction SilentlyContinue
339356}
340357
358+ # Disable biometric features in Windows. Note - it's recommended to create a password recovery disk, if you log on using biometrics.
359+ Function DisableBiometrics {
360+ Write-Output " Disabling biometric services..."
361+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" )) {
362+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Force | Out-Null
363+ }
364+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Name " Enabled" - Type DWord - Value 0
365+ }
366+
367+ # Enable biometric features
368+ Function EnableBiometrics {
369+ Write-Output " Enabling biometric services..."
370+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" - Name " Enabled" - ErrorAction SilentlyContinue
371+ }
372+
373+ # Disable use of camera devices
374+ Function DisableCamera {
375+ Write-Output " Disabling camera devices..."
376+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" )) {
377+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" - Force | Out-Null
378+ }
379+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" - Name " AllowCamera" - Type DWord - Value 0
380+ }
381+
382+ # Enable use of camera devices
383+ Function EnableCamera {
384+ Write-Output " Enabling camera devices..."
385+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Camera" - Name " AllowCamera" - ErrorAction SilentlyContinue
386+ }
387+
341388# Disable Error reporting
342389Function DisableErrorReporting {
343390 Write-Output " Disabling Error reporting..."
@@ -1390,6 +1437,21 @@ Function ShowShutdownOnLockScreen {
13901437 Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " ShutdownWithoutLogon" - Type DWord - Value 1
13911438}
13921439
1440+ # Disable sensor features, such as screen auto rotation
1441+ Function DisableSensors {
1442+ Write-Output " Disabling sensors..."
1443+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" )) {
1444+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Force | Out-Null
1445+ }
1446+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - Type DWord - Value 1
1447+ }
1448+
1449+ # Enable sensor features
1450+ Function EnableSensors {
1451+ Write-Output " Enabling sensors..."
1452+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - ErrorAction SilentlyContinue
1453+ }
1454+
13931455# Disable Lock screen Blur - Applicable since 1903
13941456Function DisableLockScreenBlur {
13951457 Write-Output " Disabling Lock screen Blur..."
@@ -2989,6 +3051,21 @@ Function EnableIEFirstRun {
29893051 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" - Name " DisableFirstRunCustomize" - ErrorAction SilentlyContinue
29903052}
29913053
3054+ # Disable Windows Media Player's media sharing feature
3055+ Function DisableMediaSharing {
3056+ Write-Output " Disabling media sharing..."
3057+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" )) {
3058+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Force | Out-Null
3059+ }
3060+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - Type DWord - Value 1
3061+ }
3062+
3063+ # Enable Windows Media Player's media sharing feature
3064+ Function EnableMediaSharing {
3065+ Write-Output " Enabling media sharing..."
3066+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - ErrorAction SilentlyContinue
3067+ }
3068+
29923069# Disable "Hi!" First Logon Animation (it will be replaced by "Preparing Windows" message)
29933070Function DisableFirstLogonAnimation {
29943071 Write-Output " Disabling First Logon Animation..."
0 commit comments