Category Archives: Powershell for SCOM

Powershell to reveal Resource Pool membership(s) of all management servers

Here is a useful Powershell script to reveal the Resource groups that every management server in your Scom Management group is a member of:- $Members = Get-SCOMManagementServer foreach ($member in $members) { write-host “” $Pools = Get-SCOMResourcePool -Member $Member write-host … Continue reading

Posted in Powershell for SCOM | Tagged , , , , , , , , , , , , , | Leave a comment

Enable Agent Proxy by default for all Scom Agents

Agent Proxy for managed servers is disabled by default in SCOM. However an increasing amount of Management Packs rely on this setting being enabled and it if it isn’t enabled an Agent Proxy not enabled alert is triggered. These MPs … Continue reading

Posted in Powershell for SCOM | Tagged , , , , , , , , , | Leave a comment

Testing Port Connectivity with Powershell

From Windows Server 2012 R2 and above you can use the test-netconnection command in Powershell to test port connectivity The syntax is:- test-netconnection <servername> -port <port number> example:- test-netconnection myserver -port 5723 

Posted in Powershell for SCOM | Tagged , , , , , , , , , , | Leave a comment

Find SCOM object from instance id

When troubleshooting SCOM problems by examining alerts that have triggered and the event viewer you sometimes come across objects being referenced by their GUIDS. To retrieve their names you can use the Operations Manager shell in powershell and run the … Continue reading

Posted in Powershell for SCOM | Tagged , , , | Leave a comment

SCOM Dynamic Group Population

Recently created a dynamic group which was required to populate with servers with hostnames in CAPITAL letters and hostnames in lowercase letters as dynamic groups are CASE SENSITIVE Initially I tried:- ( Object is Health Service Watcher AND ( Health … Continue reading

Posted in Powershell for SCOM | Tagged , , , , , , , , | Leave a comment

Open Alerts but Health Explorer shows Healthy

On occasions you can run into a situation where SCOM shows open alerts in the console (with a warning or error condition), but  when you open Health Explorer it shows that the monitored object is actually Healthy!?? Here’s a quick … Continue reading

Posted in Misc Stuff, Powershell for SCOM | Tagged , , , , , , , , , , , | Leave a comment

Install AD powershell module on Windows Server 2008 R2

Installing the module on Windows Server 2008 R2 Install the module from a PowerShell console:- Import-Module ServerManager Add-WindowsFeature RSAT-AD-PowerShell After the module has been copied to your computer, you then have to import it: Import-Module ActiveDirectory

Posted in Misc Stuff, Powershell for SCOM | Tagged , , , , , , , , , | Leave a comment

Take everything out of maintenance mode with powershell one liner

This powershell one liner will take everything that is in maintenance mode out of maintenance mode (NOTE:-If you have lots of agents in maintenance mode it may take a while to execute) Get-SCOMMaintenanceMode | Set-SCOMMaintenanceMode –EndTime (Get-Date) –Comment “Autoremoved from … Continue reading

Posted in Powershell for SCOM | Tagged , , , , , , , , , | Leave a comment

Scom monitored computers processor count

Here is a handy little powershell one-liner which will  output the number of logical and physical processors for machines in your scom management group which may come in handy for doing a licence audit Get-SCOMAccessLicense | measure-object -property LogicalProcessorCount,PhysicalProcessorCount -sum … Continue reading

Posted in Powershell for SCOM | Tagged , , , , , , , , , | Leave a comment

MP reference cleanup from unsealed MP

Stumbled upon this really cool stand alone powershell script by Tao Yang that removes obsolete references from unsealed SCOM management packs. link to script There is another version available by Matthew Dowst but the differences in the versions are as follows:- … Continue reading

Posted in Management Packs, Powershell for SCOM | Tagged , , , , , , , , , , , , | Leave a comment