If the intention is to look at the "department" attribute of user
objects, then the following would do it:

dsquery user -limit 0 | dsget user -dept | sort -u

Sort.exe that I use is part of GNU utilities for Windows:
http://unxutils.sourceforge.net/


Guy


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jorge de
Almeida Pinto
Sent: Tuesday, May 24, 2005 3:53 PM
To: 'Krenceski, William '; '[EMAIL PROTECTED] ';
'[email protected] '
Subject: RE: [ActiveDir] Need AD Query Suggestion Please

How are the departments represented in AD? -> OUs, groups, something
else?

Cheers
#JORGE#

-----Original Message-----
From: [EMAIL PROTECTED]
To: [email protected]
Sent: 5/24/2005 2:39 PM
Subject: [ActiveDir] Need AD Query Suggestion Please

Hello,
 
I am looking for a query or script that will go out and query all
departments in active directory (the easy part) AND I want to suppress
duplicates as to get a list of unique departments. Not caring about
displaying the users or anything else with the query.
 
 

William Krenceski
Network Administrator 
Olean General Hospital 
515 Main Street 
Olean, NY 14760 
Tel: 716-375-6475 
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  


 
 

Confidentiality Notice: The information contained in this message may be
legally privileged and confidential information intended only for the
use of the individual or entity named above. If the reader of this
message is not the intended recipient, or the employee or agent
responsible to deliver it to the intended recipient, you are hereby
notified that any release, dissemination, distribution, or copying of
this communication is strictly prohibited. If you have received this
communication in error please notify the author immediately by replying
to this message and deleting the original message. Thank you.


This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied, disclosed to, retained or used by, any other party. If you are
not an intended recipient then please promptly delete this e-mail and
any attachment and all copies and inform the sender. Thank you.
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to