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

Commit 1006b26

Browse files
author
r3incarnat0r
committed
Add new sensor and service tweaks (beta)
DisableLocation: GPO to disable location related features. Location settings become "managed by organization". DisableBiometrics: GPO to disable biometric features. For example Windows Hello settings become "managed by organization". DisableAutoRotation: Machine-level tweak to disable auto rotation feature. For example makes the Action Center Rotation button greyed out. Autorotation is nice for tablet and mobile-oriented devices, but annoying if using regular laptops like EliteBook, as I personally experienced. DisableMediaSharing: GPO to prevent media sharing and streaming. Network and Sharing Center\Media streaming options will show a message that Media streaming is disabled by group policy etc.
1 parent b3b1223 commit 1006b26

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

Default.preset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ DisableWebSearch # EnableWebSearch
1616
DisableAppSuggestions # EnableAppSuggestions
1717
DisableActivityHistory # EnableActivityHistory
1818
DisableBackgroundApps # EnableBackgroundApps
19+
DisableLocation # EnableLocation
1920
DisableLocationTracking # EnableLocationTracking
2021
DisableMapUpdates # EnableMapUpdates
2122
DisableFeedback # EnableFeedback
2223
DisableTailoredExperiences # EnableTailoredExperiences
2324
DisableAdvertisingID # EnableAdvertisingID
2425
DisableWebLangList # EnableWebLangList
2526
DisableCortana # EnableCortana
27+
# DisableBiometrics # EnableBiometrics
2628
DisableErrorReporting # EnableErrorReporting
2729
# SetP2PUpdateLocal # SetP2PUpdateInternet # SetP2PUpdateDisable
2830
DisableDiagTrack # EnableDiagTrack
@@ -88,6 +90,7 @@ DisableLockScreen # EnableLockScreen
8890
# DisableLockScreenRS1 # EnableLockScreenRS1
8991
HideNetworkFromLockScreen # ShowNetworkOnLockScreen
9092
HideShutdownFromLockScreen # ShowShutdownOnLockScreen
93+
# DisableAutoRotation # EnableAutoRotation
9194
# DisableAeroShake # EnableAeroShake
9295
DisableStickyKeys # EnableStickyKeys
9396
ShowTaskManagerDetails # HideTaskManagerDetails
@@ -163,6 +166,7 @@ DisableAdobeFlash # EnableAdobeFlash
163166
DisableEdgePreload # EnableEdgePreload
164167
DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
165168
DisableIEFirstRun # EnableIEFirstRun
169+
DisableMediaSharing # EnableMediaSharing
166170
# UninstallMediaPlayer # InstallMediaPlayer
167171
# UninstallInternetExplorer # InstallInternetExplorer
168172
# UninstallWorkFolders # InstallWorkFolders

Win10.psm1

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
206223
Function 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
338370
Function 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)
13281378
Function 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
26992764
Function UninstallMediaPlayer {
27002765
Write-Output "Uninstalling Windows Media Player..."

0 commit comments

Comments
 (0)