I have been given a task to write a program to automatically create a 2010 exchange mailbox. My research tells me to use powershell but I can't seem to find the namespace to reference and would like some sample code. I found some code on the web but I don't know what the namespace is for PowerShell. I think it might be System.Management.Automation but when I try to reference the namespace it does not exist in the list of dotnet. All I have is System.Management and System.Management.Instrumentation.
Any help would be appreciated?
When I did it I had to download Powershell separately, not sure if this is still the case though. You can get it from here.
Here is example code that will create a Mailbox:
This is an old question but it might help future visitors...
w69rdy's answer did not work for me. But I got it working and blogged about it here http://pedroliska.wordpress.com/2011/07/22/running-exchange-management-shell-commands-powershell-with-c/