Link to home
Start Free TrialLog in
Avatar of EfrenM
EfrenMFlag for United States of America

asked on

SCCM query filename and OU

Hi All
need some help i cant get it working, i am using a existing report to track a file by its name it works fine but i need it to show the OU the computer is in. i tried but failed :( any suggestions?  below is the sql query
select SYS.Netbios_Name0, SF.FileName, SF.FileDescription, SF.FileVersion, SF.FileSize, SF.FileModifiedDate, SF.FilePath
From v_GS_SoftwareFile SF
join v_R_System SYS on SYS.ResourceID = SF.ResourceID
Where SF.FileName LIKE @variable
ORDER BY SYS.Netbios_Name0

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of TarekIsmail
TarekIsmail
Flag of Qatar image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi EfrenM,

two points you need to take care about them :

enable Active Directory System Group Discovery, to get your computer OU
computers located in Computers containers will not be listed in v_RA_System_SystemOUName view


Capture.PNG
Avatar of EfrenM

ASKER

works great, creates duplicates but thats easily fixed with trusty excel :) , thanks a mill spent all day trying to get it to work