Recipe17.27.Mounting and Dismounting Mailbox Stores


Recipe 17.27. Mounting and Dismounting Mailbox Stores

Problem

You want to mount or dismount a mailbox store.

Solution

Using a graphical user interface

  1. Open the Exchange System Manager (ESM) snap-in.

  2. In the left pane, browse to the server and storage group that contains the mailbox store you want to manipulate.

  3. Right-click on the mailbox store and select Dismount Store.

  4. Click Yes when prompted to continue.

Using VBScript
' This code mounts/dismounts a Mailbox Store. ' ------ SCRIPT CONFIGURATION ------ strServer  = "<Exchange Server>"     ' e.g., ExchServer2 strSGName  = "<Storage Group Name>"  ' e.g., SG1 strMailStoreName = "<Database Name>" ' e.g., DB1 ' ------ END CONFIGURATION ---------     ' Find Storage Group URL strSearch = "CN=" & strSGName  & "," set objSrv = CreateObject("CDOEXM.ExchangeServer") objSrv.DataSource.Open strServer for each sg in oSrv.StorageGroups    if (instr(1,sg,strSearch,1)>0) then strSGUrl = sg    next      ' Generate Mailbox Store URL strMBUrl = "LDAP://CN=" & strMailStoreName & "," & strSGUrl     ' Open Mailbox Store set objMb = CreateObject("CDOEXM.MailBoxStoreDB") objMb.DataSource.Open strMBUrl     if (objMb.Status = 0) then    Wscript.Echo "Mailbox store is mounted, dismounting..."    objMb.Dismount else    Wscript.Echo "Mailbox store is dismounted, mounting..."    objMb.Mount end if Wscript.Echo "Script completed successfully."

Discussion

There will be times that you need to dismount a mailbox store on the fly. This could be for integrity checking, mailbox restorations, or to make email unavailable to some users for some reason. When you dismount a mailbox store, users with mailboxes in that store will be unable to retrieve their mail; users with mailboxes in other mailbox stores will be unaffected.

Managing mailbox stores requires Exchange Service Administrator permissions. See the Discussion for Recipe 17.7.


Using a graphical user interface

When a store is stopped, it has a white circle with a red downward pointing arrow over the normal mailbox store icon.

Using VBScript

The mailbox store mount/dismount script shows off three basic functions: how to check status of a mailbox store, how to mount, and how to dismount. Once again, the method to get the mailbox store URL can vary between the three methods mentioned in Recipe 17.11 and Recipe 17.16.

See Also

MS KB 314211 (HOW TO: Make a Data Store Temporarily Inaccessible to Users in Exchange 2000 Server) and Exchange Server 2003 SDK: WMI Reference



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net