[Update: November 18th, 2008: Updated System Center URL.]
I've started doing some guest blogging on the great System Center Forum site. My first post is HERE.
I'm doing a series on OpsMgr automation using a simple example like the Command Shell's get-agent cmdlet.
I'm going to attempt to show at least 5 ways that one can duplicate the get-alert cmdlet:
1. The simplest way to list the alerts is via the OpsMgr Command Shell by simply using the get-alert cmdlet.
2. Still using the Command Shell, I could use PowerShell’s .NET functionality to use the OpsMgr SDK .NET assemblies directly from within the console.
3. Using the OpsMgr SDK .NET assemblies, a C# console application could be created to duplicate the same functionality.
4. Similar to what was done for SQL Server 2008, a PowerShell “clone”, also known as a “minishell”, can be created that can also work as a console application.
5. A custom PowerShell runspace can be used, which is the method the Exchange 2007 Management Shell (which is PowerShell with some add-ons for Exchange management/administration) must be integrated into C# applications because of the absence of any other public API.
Check it out!