http://smtpport25.wordpress.com/2009/06/01/delete-exchange-mailbox-and-ad-account-for-the-give-list-of-users/
Below is the command to delete Both Exchange mailbox and Active Directory Account with the single commant from the given list of users in the text file.
Get-content “C:\Powershell\Users.txt” | Remove-Mailbox
Below command will the get list of users in the disabled state and modified date is older then 10 days and deletes the same
Get-Mailbox -ResultSize unlimited |?{$_.useraccountcontrol -match “AccountDisabled, NormalAccount”} |?{$_.WhenChanged -lt (get-date).AddDays(-10)} |Remove-Mailbox
Regards,Krishnahttp://smtpport25.wordpress.com