I have been working on a simple VB script to dismount a specific store, run a offline defrag, then mount the store again. Since this exchange 2K3 server has mulitple stores, I would rather not stop the IS service.
I would use a scheduled task to call a batch file which runs the VBscript. I dont have a problem runiing this part, but it seems some of my sytax is incorrect, could you please offer your suggestions to me, I certainly would appreciate!!!
Here is my VBScript code:
strMDBName = sg1priv2 ("Name of the MDB to be dismounted","Mailbox Store Name","Mailbox store (Server-A)")
strSGName = SG1 ("Name of the storage group that contains the MDB","Storage Grop name","First storage group")
strComputerName = USUS1EXC1002 ("Name of the Exchange 2000 server","Server Name","Server-a")
strAdmGrpName = AG-NA ("Name Of the administrative group","Admin Group name","First Administrative Group")
OrgName = CORP ("Enter the Organization Name","Organization","NorthWind Traders")
LdapDc = DC=CORP ("Enter LDAP Domain Name","Dc=Domain,Dc=msft","DC=NorhWind,DC=Traders")
' Sub DismountMailboxStoreDB (strMDBName,strSGName,strComputerName )
set iServer = CreateObject ("CDOEXM.ExchangeServer")
set iMDB = CreateObject ("CDOEXM.MailboxStoreDB")
' Build the URL to the MailboxStoreDB
strMDBUrl = "LDAP://"&iServer.DirectoryServer&"/"&"cn="&strMDBName&",cn="&strSGName&",cn=InformationStore,cn="&strComputerName&",CN=Servers,CN=" &strAdmGrpName&",CN=Administrative Groups,CN="&OrgName&",CN=Microsoft Exchange,CN=Services,CN=Configuration,"& LdapDc
WScript.echo "the url is " & strMDBUrl 'e.g strMDBUrl = "ldap://CN=Mailbox Store (SERVER-A),CN=First Storage Group,CN=InformationStore,CN=SERVER-A,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=NorthWind Traders,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=NorhWind,DC=Traders"
'Bind to the MailboxStoreDB
'Dismount the MailboxStoreDB
WScript.echo "The database "& strMDBName & " was seccessfuly dismounted"
Set iServer = Nothing
Set iMDB = Nothing
' End Sub
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!