Adding initial detetion and remediation for location services on Windows devices
This commit is contained in:
1
Intune_Remediation_Timezone/detection.kql
Normal file
1
Intune_Remediation_Timezone/detection.kql
Normal file
@@ -0,0 +1 @@
|
||||
WindowsRegistry('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location')
|
||||
7
Intune_Remediation_Timezone/detection.ps1
Normal file
7
Intune_Remediation_Timezone/detection.ps1
Normal 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
|
||||
3
Intune_Remediation_Timezone/remediation.ps1
Normal file
3
Intune_Remediation_Timezone/remediation.ps1
Normal 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;
|
||||
Reference in New Issue
Block a user