Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL AD Object/OU question

Status
Not open for further replies.
Nov 29, 2005
7
US
Hey all. This should be a simple solution for some sql master out there.

Say my domain is 'Domain.com'. Within there is a 'Workstations' OU where client computer objects are created. Under 'Workstations' is an OU called 'Locations'. When running a query from within the 'Collections' tab of the Admin console that looks like this -->
---
SELECT
SMS_R_System.ResourceID,
SMS_R_System.ResourceType,
SMS_R_System.Name,
SMS_R_System.SMSUniqueIdentifier,
SMS_R_System.ResourceDomainORWorkgroup,
SMS_R_System.Client
FROM SMS_R_System
WHERE SystemOUName = "DOMAIN.COM/WORKSTATIONS"
---
I get all the objects located in 'Workstations' AND 'Locations'. I was wondering what mods to the query are required to return only objects in the 'Workstations' OU and not the OU's contained within as well?

-SMS03sp1
-sql2ksp3
(I do also understand that the query can not be directly run or tested from query analyzer or the like.)

Thanks You for feeding me some additional knowledge!!
-mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top