Link to home
Start Free TrialLog in
Avatar of lianne143
lianne143Flag for United States of America

asked on

How to forcefully delete all the disconnected mailboxes at one go \ batch by batch.

Hi

I have 100 of users who have left our organisation in the past and their mailboxes has not been deleted.
Now I have deleted their mailboxes and lists all the deleted mailbox with their Display names and MailboxGuid , when I give the following command.

Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

I know how to forcefully delete the mailbox by entering the following command and putting the relevant MailboxGuid one by one. It  will take lot of time if I go on this method.

[PS] C:\Windows\system32>Remove-Mailbox -Database "Mailbox Database" -StoreMailboxIdentity "a31fb8b5-14ee-4509-834e-409d2ea3fe38" -confirm:$true

Confirm
Are you sure you want to perform this action?
Removing store mailbox "a31fb8b5-14ee-4509-834e-409d2ea3fe38" on database
"Exchange.domain.local\Mailbox Database".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y
[PS] C:\Windows\system32>

Is there a easy way of forcefully deleting the  disconnected mailboxes at one go.

Any help will be great.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Muhammad Burhan
Muhammad Burhan
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial