Archive for February, 2014

A while back I wrote a post about turning on agent proxying… you can find that here, but today I needed to turn OFF agent proxying in an old SCOM 2007 environment… so here’s how I did it.

I used Windows PowerShell:

$Agents = get-agent | where {$_.ProxyingEnabled -match “True”}
$Agents | foreach {$_.ProxyingEnabled=$false}
$Agents | foreach {$_.ApplyChanges()}

This turns it off.


In SCOM 2012 it’s slightly different, again I’d use Windows PowerShell:

Get-SCOMAgent | where {$_.ProxyingEnabled.Value -eq $True} | Disable-SCOMAgentProxy -Confirm


Today I needed to find the discovered inventory for all of the Servers that were running a Windows 2008, IIS WebServer. So the first thing I needed to do is find out what the Class was that I needed for my query.

For that, I started with a generic query to find out what IIS Classes there were…

get-monitoringclass | ? {$_.Name -like “*Internet*”} | select Name

Looking at the output, I decided the most likely Class was “Microsoft.Windows.InternetInformationServices.2008.WebServer”. Using this class, I could now find out what servers were running an Windows 2008, IIS WebServer.

Get-MonitoringClass -name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-MonitoringObject | Select Path



In SCOM 2012 its similar but slightly different as the cmdlet names have changed.

Get-SCOMClass –name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-SCOMClassInstance | Select Path



If you want to find out how many items you have discovered, you can wrap this all up in parenthesis and look for the count.

For SCOM 2007:

(Get-MonitoringClass -name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-MonitoringObject | Select Path).count


For SCOM 2012:

(Get-SCOMClass –name “Microsoft.Windows.InternetInformationServices.2008.WebServer” | Get-SCOMClassInstance | Select Path).count