Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report of Mailboxes within each storage group

Status
Not open for further replies.

rosaljr

MIS
Jan 10, 2005
1
US
Hi everyone,

I would like a report that shows all email addresses within a storage group. Can that be easily attained? If so, how would I go about doing it?
 
This scritp is from Jeff Hicks, does it give you what you want?

Code:
strTitle="Storage Group Report"
strServer=InputBox("What is the name of the Exchange Server?",strTitle,"TANK")

SGReport strServer
WScript.Quit

Sub SGReport(strServer)
Dim iServer
Dim iSGs
Dim iMBS

Set iServer=CreateObject("CDOEXM.ExchangeServer")
Set iSGs=CreateObject("CDOEXM.StorageGroup")
Set iMBs=CreateObject("CDOEXM.MailboxStoreDB")
iServer.DataSource.Open strServer

arrSGs=iServer.StorageGroups

For i=0 To UBound(arrSGs)
	strSGUrl=arrSGs(i)
	'WScript.Echo strSGUrl
	iSGs.DataSource.Open "LDAP://" & iServer.DirectoryServer & "/" & strSGUrl
	strData=strData & iSGs.Name & VBCRLF
	strData=strData & vbTab & "LogPath: " &iSGs.LogFilePath & VBCRLF
	strData=strData & vbTab & "SystemPath:" & iSGs.SystemFilePath & VBCRLF
	strData=strData & "  MailBox Stores:" & VBCRLF
	arrMBStores=iSGs.MailboxStoreDBs
	For j=0 To UBound(arrMBStores)
		iMBS.DataSource.open "LDAP://" & arrMBStores(j)	
		strData=strData & vbTab & iMBS.Name & VbCrLf
	Next
Next

WScript.Echo strData


End sub

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top