[gptalk] How to get the list of users in a group.

  • From: "Ananth Rajagopal" <ananth.rg@xxxxxxxxx>
  • To: gptalk@xxxxxxxxxxxxx
  • Date: Fri, 14 Nov 2008 15:44:20 +0530

Hi All,

We are having a 300 user AD. According to project needs we have created
several groups. Now we wold like to get the list of users in these groups.

We got a script from MS Scriptcenter, but it is returning an error....
please advice....

I've attached an image of our users and groups.

Dim arrNames()
intSize = 0

Set objGroup = GetObject("LDAP://CN=pm_anim_artists,DC=Tai3D,DC=com")

For Each strUser in objGroup.Member
    Set objUser =  GetObject("LDAP://" & strUser)
    ReDim Preserve arrNames(intSize)
    arrNames(intSize) = objUser.CN
    intSize = intSize + 1
Next

For i = (UBound(arrNames) - 1) to 0 Step -1
    For j= 0 to i
        If UCase(arrNames(j)) > UCase(arrNames(j+1)) Then
            strHolder = arrNames(j+1)
            arrNames(j+1) = arrNames(j)
            arrNames(j) = strHolder
        End If
    Next
Next

For Each strName in arrNames
    Wscript.Echo strName
Next

We are "There is no such object on the server" message. Selected users are
members of ordinary groups. So we are wondering where we went wrong.

Thanks and regards
Ananth.

Attachment: AD.JPG
Description: JPEG image

Other related posts: