Using SCOM 2012 SDK to Retrieve Resource Pools Information

Today I needed to retrieve information about SCOM 2012 resource pools in a PowerShell script, I needed to do this directly via SDK, rather than using the OperationsManager PowerShell module. I couldn’t find any existing scripts via Google, so I spent some time playing with SDK and finally found it. Since it seems no one has mentioned it on the web, here’s how I did it: Firstly, load the SDK DLL’s. I always use below function: [sourcecode language=”PowerShell”] function Load-SDK() { [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager.Common") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager") | Out-Null } Load-SDK [/sourcecode] Secondly, connect to the management group. Since I’ll be running

Continue reading
%d bloggers like this: