Page 1 of 1 1
Topic Options
#91395 - 2003-02-07 02:34 PM List groups in particular OU
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
This may be easier than I think...But I have yet to find it on the board anywhere. Is there a way to enumerate all groups in a particular OU? I can list all groups and then use TranslateName to sort out by OU using Instr function. But Im suspecting this takes much longer than if I could just list all groups in one OU. Any help would be appreciated.
Top
#91396 - 2003-02-07 03:09 PM Re: List groups in particular OU
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If you bind to the OU [GetObject (DN for OU)] you then can enumerate the groups, computers, users, and other OUs in the container.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#91397 - 2003-02-07 03:17 PM Re: List groups in particular OU
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Currently using...

$domainobj = GetObject("WinNT://DOMAIN")

What would the syntax be for specifying certain OU?

$domainobj = GetObject("WinNT://DOMAIN/IS/Printers")

Does not seem to work.

Top
#91398 - 2003-02-07 03:25 PM Re: List groups in particular OU
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
$obj= GetObject("LDAP://@domain/" + OU=OUname, dc=domain, dc=com)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#91399 - 2003-02-07 03:26 PM Re: List groups in particular OU
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You can use Translate name to get the DN from a computer or user in that OU. then just remove the computer or user.

[ 07. February 2003, 15:26: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#91400 - 2003-02-07 04:07 PM Re: List groups in particular OU
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Finally got it work...Have to put the OUs in reverse..Starting from bottom of tree and work out to root.

GetObject("LDAP://server/OU=Printers,OU=Citrix,OU=IS,dc=domain,dc=com")

and not

GetObject("LDAP://server/OU=IS,OU=Citrix,OU=Printers,dc=domain,dc=com")

Thanks for all the help Howard!

[ 07. February 2003, 16:08: Message edited by: CitrixMan ]

Top
#91401 - 2003-02-07 04:10 PM Re: List groups in particular OU
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
All distinguished names go from specific to general (child to parent). Please use TranslateName on some users or computers to retrieve the DN's of some objects to see the format.

Glad to be of service.

[ 07. February 2003, 16:11: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

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 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.194 seconds in which 0.167 seconds were spent on a total of 12 queries. Zlib compression enabled.

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