Is it possible to output the following to a RadGrid rather than just the page?
Thank you.
Protected
Sub
Button1_Click(sender
As
Object
, e
As
System.EventArgs)
Handles
Button1.Click
Dim
newPaswordSecureString
As
System.Security.SecureString =
New
System.Security.SecureString()
Dim
newPassword
As
String
=
"password"
For
Each
c
As
Char
In
newPassword
newPaswordSecureString.AppendChar(c)
Next
Dim
credential
As
PSCredential
credential =
New
PSCredential(
"userame"
, newPaswordSecureString)
'Set the connection Info
Dim
connectionInfo
As
WSManConnectionInfo =
New
WSManConnectionInfo(
New
Uri(
"http://tusdcas1.tusd.local/powershell"
),
"http://schemas.microsoft.com/powershell/Microsoft.Exchange"
, credential)
Dim
runspace
As
Runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(connectionInfo)
runspace.Open()
Dim
newMbx
As
Command
newMbx =
New
Command(
"Get-MailboxStatistics"
)
newMbx.Parameters.Add(
"Server"
,
"TUSDMBSTORAGE1.tusd.local"
)
Dim
cmd
As
Pipeline = runspace.CreatePipeline()
cmd.Commands.Add(newMbx)
Dim
commandResults
As
Collection(Of PSObject)
commandResults = cmd.Invoke()
For
Each
cmdlet
As
PSObject
In
commandResults
Dim
_cmdletDisplayName
As
String
= cmdlet.Properties(
"DisplayName"
).Value.ToString()
Dim
_cmdletTotalItemSize
As
String
= cmdlet.Properties(
"TotalItemSize"
).Value.ToString()
Dim
_cmdletLegacydn
As
String
= cmdlet.Properties(
"LegacyDN"
).Value.ToString()
Response.Write(
"Mailbox No.:"
+ _cmdletDisplayName +
","
+ _cmdletTotalItemSize +
","
+ _cmdletLegacydn)
Next
End
Sub
Thank you.