Operations Manager Command Shell Main Menu
Welcome to TechNet Blogs Sign in | Join | Help

April 2009 - Posts

Which MS are my agents currently connected to?
UPDATE:  04-26-2009 While using this script at a customer site, outside of my small lab environment, I realized I could have made this script perform more efficiently.  My customer had ~500 agents, and this script took about 10 minutes to complete. Read More...
All disk sizes (GB)
/*Get each logical disk size, for each agent computer, by OS version. This helps in calculating the Logical Disk Free Space Monitor from my earlier post .  You can copy results into Excel, sort by system and non-system drives, and perform an average Read More...
Operations Manager 2007 SQL Queries
I’m starting a new post here, similar to my Command Shell reference .  This will include some useful SQL queries that I happen to need and direct my customers to on a daily basis.  If you don’t see something here, check Kevin Holman’s blog .  Read More...
All groups and their contained instances
SELECT     SourceMonitoringObjectDisplayName AS 'Group', TargetMonitoringObjectDisplayName AS 'Member' FROM         RelationshipGenericView WHERE     (SourceMonitoringObjectDisplayName Read More...
All groups
SELECT     ManagedEntityGenericView.DisplayName, ManagedEntityGenericView.FullName FROM         ManagedEntityGenericView INNER JOIN                           Read More...
Get Alert History by Alert Name
get-alert | where {$_.name -match " Alert Name "} | get-AlertHistory | select Time* command shell main menu Read More...
Get Failover MS List for Agent Computer
This will return the list of Failover Management Servers for specified agent. get-agent | where {$_.computername -eq " netbios computername "} | Get-FailoverManagementServer | select computername command shell main menu Read More...
Top 10 Events
This will return the top ten events collected. FYI – Given the sheer number of events collected and stored in the OperationsManager database, this query may take a minute to return results. $array = @();foreach ($number in Get-Event | foreach-object {$_.get_number()}) Read More...
Switch to another MG in Command Shell session
If you have multiple Management Groups, this can be handy to switch between them while in the same Command Shell session. Always be aware of which Management Group you’re connected to while in the Command Shell! This example assumes your session is currently Read More...
Which Management Servers are Agents Currently Connected To?
UPDATE:  04-26-2009 - I rewrote this script so that it performs much faster.  See new post here .  I’ll take this post down in a couple weeks, after search engines are updated with new post. Read More...
What does this task target?
This will return which [typed] class the specified task will run against. foreach ($targetId in get-task | where {$_.displayname -match " task name "} | foreach-object {$_.get_target().id.tostring()}) {get-monitoringclass | where {$_.id -eq Read More...
Return discoveries running on specific interval
Got a new one today.  HTH. Foreach ($discovery in (get-discovery | foreach-object {$_.DataSource}))     {     if ($discovery.Configuration -match "IntervalSeconds> seconds <")         Read More...
Exclude Drive from Logical Disk Free Space Monitoring: Part 1
Since I just wrote an article on how to use the Logical Disk Free Space monitor , I figured this would be a nice compliment to that post.  I highly recommend reading that article to get an understanding of this monitor before moving forward with Read More...
How to measure Operations Manager database performance
In order to make any kind of performance tuning recommendations, it is first necessary to capture a baseline of normal operating conditions.  What I’d like to demonstrate in this post is how to measure the performance of your Operations Manager database Read More...
Logical Disk Free Space Monitor
Throughout my years working with MOM and Operations Manager 2007, periodically I hear complaints about Operations Manager not alerting on low disk space conditions, or that administrators are receiving false alerts.  Just about every time I've been Read More...
Command Shell: Be careful with Date-Time criteria and calculations
Nathan left a comment on one of my posts the other day. See thread:  Is alert grooming working? Well, Nathan helped me find a problem with my script.  The problem was the Date-Time criteria I was using for my calculations to verify whether or Read More...
Page view tracker