Title: [OT] Active Directory (again)

I am using the following SQL statement to query Active Directory, which I have no problems with..

******************************
SELECT          CAST(objectGUID AS uniqueidentifier) AS objectGUID, samAccountName
FROM                    OpenQuery( ADSI,
        'SELECT         objectGUID, samAccountName
        FROM            ''LDAP://phobos.tq.com.au/OU=NON-COMMERCIAL,DC=tq,DC=com,DC=au'' ')
UNION
SELECT          CAST(objectGUID AS uniqueidentifier) AS objectGUID, samAccountName
FROM                    OpenQuery( ADSI,
        'SELECT         objectGUID, samAccountName
        FROM            ''LDAP://phobos.tq.com.au/OU=COMMERCIAL,DC=tq,DC=com,DC=au'' ')
******************************

The question is, I have an OU called "commercial" located at
LDAP://mel-ret1.tq.com.au/OU=COMMERCIAL,DC=tq,DC=com,DC=au

This OU contains several other OU's and those contain other sub OU's, basically what I need is to be able to say "return every OU=USERS underneath LDAP://mel-ret1.tq.com.au/OU=COMMERCIAL,DC=tq,DC=com,DC=au"

Is that possible?

Cheers,
Taco

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to