Last post Feb 18, 2010 03:46 PM by dmlavigne1
Jan 14, 2010 03:06 PM|csherweb|LINK
I'm trying to use C# to create scripts wrapping calls to Exchange 2010 methods such as Get-Mailbox and Get-MailboxStatistics.
I'm using the 2.0 DLL file from PowerShell and most calls give me no problem at all. I even get results back from Get-Mailbox.
The problem is that they all are PSObject and the only way to access properties is via the deserialized string properties, i.e.
Which are pretty much all strings. In Exchange 2007 and PowerShell 1, I'd do myPSObject.BaseObject as MailboxStatistics.
This seems to be related to the fact that PowerShell 2.0 is remoting into the destination server, as per http://blogs.msdn.com/powershell/archive/2010/01/07/how-objects-are-sent-to-and-from-remote-sessions.aspx
There has to be a way to get the objects back properly, otherwise the whole .NET DLL thing for PowerShell is rendered useless since all types that aren't primitives or natively supported by PowerShell serialization cannot be used.
Feb 18, 2010 03:46 PM|dmlavigne1|LINK
I'm having the same problem in this thread: