C# and Remote PowerShell - Lookup Smallest Mailbox Database

The following example can be used to return the smallest available mailbox database with a given name pattern. This might be useful if you're running multiple mailbox databases with similar names: Database 1, Database 2, Database 3, etc.. You can pass in a search for "Database*" and it will find…

Exchange Remote PowerShell - PSLanguageMode to FullLanguage

How many developers have encountered the following errors when attempting to write remote PowerShell commands against Exchange? Function declarations are not allowed in restricted language mode or a Data section. Property references are not allowed in restricted language mode or a Data section. Assignment statements are not allowed in restricted…

Exchange 2010 - Enable Mailbox through C# & PowerShell

The following is an example on how to use C# to create exchange mailboxes for Exchange 2010 using remote PowerShell. Imports, not all are used in the example function below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.DirectoryServices; using System.EnterpriseServices; using System.…