If you want to purge all your mailboxes in Exchange 2007, simply follow the below:
1) Open ‘Exchange Management Shell’
2) Add all the disconnected mailboxes into a var by typing the below:
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid,Database
3) Purge all the disconnected mailboxes in the previously made var by typing the below:
$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }