Adding initial detetion and remediation for location services on Windows devices

This commit is contained in:
Jens Du Four
2024-03-28 09:51:13 +01:00
parent 1c7bec421e
commit 4b9a00d1c3
3 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1 @@
WindowsRegistry('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location')

View File

@@ -0,0 +1,7 @@
# Reg2CI (c) 2022 by Roger Zander
try {
if(-NOT (Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")){ exti 1 };
if((Get-ItemPropertyValue -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location' -Name 'Value' -ea SilentlyContinue) -eq 'Allow') { } else { exit 1 };
}
catch { exit 1 }
exit 0

View File

@@ -0,0 +1,3 @@
# Reg2CI (c) 2022 by Roger Zander
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location") -ne $true) { New-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -force -ea SilentlyContinue };
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location' -Name 'Value' -Value 'Allow' -PropertyType String -Force -ea SilentlyContinue;