You can run PowerShell cmdlets easily from within the .NET Framework, and you will work
through a few examples in this chapter.
This chapter covers the following topics:
??‘ Accessing PowerShell from the .NET Framework
??‘ Solving problems with PowerShell and the .NET Framework
Accessing PowerShell from the
. NET Framework
To be able to work with PowerShell from the .NET Framework, you need to first download the
Windows PowerShell Software Development Kit (SDK) from Microsoft. To be able to run any of
the Exchange cmdlets you will also need the Exchange Server 2007 management tools installed.
Part IV: Automating Administration
486
The Windows PowerShell SDK has been rolled into part of the Windows Software Development for
Windows Vista and .NET Framework 3.0 Runtime Components. You can obtain the Windows Software
Development for Windows Vista and .NET Framework 3.0 Runtime Components from Microsoft here:
microsoft.com/downloads/details.aspx?familyid=c2b1e300-f358-4523-b479-
f53d234cdccf & displaylang=en .
Although you can use C# and Visual Basic.NET to automate Windows PowerShell, this chapter focuses
on C# examples. For those readers who are more comfortable with VB.NET, the following examples can
be converted into usable VB.NET.
Starting a Web Project
This example leads you through the creation of several simple pages to demonstrate how to get started
using Windows PowerShell to manage your Exchange servers from the .
Pages:
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675