cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Illuminator7532
Engaged Sweeper
I would like to do a query of computers that are in a certain OU, how do I do this ?

Thanks in advance !
13 REPLIES 13
Illuminator7532
Engaged Sweeper
Thanks ! That works a lot better, although the column LastknowIP doesn't exist in the table tbclComputers. Now I'm trying to get information of the model of the computers, how do I this ? I've tried to add the tblComputersystem at SELECT, but then it gives me an error. Any Ideas ?
Hemoco
Lansweeper Alumni
SELECT     dbo.tblComputers.Computername, dbo.tblComputers.Domain, dbo.tblComputers.LastknownIP, dbo.tblADComputers.OU, 
dbo.tblADComputers.Lastchanged
FROM dbo.tblADComputers INNER JOIN
dbo.tblComputers ON dbo.tblADComputers.Computername = dbo.tblComputers.Computername
WHERE (dbo.tblADComputers.OU = 'ou you want')
Illuminator7532
Engaged Sweeper
Thank you for your quick reply, however, I'm not an SQL guru. Do you have a sample query I can use ?

Thank you !
Hemoco
Lansweeper Alumni
You need to link the tables "tblcomputer" and "tblADcomputers"
use the OU field in tbladcomputers.