Created
May 31, 2019 00:12
-
-
Save joshuamsmith/8544b2928b7b947c059b18bb11066ba4 to your computer and use it in GitHub Desktop.
Query if multiple endpoints have Tamper Protection enabled or disabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### PowerShell quickie | |
### Read remote registry for network endpoints to see if Tamper Protection is on | |
## Needs Remote Management and Remote Registry enabled | |
# Remote Management: https://support.auvik.com/hc/en-us/articles/204424994-How-to-enable-WinRM-with-domain-controller-Group-Policy-for-WMI-monitoring | |
# Remote Registry: http://kb.gfi.com/articles/Skynet_Article/how-to-enable-remote-registry-through-group-policy | |
$key = 'SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config' | |
# endpoint network paths: hostname, IP | |
$computers = 'Computer1','Computer2' | |
$valuename = 'SEDEnabled' | |
$valuedata = 1 | |
Foreach ($computer in $computers) { | |
Try | |
{ | |
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"LocalMachine",$computer) | |
} | |
Catch | |
{ | |
Write-Host 'ERROR:' $computer 'needs Remote Registry and Management access enabled.' | |
Continue | |
} | |
$regkey = $reg.OpenSubKey($key) | |
If ($regkey.GetValue($valuename) -eq $valuedata) { | |
Write-Host 'Tamper Protection is ENABLED on' $computer | |
} else { | |
Write-Host 'Tamper Protection is DISABLED on' $computer | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment