S
shiv
Hi, I have written a small application to fetch mailboxes and public
folder in C# using powershell cmdlets.
But if mailbox store is disabled then powershell cmdlet "get-
mailboxstatistics" will show some warning messages in yellow colour.
But how do I capture it my code ?
Here is the sample code which I am using
----------------------
Collection<PSObject> results = ri.Invoke("Get-MailboxStatistics");
foreach (PSObject mo in results)
{
PSPropertyInfo prop =
(PSPropertyInfo)mo.Properties["DisplayName"];
}
--------------------
With this code is there any way I can fetch errors or warning messages
which are thrown at cmdlet output ?
Regards,
Shivaraj
folder in C# using powershell cmdlets.
But if mailbox store is disabled then powershell cmdlet "get-
mailboxstatistics" will show some warning messages in yellow colour.
But how do I capture it my code ?
Here is the sample code which I am using
----------------------
Collection<PSObject> results = ri.Invoke("Get-MailboxStatistics");
foreach (PSObject mo in results)
{
PSPropertyInfo prop =
(PSPropertyInfo)mo.Properties["DisplayName"];
}
--------------------
With this code is there any way I can fetch errors or warning messages
which are thrown at cmdlet output ?
Regards,
Shivaraj