Command Line Store Dismount
It's quite common for people to ask how you dismount a mailbox or public folder store from a command line.
There's actually no direct command line utility to do this, but it is extremely easy via a small piece of VBScript that makes use of CDOEXM. Copy and paste the code below into notepad and save it as dismount.vbs or another suitable name. You will need to modify the parts of the code that are in bold, since these parts will be specific to your environment. I will explain what each part is after the code listing.
Set oDB = CreateObject("CDOEXM.MailboxStoreDB")
strDB = "CN=Mailbox Store (E2K3),CN=First Storage Group,CN=InformationStore,CN=E2K3,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=Exchange 2003,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=com"
oDB.DataSource.Open strDB
oDB.Dismount()
The important line of the code is the second line, as this identifies the store that you wish to dismount. Here I list the parts of the example code above that you will need to change to suit your environment. Leave all other parts as per the code above.
CN=Mailbox Store (E2K3)
Change this to reflect the display name of the mailbox or public folder store you wish to dismount. In this example, we're dismounting the default mailbox store created on a server named E2K3.
CN=First Storage Group
Here you'll need to enter the name of the storage group that contains the mailbox or public folder store you wish to dismount.
CN=E2K3
This is the name of the server on which you wish to perform your dismount action.
CN=First Administrative Group
Change this to reflect the name of the administrative group in which the affected server resides.
CN=Exchange 2003
This is the name of the Exchange organisation.
DC=domain,DC=com
Here you'll need to enter your Active Directory domain name.
Of course, once you've dismounted your store you'll need to mount it again at some point, otherwise your users won't be able to log into their mailboxes. For this task, just create another VBScript file using the above code but change the last line to read as follows:
oDB.Mount()
And there you go. It's as easy as that.
Neil Hobson on December 10, 2003 at 01:45 PM
« WiFi BlackBerry Likely to be Launched Next Year |
Main
| Exchange 2003 Performance Whitepaper Published »
TrackBack
TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8345191a569e200e5503440738834
Listed below are links to weblogs that reference Command Line Store Dismount:
» Command Line Store Dismount from Phil's NewsPhlash
Now this is cool for those folks who like to do flat-file backups… It's quite common for people to ask how you dismount a mailbox or public folder store from a command line. There's actually no direct command line... [Read More]
Tracked on Dec 11, 2003 1:10:33 PM
Comments
I tried this and got an invalid argument error
Posted by: Joe Schmeier at Apr 26, 2004 11:41:59 AM
Works perfectly, thanks.
Posted by: Hog at May 24, 2004 1:49:57 PM
Does anyone have the equivalent code in c++ ?
Posted by: Patrick Télégone at Oct 27, 2004 9:05:13 AM
It works perfect too on our Exchange 2000 servers. Thanks a lot.
Posted by: Bruce Kong at Nov 27, 2004 9:01:47 PM
Anyone know of a vbscript way to enumerate the storage group names?
Thanks,
Tim
Posted by: Tim at Nov 29, 2004 9:28:33 AM
This worked perfectly and saved me a tedious chore of doing this manually. Thanks a million!
Posted by: Phil Cox at Dec 16, 2007 12:11:26 PM
Thank you
Works perfect for my Mailbox store but I can't seem to get the syntax right for my public folder store. I changed "Mailbox Store (E2K3)" to "Public Folder Store (SERVERNAME)" and get an invalid argument error. If I try any other name for the public folder store I get "No such object exists on server".
Posted by: John at Jun 18, 2009 10:50:55 AM
