For several times I had to dismount and re-mount all the mailbox databases from a server, and doing this via Exchange Management Console is way to slow, so I've researched a bit and found some commands to do this with PowerShell.
How to check Exchange databases status via PowerShell
In order to mount/dismount DBs, use Mount-Database and Dismount-Database respectively. Use Get-MailboxDatabase cmdlet with -Server parameter to fetch the DBs from a server and then the mount/dismount cmdlet.
Dismount a single DB
Dismount-Database -Identity DBNAME -Confirm:$False
Dismount all DBs of a server
Get-MailboxDatabase -Server SERVERNAME | Dismount-Database -Confirm:$False
Mount a single DB
Mount-Database -Identity DBNAME -Confirm:$False
Mount all DBs of a server
Get-MailboxDatabase -Server SERVERNAME | Mount-Database -Confirm:$False
I Felipe, it's a nice set of commands, but i think you got a typo, where it reads "Mount a single DB : Dismont-database..."
ReplyDeleteIt should read "Mount a single DB: Mount-Database..."
Hi LxFlip, thanks for the note!
DeleteI've been away from the blog, but just fixed it.
Thanks again!