Created
January 27, 2016 17:07
-
-
Save davegreen/622c9e417a1e200a5c8e to your computer and use it in GitHub Desktop.
SCOM monitor script for checking Internet Explorer ESC status. Requires something like the PowerShell script monitor MP by Wei Lim: https://gallery.technet.microsoft.com/Sample-Management-Pack-17b76379
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
$API = New-Object -ComObject "MOM.ScriptAPI" -ErrorAction Stop | |
$PropertyBag = $API.CreatePropertyBag() | |
$Profiles = @{'Admin' = 0; 'User' = 0} | |
$Profiles.Admin = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}' -Name IsInstalled).IsInstalled | |
$Profiles.User = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}' -Name IsInstalled).IsInstalled | |
if ($Profiles.Values -contains 0) | |
{ | |
$PropertyBag.AddValue('State', 1) | |
$API.LogScriptEvent("IEESCState.ps1", 1009, 0, "Internet Explorer Enhanced Security Configuration state is disabled for one or more profiles.") | |
} | |
else | |
{ | |
$PropertyBag.AddValue('State', 0) | |
$API.LogScriptEvent("IEESCState.ps1", 1000, 0, "Internet Explorer Enhanced Security Configuration is enabled for all profiles.") | |
} | |
foreach ($key in $Profiles.Keys) | |
{ | |
$PropertyBag.AddValue($key, $($Profiles.Item($key))) | |
} | |
$PropertyBag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment