Hi all,

I'm trying to retrieve the membership of users from a group using a
VBScript from a windows machine. I'm able to retrieve all groups in a
certain OU.. and connect to each of those groups to retrieve the name,
hoever, when i try to retrieve the objGroup.member attribute, the result
is an empty array. What is the correct (or working) way of retrieving
that information.

-Const ADS_SCOPE_SUBTREE = 2

'eDir
strSource="eDirectory"
'ActiveDir
strTarget="ActiveDirectory"


strNDSUserName="cn=admin,o=eDir"
strPassword="P@ssw0rd"

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Properties("User ID") = strNDSUserName
objConnection.Properties("Password") = strPassword
objConnection.Open "ADSI"

Set objCommand.ActiveConnection = objConnection

objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = "SELECT entryDN FROM 'LDAP://" & strSource &
"/ou=Groups,o=eDir' WHERE structuralObjectClass='groupOfNames'"
Set objRecordSet = objCommand.Execute

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo objRecordSet.Fields("entryDN").Value
strEntryDN=objRecordSet.Fields("entryDN").Value

Set objGroup = GetObject ("LDAP://" & strSource & ":389/" &
strEntryDN)
objGroup.getInfo
Wscript.echo objGroup.Name & " is the Name"

wscript.echo TypeName(objGroup.member)
Array1=Array(objGroup.member)
wscript.echo VarType(Array1)
Length = UBound(Array1)
wscript.echo Length-


--
RZomerman
------------------------------------------------------------------------
RZomerman's Profile: http://forums.novell.com/member.php?userid=98896
View this thread: http://forums.novell.com/showthread.php?t=426140