Network World
Wednesday, December 3, 2008
DNSstuff.com
Get information about your IP
IP Information
50+ On-demand DNS and network tools

Community

Navigation

The OpsMgr Command Shell

The Command Shell is an Operations Manager specific implementation of PowerShell. PowerShell of course is Microsoft’s extensible command line interface and scripting language, available for Windows XP SP2, Windows Server 2003, Windows Vista, and part of Windows Server 2008.

The beauty of PowerShell is that it can access data in different data stores via providers, using the same syntax. PowerShell also has a hosting mechanism allowing the runtime to be imbedded inside other applications. This enables those applications to utilize PowerShell’s functionality for performing operations, while using a superset with cmdlets specific to each application. These applications include Exchange 2007, SQL Server 2008, Operations Manager 2007 and other System Center applications including Virtual Machine Manager and Data Protection Manager.

How does this work for OpsMgr? You invoke the Command Shell either by going through the Start menu (Start -> System Center Operations Manager 2007 -> Command Shell) which invokes PowerShell while loading the Operations Manager extensions.

Using the Command Shell you can use the get-momcommand cmdlet to get a list of Operations Manager 2007 cmdlets and the get-Help cmdlet to display help for each cmdlet.

For a batch environment, you can load the extensions themselves. The following code initiates a connection to the Root Management Server (RMS) and loads the OpsMgr PowerShell extensions:

 

param ($ServerName)

add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client";

set-location "OperationsManagerMonitoring::";

new-managementGroupConnection -ConnectionString:$ServerName;

set-location $ServerName;

To learn more about PowerShell, start with http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx. You can also search the web for numerous blogs, articles, and books that cover PowerShell. System Center Operations Manager 2007 Unleashed also includes examples of using PowerShell for OpsMgr administrative tasks. 

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <i> <b> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <br /> <br> <p>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Advertisement: