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

  • From: rpo <rpo8373@xxxxxxxxx>
  • To: gptalk@xxxxxxxxxxxxx
  • Date: Sat, 15 Nov 2008 00:10:47 +1000

hi ananth,

this isn't really gpo related. and by not really, i mean...not at all.

nevertheless, replace the following line:

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

with:

GetObject("LDAP://CN=pm_anim_artists,cn=Users,DC=Tai3D,DC=com")

should do the trick i reckon. good luck.

daniel.


On 14/11/2008, Ananth Rajagopal <ananth.rg@xxxxxxxxx> wrote:
> 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.
>
>
***********************
You can unsubscribe from gptalk by sending email to 
gptalk-request@xxxxxxxxxxxxx with 'unsubscribe' in the Subject field OR by 
logging into the freelists.org Web interface. Archives for the list are 
available at http://www.freelists.org/archives/gptalk/
************************

Other related posts: