Category Archives: Powershell for SCOM

Powershell to send Top 15 Critical Alerts email from Scom

Here is a nifty powershell script that you can use to send an email with the Top 15 Critical Alerts in your Scom Management group to recipients of your choice. NOTE:-Amend the addresses in the script with @mycompany.com suffix to … Continue reading

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

What scom groups does a monitored server belong to?

If you wish to find out all the groups a particular server monitored by scom belongs to then you can run this handy little powershell script  (you need to amend the script by entering the FQDN of the monitored server … Continue reading

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

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 (Powershell V4) 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  If you are on a version … Continue reading

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