diff --git a/Intune_Remediation_Timezone/detection.kql b/Intune_Remediation_Timezone/detection.kql new file mode 100644 index 0000000..33175a5 --- /dev/null +++ b/Intune_Remediation_Timezone/detection.kql @@ -0,0 +1 @@ +WindowsRegistry('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location') \ No newline at end of file diff --git a/Intune_Remediation_Timezone/detection.ps1 b/Intune_Remediation_Timezone/detection.ps1 new file mode 100644 index 0000000..fbf701b --- /dev/null +++ b/Intune_Remediation_Timezone/detection.ps1 @@ -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 \ No newline at end of file diff --git a/Intune_Remediation_Timezone/remediation.ps1 b/Intune_Remediation_Timezone/remediation.ps1 new file mode 100644 index 0000000..cc9c3dd --- /dev/null +++ b/Intune_Remediation_Timezone/remediation.ps1 @@ -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; \ No newline at end of file