Submitted By: Nick Smith (Colorado State University)

Locates the smallest mailbox database (in terms of size) for automatic provisioning process. The script retrieves a collection of mailbox databases, finds the size of each database, sorts the list based upon length, then returns the name of the smallest database.

PowerShell
Edit|Remove
(Get-MailboxDatabase | foreach { get-childitem $_.edbFilePath | select-object name,length} | sort -property length  )[0]