Command Shell Reference
SQL Queries
Welcome to TechNet Blogs Sign in | Join | Help
Operations Manager 2007 Command Shell

I hope this can serve the Operations Manager community as a good source for finding working examples of the Command Shell.

I will continue to update this table periodically.  If you subscribe to my blog, you will receive each new example as I post it.

Replace the text in red in each example with your specific parameters or criteria.

Command Task Descriptions
Add-ConnectorToTier  
Add-RemotelyManagedComputer  
Add-RemotelyManagedDevice  
Add-UserToUserRole  
Approve-AgentPendingAction Approve manual installations

Approve agent updates
Disable-NotificationSubscription  
Disable-Rule  
Enable-NotificationSubscription  
Enable-Rule  
Export-ManagementPack Export a Management Pack
Get-Agent Agent state

Resolve agent from Health Service Id

Enable Agent Proxying, by Health Service Id

Get BaseManagedEntityId for Agent

Which MS are my agents currently connected to?
Get-AgentPendingAction Approve manual installations

Approve agent updates
Get-Alert New alerts count

Count alerts that are not NEW or CLOSED

Closed alerts count

Count alerts raised on specific date

Count alerts raised in specific date range

Count all alerts, group by date

Top 10 alerts

10 most recent CRITICAL alerts (not closed)

Top 10 REPEATING alerts (not closed)

Resolve all open alerts in date range

Resolve all open alerts, by Alert Name

Resolve all open alerts generated by specific Agent

Resolve all alerts in specific Resolution State

Is alert grooming working?
Get-AlertDestination  
Get-AlertHistory Get Alert History by Alert Name
Get-Connector  
Get-DefaultSetting Return Management Group global settings
Get-Diagnostic  
Get-Discovery Return discoveries running on specific interval
Get-Event Top 10 Events
Get-FailoverManagementServer Get Failover MS List for Agent Computer
Get-GatewayManagementServer Set failover management server for Gateway role
Get-MaintenanceWindow  
Get-ManagementGroupConnection List connected users
Get-ManagementPack All monitors overridden from specific MP

All rules overridden from specific MP

Overrides created in date range

Overrides that have been modified

Overrides modified in date range

All overrides, with settings

In which Management Pack is this Group Stored?
Get-ManagementServer AD Integration LDAP Queries
Get-Monitor Returns Management Pack which contains specific Monitor

Resolve UIGeneratedMonitor to a Monitor Name

All monitors overridden from specific MP
Get-MonitorHierarchy  
Get-MonitoringClass Get class properties

Get HOST class

Get HOST class properties (if any)

Get BASE class

Get BASE class properties (if any)

In which Management Pack is this Group Stored?
Get-MonitoringClassProperty  
Get-MonitoringObject  
Get-MonitoringObjectGroup Groups and related information
Get-MonitoringObjectPath  
Get-MonitoringObjectProperty Return discovered inventory
Get-NotificationAction  
Get-NotificationEndpoint  
Get-NotificationRecipient Return SMTP Channel Email Addresses
Get-NotificationSubscription  
Get-OperationsManagerCommand  
Get-Override All monitors overriden from specific MP

All rules overriden from specific MP

Overrides created in date range

Overrides that have been modified

Overrides modified in date range

All overrides, with settings
Get-PerformanceCounter  
Get-PerformanceCounterValue  
Get-PrimaryManagementServer  
Get-Recovery  
Get-RelationshipClass  
Get-RelationshipObject  
Get-RemotelyManagedComputer  
Get-RemotelyManagedDevice  
Get-ResultantCategoryOverride  
Get-ResultantRuleOverride  
Get-ResultantUnitMonitorOverride  
Get-RootManagementServer  
Get-Rule Returns the Management Pack which contains specific rule

Find collection rule for specific Event Id

Find performance collection rule for specific Object, Counter or Instance

Resolve UIGeneratedRule to a Rule Name

All rules overridden from specific MP
Get-RunAsAccount  
Get-State  
Get-Task What does this task target?
Get-TaskResult  
Get-Tier  
Get-UserRole  
Install-Agent Discover and install agent
Install-AgentByName  
Install-ManagementPack Import a Management Pack
New-CustomMonitoringObject  
New-DeviceDiscoveryConfiguration  
New-LdapQueryDiscoveryCriteria  
New-MaintenanceWindow  
New-ManagementGroupConnection Switch to another MG in Command Shell session
New-MonitoringPropertyValuePair  
New-Tier  
New-WindowsDiscoveryConfiguration  
Reject-AgentPendingAction  
Remove-ConnectorFromTier  
Remove-DisabledMonitoringObject Remove-DisabledMonitoringObject
Remove-ManagementGroupConnection  
Remove-RemotelyManagedComputer  
Remove-RemotelyManagedDevice  
Remove-Tier  
Resolve-Alert Resolve all open alerts in date range

Resolve all open alerts, by Alert Name

Resolve all open alerts generated by specific Agent
Set-AlertDestination  
Set-DefaultSetting Set Management Group Global Settings
Set-MaintenanceWindow  
Set-ManagementServer Set failover management server for Gateway role
Set-ProxyAgent  
Start-Discovery  
Start-Task  
Uninstall-Agent  
Uninstall-ManagementPack Delete a Management Pack




Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker