Category Archives: Powershell for SCOM

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

List all computers with a particular active alert

Here is the powershell, you need to amend the management server and the alert details to meet your requirements. Save as a .ps1 file and run in an Operations Manager Shell.   Import-Module OperationsManager New-SCOMManagementGroupConnection -Computername “SCOM MGMT SERVER”  #Get … Continue reading

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

Change the SCOM 2012 Database Grooming Settings using PowerShell

If you want to use PowerShell to change the Database Grooming settings in SCOM 2012, you can use the following: (just set the value to how many days you want to keep the data before grooming it out of the … Continue reading

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

SCOM 2012 powershell to remove management pack

You can remove management packs via the SCOM console or by using powershell command via the Operations Manager Shell NOTE:-This syntax is for SCOM 2012 get-scommanagementpack | where {$_.displayName -eq “MP displayname”} | remove-scommanagementpack

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