How to create an user overview, incl mailbox and mailbox guid
Get-MailboxStatistics -server ‘xch01.dmain.local’ | Select DisplayName, Database, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime, MailboxGUID | Export-CSV c:\scripts\mailbox-server-xch01-8-4-2012.csv
Full username Mailbox Database 0018485193 domainuser1 11 152.6 KB (156,304 bytes) 3/20/2012 10:50:00 AM 3/20/2012 10:50:02 AM 6b4d2897-2ad4-4255-9660-df737d691ecd
Full username Database1 domainuser1 7115 527.9 MB (553,531,961 bytes) 3/19/2012 10:41:21 AM 3/19/2012 7:44:20 PM ed5b6db8-9012-42d8-bc26-512cf5dca072
Full username Database1 domainuser1 10 80.46 KB (82,396 bytes) 3/20/2012 10:11:21 AM 3/20/2012 10:20:49 AM 6b4d2897-2ad4-4255-9660-df737d691e36
Here you find the GUID of the mailbox for viewing.
User1 had 3 mailboxes, and 2 of these could be deleted
Remove-StoreMailbox -Database Database1 -Identity “ed5b6db8-9012-42d8-bc26-512cf5dca072” -MailboxState Disabled
Confirm
Are you sure you want to perform this action?Removing mailbox “ed5b6db8-9012-42d8-bc26-512cf5dca072” on database “Database1”.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): y
Remove-StoreMailbox -Database ADatabase1 -Identity “6b4d2897-2ad4-4255-9660-df737d691ecd” -MailboxState softdeleted
Confirm
Are you sure you want to perform this action?Removing mailbox “6b4d2897-2ad4-4255-9660-df737d691e36” on database “Database1”.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”):
Again make an overview of the mailbox and ther GUID:
Get-MailboxStatistics -server ‘xch01.domein.local’ | Select DisplayName, Database, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime, MailboxGUID | Export-CSV c:\scripts\mailbox-server-xch01-8-4-2012-2.csv
Full username Mailbox Database 0018485193 domainuser1 11 152.6 KB (156,304 bytes) 3/20/2012 10:50:00 AM 3/20/2012 10:50:02 AM 6b4d2897-2ad4-4255-9660-df737d691ecd