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.
|
Does Verizon's Voyager stack up to the iPhone? |
|
|
5 IT skills that won't boost your salary
[1,407]
Women 4 times more likely than men to cough up personal info
[589]
Japan's 10 funniest tech-related commercials [Videos]
[407]
Throwing away a promo CD is "unauthorized distribution"?
[1,265]
Adults too quick to dismiss educational video games
[682]
Attack of the iPhone clones [Slideshow]
[578]
10 things IT needs to know about AJAX
[1,258]
This Year's 25 Geekiest 25th Anniversaries [Slideshow]
[409]
|
|