How to delete disconnected mailbox

[PS] C:\>$users = Get-MailboxStatistics -Database “DatabaseName” | where {$_.disconnectdate -ne $null}

[PS] C:\>$users | ForEach { Remove-Mailbox -Database “DatabaseName” -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

Exchange Management Shell (EMS) shortcut is missing

After installing SP1 or Update Rollup, Exchange Management Shell shortcut is missing.

Action:

  1. Verify that the ConnectFunctions.ps1, RemoteExchange.ps1, CommonConnectFunctions.ps1 files are present in the %ExchangeInstallPath%\bin folder.
    If these files are missing – copy the files from Exchange Server 2010 SP1 (\setup\serverroles\common)
  2. Right click on desktop -> New -> Shortcut.
  3. Type the location of the item -> %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command “. ‘%ExchangeInstallPath%\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto”
  4. Type a name of this shortcut -> Exchange Management Shell -> Finish.
  5. Right click the Exchange Management Shell shortcut -> Properties -> Shortcut tab. Remove the text from Start In field.
  6. Click Change Icon -> Browse  and enter %SystemRoot%\Installer\{4934D1EA-BE46-48B1-8847-F1AF20E892C1}\PowerShell.exe in the File name field.
  7. Select icon and click OK. Click Apply and click OK.

The term ‘New-MailboxExportRequest’ is not recognized

The term ‘New-MailboxExportRequest’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Action:

  1. Launch Exchange Management Shell
  2. Run “Add-pssnapin microsoft*
  3. Run “Install-CannedRbacRoles
  4. Run “Install-CannedRbacRoleAssignments
  5. Close and re-open Exchange Management Shell