title: Creation of mailbox in Microsoft Exchange server 2013 using C#
body: <p>I am trying to create a <code>mailbox</code> in Exchange server 2013 using C#</p>
  <p>Using this <a href="http://codingchris.com/2012/02/15/creating-exchange-2010-mailboxes-in-c/" rel="nofollow noreferrer">Reference</a> I created a console application to create a mail box.
  Initially I created <code>Active Directory</code> , using the credintials I tried to create mail box. but the below statment throws exception</p>
  <pre><code>Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);
  </code></pre>
  <p>throws exception</p>
  <blockquote>
  <p>A first chance exception of type 'System.InvalidProgramException' occurred in Exchange.exe</p>
  <p>Additional information: Common Language Runtime detected an invalid program.</p>
  </blockquote>