All pastes #879449 Raw Edit

Anonymous

public text v1 · immutable
#879449 ·published 2008-01-29 17:14 UTC
rendered paste body
'Variables for Script
strServer = "mail"
' e.g. ExchServer2
strSGName = "First Storage Group"
' e.g. SG1 strMailStoreName = "Second Mailbox Store"
' e.g. DB1 
' Find Storage Group URL 
strSearch = "CN=" & strSGName & ","

set objSrv = CreateObject("CDOEXM.ExchangeServer")
objSrv.DataSource.Open strServer 
for each sg in objSrv.StorageGroups
if (instr(1,sg,strSearch,1)>0) then strSGUrl = sg
next 

' Generate Mailbox Store URL
strMBUrl = "LDAP://CN=" & strMailStoreName & "," & strSGUrl

'wscript.echo strMBUrl 
'Open Mailbox Store
set objMb = CreateObject("CDOEXM.MailBoxStoreDB")
objMb.DataSource.Open strMBUrl
if (objMb.Status = 0) then 
'Mailbox store is mounted 
Wscript.Echo "OK - Store is mounted"
Else 
'Mailbox store is unmounted or doesn.t exist 
Wscript.Echo "Error - Store is unmounted" 
End if