How do I programatically create an exchange 2010 mailbox using C#

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.

Managing Entity Framework ObjectContext in ASP.NET

I’m using the Entity Framework for an ASP.NET Web Forms application and I’m wondering how I should deal with ObjectContext and it’s lifetime.
For example, I have an InviteService class that manages invites such as creating and accepting invites. The class itself is in another project/namespace from the Web project.
An InviteUsers() method creates Invite entities for a list of users, calls a repository to save them to the database and mails each user an invite link.

runAllManagedModulesForAllRequests = “true” killing windows authentication in IIS7

We have windows authentication set up on our staging server for our clients to help prevent google from indexing our staging URLs. We recently found out that one of our sites is seemingly ignoring our IIS settings (anonymous authentication is disabled, windows authentication is enabled). We ended up figuring out that removing the setting runAllManagedModulesForAllRequests=”true” on the modules node (which is required for our URL rewriting on the site) fixes the issue and the windows login/password box appears as expected when we browse to the site. If we keep the setting there, the site allows any anonymous user to browse the website.