Monitor Script
$DmWapPushSvcState = Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "Start"
if ($DmWapPushSvcState -eq '2')
{
Write-Output "DmWapPushSvc is in Enabled state"
exit 0
}
else
{
Write-Output "DmWapPushSvc is in Disabled state"
exit 1
}
Remediation Script
Invoke-Command {reg import "C:\ProgramData\DmWapPushService\dmwappushsvc.reg" *>&1 | Out-Null}
$DmWapPushSvcState = Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "Start"
if ($DmWapPushSvcState -eq '2')
{
exit 0
}
else
{
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "Start" -Value '2'
exit 1
}
No comments:
Post a Comment