Text.Replace(???\\???,???\\\\???) + ???\???}???)[0].BaseObject;
CommandParameter verbParam2 = new
CommandParameter(???FilterScript???, sBlock);
EMSCmd2.Parameters.Add(verbParam2);
Collection < PSObject > cmdData = pipeLine.Invoke();
DataSet ds = new DataSet();
ds.Tables.Add(???Pipeline???);
ds.Tables[???Pipeline???].Columns.Add(???DisplayName???);
ds.Tables[???Pipeline???].Columns.Add(???ServerName???);
ds.Tables[???Pipeline???].Columns.Add(???Database???);
foreach (PSObject cmdlet in cmdData)
{
ds.Tables[???Pipeline???].Rows.Add(cmdlet.Properties[???Name???].Value.ToString(),cmdlet
.Properties[???ServerName???].Value.ToString(),cmdlet.Properties[???Database???].Value
.ToString());
}
GridView1.DataSource = ds.Tables[???Pipeline???];
GridView1.DataBind();
pipeLine = null;
The results of running this modified page are shown in Figure 17 - 5 .
(continued)
495
Chapter 17: Using the .NET Framework
Figure 17-5
In this example, we haven ??™ t made any formatting changes to the table or any attempt to provide an esthetically
pleasing interface. You can, however, see how simple it is to work with the data in PowerShell. With
minimal effort you can create runspace and pipeline objects that can be used to retrieve data.
Solving Problems with PowerShell
and the . NET Framework
After you understand the basics of Exchange Server 2007, Windows PowerShell, and how to work with
them from the .
Pages:
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687