how to find disconnected mailbox through management shell

Hello Team,

Its very difficult to find the disconnected mailbox through graphically. I need to select a every single database.

Please suggest a EMS command to find the last mailbox mailbox database from which the mailbox get disconnected. Which we need to reconnect

And also confirm the command to reconnect it

Thanks,
Andy
LVL 5
Addy NadiaExpertAsked:
Who is Participating?
 
Will SzymkowskiSenior Solution ArchitectCommented:
Ok well the script i provided will get all mailboxes that ARE in a disconnected state. However if you want to search for a specific Mailbox then use the below command...

Get-Mailbox (read-host "type mailbox alias") | Get-MailboxStatistics | ? {$_.DisconnectedDate -ne $null} | Select DisplayName, DisconnectedDate, DisconnectedReason, Database

Open in new window


When you run this command it will prompt for you to type the mailbox alias once you do that will produce out-put as long as it is in a disconnected state.

Let me know if i am missing something here...

Will.
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
Use the following script to accomplish this and display Disconnected Mailboxes.
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | ? {$_.DisconnectedDate -ne $null} | Select DisplayName, DisconnectedDate, DisconnectedReason

Open in new window


or

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | ? {$_.DisconnectedReason -ne $null} | Select DisplayName, DisconnectedDate, DisconnectedReason

Open in new window


Will.
0
 
Addy NadiaExpertAuthor Commented:
AS per my question, i want to search specific display name or alias, in which database it was get disconnected last.?
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
Will SzymkowskiSenior Solution ArchitectCommented:
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | ? {$_.DisconnectedDate -ne $null} | Select DisplayName, DisconnectedDate, DisconnectedReason, Database

Open in new window


All you need to do is add the Database attribute after Select command as I have illustrated in the example above.

Will.
0
 
Addy NadiaExpertAuthor Commented:
Still you didnt get my question.
I want to search for specific mailbox.

Like Abc.XYZ... i need to run command to tell where this mailbox reside in Disconnection state. So that after knowing this i will reconnect it

Thanks,
Andy
0
 
Addy NadiaExpertAuthor Commented:
In this command, i need to mention mailbox name .. or directly run this command. Then it will ask the mailbox name
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
You can either use the command above (read-host) or you can use the -Identity parameter.

Read-host command will ask you for the mailbox name after you run the command. Once you are prompted to enter the name it will then run the script against that name.

Using this method you do not have to modify the script everytime for a different user.

If you use the Identity parameter then you need to add the mailbox name every time  before running the script.

Personally I like the (read-host) command better, but you can do it both ways.

Will.
0
 
Addy NadiaExpertAuthor Commented:
Ok i will try this script with read host
 But your earlier command i ran. But through me errors in shell..
With warningss
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
If there are any error messages please let me know so i can correct them and ensure that there is nothing missed.

Will.
0
 
Addy NadiaExpertAuthor Commented:
Ok i will share..
0
 
Addy NadiaExpertAuthor Commented:
Actually i disable the mailbox from exchange 2010 i.e remote user mailbox. 4 days ago

When i am seeing in office365 portal. In mailboxes i can see the mailbox how can reconnect the remote user mailbox back in exchange 2010
0
 
Addy NadiaExpertAuthor Commented:
Can you please revert on this
0
 
Addy NadiaExpertAuthor Commented:
Good
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.