Figure 17-3
493
Chapter 17: Using the .NET Framework
Several other options can be added to provide information to non - technical users via a website. For
example, this page could return a table of the mailboxes, server name, and the mailbox store. To do this
you can drop a GridView control onto the page to replace the TextBox control. To use the returned data,
a dataset is created and each object from the pipeline is added the dataset.
RunspaceConfiguration EMSConfig =
RunspaceConfiguration.Create();
PSSnapInException snapInException = null;
PSSnapInInfo info =
EMSConfig.AddPSSnapIn(???Microsoft.Exchange.Management.PowerShell
.Admin???, out snapInException);
Figure 17-4
(continued)
Part IV: Automating Administration
494
Runspace EMSRunSpace =
RunspaceFactory.CreateRunspace(EMSConfig);
EMSRunSpace.Open();
Pipeline pipeLine = EMSRunSpace.CreatePipeline();
Command EMSCmd = new Command(???Get-Mailbox???);
pipeLine.Commands.Add(EMSCmd);
CommandParameter verbParam = new CommandParameter(???Server???, ???MB001???);
EMSCmd.Parameters.Add(verbParam);
Command EMSCmd2 = new Command(???Where-Object???);
pipeLine.Commands.Add(EMSCmd2);
RunspaceInvoke rsi = new RunspaceInvoke();
ScriptBlock sBlock = (ScriptBlock)rsi.Invoke(???{$_.??? +
DropDownList1.SelectedValue + ??? -match \?????? +
TextBox2.
Pages:
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686