Update remediation script

This commit is contained in:
Jens Du Four
2024-03-28 15:26:55 +01:00
parent 1805457916
commit c20d6847a4

View File

@@ -1,4 +1,19 @@
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;
if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Services\tzautoupdate") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\tzautoupdate" -force -ea SilentlyContinue };
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Services\tzautoupdate' -Name 'Start' -Value 3 -PropertyType DWord -Force -ea SilentlyContinue;
$RegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location"
$RegistryProperty = "Value"
$RegistryValue = "Allow"
if (!(Test-Path -LiteralPath $RegistryPath)) {
New-Item -Path $RegistryPath -Force -ErrorAction SilentlyContinue
}
New-ItemProperty -Path $RegistryPath -Name $RegistryProperty -Value $RegistryValue -PropertyType String -Force -ErrorAction SilentlyContinue
$ServicePath = "HKLM:\SYSTEM\CurrentControlSet\Services\tzautoupdate"
$ServiceProperty = "Start"
$ServiceValue = 3
if (!(Test-Path -LiteralPath $ServicePath)) {
New-Item -Path $ServicePath -Force -ErrorAction SilentlyContinue
}
New-ItemProperty -Path $ServicePath -Name $ServiceProperty -Value $ServiceValue -PropertyType DWord -Force -ErrorAction SilentlyContinue