Link: Current Issues with ActiveSync and iOS, Android

Applies to: Exchange Server

This document lists common Exchange ActiveSync issues with vendor devices that synchronize with Exchange, such as Android and iOS devices.

Exchange 2010 Purge Disconnected Mailboxes

Applies to: Exchange 2010

There is sometimes the need to permanently delete disconnected mailboxes. For example, if you moved mailboxes between databases, the previous database will still hold a copy of the moved mailboxes (by default for 30 days). If you’re tight on disk space, you might want to delete the disconnected mailboxes manually.

Note: Your Exchange database file size will not decrease right-aways, however, the Exchange Mailbox Server(s) will immediately have free space inside the .edb file for new emails.

Step 1: Retrieve List of Disconnected Mailboxes

Get-MailboxDatabase | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”} | Select DisplayName,ServerName,Database,ItemCount

Step 2a: Permanently Delete an Individual Disconnected Mailbox

Remove-StoreMailbox -Database (Database) -Identity (useralias) -MailboxState SoftDeleted

Step 2b: Permanently Delete all Disconnected Mailboxes across all Databases (enter below commands into a .ps1 file before executing)

$var1 = Get-MailboxDatabase | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”}

$var1 | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

Script for Available Free Space Within Exchange Databases

Applies to: Exchange 2010

This Exchange Management Shell Script returns the available free space (whitespace) within your mailbox databases. This may by useful to know when you purged disconnected mailboxes.

Get-MailboxDatabase -status | fl Name,AvailableNewMailboxSpace

The result will look similar to this.

Name : Mailbox Database 1
AvailableNewMailboxSpace : 14.41 MB (15,106,048 bytes)

Name : Mailbox Database 2
AvailableNewMailboxSpace :
5.251 GB (5,638,553,600 bytes)

Name : Mailbox Database 3
AvailableNewMailboxSpace : 142.3 MB (149,258,240 bytes)

Script for User Count Per Mailbox Database – Exchange 2007

Applies to: Exchange Server 2007

Here an Exchange Management Shell script that displays the user count per database.

Step 1: Create a new text file in C:Scripts named “Get-MailboxCountPerDatabase.ps1” and paste the code below into the text file.

write-host -fore yellow “This script will get each mailboxdatabase and the current user count ”
foreach($name in get-mailboxdatabase)
$count=(get-mailbox -database $name).count
write-host $count -nonewline
write-host ” mailboxes in $name”
write-host -fore yellow “The system has a total mailboxes of “$user=(get-mailbox –resultsize unlimited).count
write-host -fore red $user

Step 2: Once you have saved the text file, run the script file by entering it’s name into the Exchange Management Shell, (C:ScriptsGet-MailboxCountPerDatabase.ps1).