Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit abc2aef

Browse files
author
r3incarnat0r
committed
Add new sensor and service tweaks (beta2)
Removed DisableAutoRotation: I tested today and does not work as I expected. I put here this Sensors GPO instead... DisableSensors: Sensor features like autorotation are disabled. Autorotation button is removed from Action Center. Unfortunately I couldn't any detailed info what sensors exactly does it affect. DisableCamera: Disables use of camera devices. Settings\Privacy\Camera becomes "managed by organization".
1 parent 1006b26 commit abc2aef

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

Default.preset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ DisableAdvertisingID # EnableAdvertisingID
2525
DisableWebLangList # EnableWebLangList
2626
DisableCortana # EnableCortana
2727
# DisableBiometrics # EnableBiometrics
28+
# DisableCamera # EnableCamera
2829
DisableErrorReporting # EnableErrorReporting
2930
# SetP2PUpdateLocal # SetP2PUpdateInternet # SetP2PUpdateDisable
3031
DisableDiagTrack # EnableDiagTrack
@@ -90,7 +91,7 @@ DisableLockScreen # EnableLockScreen
9091
# DisableLockScreenRS1 # EnableLockScreenRS1
9192
HideNetworkFromLockScreen # ShowNetworkOnLockScreen
9293
HideShutdownFromLockScreen # ShowShutdownOnLockScreen
93-
# DisableAutoRotation # EnableAutoRotation
94+
# DisableSensors # EnableSensors
9495
# DisableAeroShake # EnableAeroShake
9596
DisableStickyKeys # EnableStickyKeys
9697
ShowTaskManagerDetails # HideTaskManagerDetails

Win10.psm1

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,21 @@ Function EnableBiometrics {
366366
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" -Name "Enabled" -ErrorAction SilentlyContinue
367367
}
368368

369+
# Disable use of camera devices
370+
Function DisableCamera {
371+
Write-Output "Disabling camera devices..."
372+
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera")) {
373+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Force | Out-Null
374+
}
375+
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Name "AllowCamera" -Type DWord -Value 0
376+
}
377+
378+
# Enable use of camera devices
379+
Function EnableCamera {
380+
Write-Output "Enabling camera devices..."
381+
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Name "AllowCamera" -ErrorAction SilentlyContinue
382+
}
383+
369384
# Disable Error reporting
370385
Function DisableErrorReporting {
371386
Write-Output "Disabling Error reporting..."
@@ -1356,22 +1371,19 @@ Function ShowShutdownOnLockScreen {
13561371
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ShutdownWithoutLogon" -Type DWord -Value 1
13571372
}
13581373

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
1374+
# Disable sensor features, such as screen auto rotation
1375+
Function DisableSensors {
1376+
Write-Output "Disabling sensors..."
1377+
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors")) {
1378+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" -Force | Out-Null
13641379
}
1365-
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation" -Name "Enable" -Type DWord -Value 0
1380+
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" -Name "DisableSensors" -Type DWord -Value 1
13661381
}
13671382

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
1383+
# Enable sensor features
1384+
Function EnableSensors {
1385+
Write-Output "Enabling sensors..."
1386+
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" -Name "DisableSensors" -ErrorAction SilentlyContinue
13751387
}
13761388

13771389
# Disable Aero Shake (minimizing other windows when one is dragged by mouse and shaken)

0 commit comments

Comments
 (0)