Page 1 of 1 1
Topic Options
#186410 - 2008-03-21 05:30 AM Need to count mail enabled objects in mailstores
Daleco Offline
Fresh Scripter

Registered: 2006-11-16
Posts: 23
Loc: Colorado, USA
We have a maximum number of mail enabled accounts that can be in any one mailstore. Currently, we have about 120 mailstores and every time we create a new account we have to search to find a mailstore to put.

I have looked on the web for any VB scripts and kixtart.org for any scripts that might even be close but haven't found anything I can use.

Does anyone have a place for me to start?

TIA,
Dale

Top
#186411 - 2008-03-21 06:30 AM Re: Need to count mail enabled objects in mailstores [Re: Daleco]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
There is no pre-made script for it that I'm aware of.

What version of Exchange are you running? Is it in Native mode?

Would need to look and see if their is a COM object that provides that information and then see if KiX or VB can access it to return the data.

Top
#186463 - 2008-03-25 04:15 AM Re: Need to count mail enabled objects in mailstores [Re: NTDOC]
Daleco Offline
Fresh Scripter

Registered: 2006-11-16
Posts: 23
Loc: Colorado, USA
Sorry, been out for a few days.

I'm running Exchange 2003 in native mode.

There is an Attribute for the mail store in ADSI Edit (Homemdbbl). This attribute contains a list of the mail enabled objects within the mailstore,

I'm not sure where to start to develop a script to enumerate all the mailstores and to count the number of objects within this attribute.

Dale

Top
#186587 - 2008-04-01 06:56 AM Re: Need to count mail enabled objects in mailstores [Re: Daleco]
Daleco Offline
Fresh Scripter

Registered: 2006-11-16
Posts: 23
Loc: Colorado, USA
I don't suppose anyone might have a starting point for me.

Thanks,
Dale

Top
#186775 - 2008-04-07 10:08 AM Re: Need to count mail enabled objects in mailstores [Re: Daleco]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
What attribute are you changing to enable / disable mail for the objects?
Top
#186824 - 2008-04-10 05:55 AM Re: Need to count mail enabled objects in mailstores [Re: Richard H.]
Daleco Offline
Fresh Scripter

Registered: 2006-11-16
Posts: 23
Loc: Colorado, USA
Richard,

All I want to do is get a count of the mail enabled objects in each mail store on each Exchange server. I don't want to change anything.

Dale
_________________________
Dale

Top
#186826 - 2008-04-10 11:47 AM Re: Need to count mail enabled objects in mailstores [Re: Daleco]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: Daleco
Richard,

All I want to do is get a count of the mail enabled objects in each mail store on each Exchange server. I don't want to change anything.

Dale


Yes, I understand that. What I am getting at is that if you are changing an attribute on an AD object to enable/disable mail then it may be simpler to iterate AD and check the attribute rather than working from the mail store direction.

Top
#186827 - 2008-04-10 01:03 PM Re: Need to count mail enabled objects in mailstores [Re: Richard H.]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Here is an example of what I mean.

This script enumerates all AD objects, and displays the information for those objects which have a mail store defined.

You can take this as a starting point and add code to summarise by whatever field you fancy.

If you don't want to tackle the additional code just change the output so that it is suitable to import into Excel as a CSV file and sort / summarise in Excel.


$=SetOption("WrapAtEOL","ON")
BREAK on


$objConnection = CreateObject("ADODB.Connection")
$objCommand = CreateObject("ADODB.Command")
$objConnection.Provider = "ADsDSOObject"
$objConnection.Open("Active Directory Provider")
$objCommand.ActiveConnection = $objConnection


$objCommand.CommandText =
"SELECT Name,homeMDB FROM "
+ "'LDAP://"
+ GetObject("LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")).distinguishedName
+ "'"


$objCommand.Properties("Page Size").Value = 100
$objCommand.Properties("Search Scope").Value = 2
$objCommand.Properties("Cache Results").Value = (not 1)


$objRecordSet = $objCommand.Execute()
$objRecordSet.MoveFirst
while not $objRecordSet.EOF
If $objRecordSet.Fields("homeMDB").Value
$objRecordSet.Fields("Name").Value+@CRLF


" Exchange Server: "+Split($objRecordSet.Fields("homeMDB").Value,",")[3]+@CRLF
" Storage Group: "+Split($objRecordSet.Fields("homeMDB").Value,",")[1]+@CRLF
" Mail Store: "+Split($objRecordSet.Fields("homeMDB").Value,",")[0]+@CRLF
@CRLF
EndIf
$objRecordSet.MoveNext
Loop


Exit 0



Top
#186858 - 2008-04-11 02:10 AM Re: Need to count mail enabled objects in mailstores [Re: Richard H.]
Daleco Offline
Fresh Scripter

Registered: 2006-11-16
Posts: 23
Loc: Colorado, USA
Thanks Richard, I'll give this shot.
_________________________
Dale

Top
#186864 - 2008-04-11 07:56 AM Re: Need to count mail enabled objects in mailstores [Re: Daleco]
Daleco Offline
Fresh Scripter

Registered: 2006-11-16
Posts: 23
Loc: Colorado, USA
Richard,

I really appreciate your assistance on this. With some tweaking it is giving me what I need. For now I'm using the output to Excel and then summarize from there.

Thanks again,
_________________________
Dale

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.091 seconds in which 0.043 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org