Solved

SCCM query filename and OU

Posted on 2010-09-07
3
1,232 Views
Last Modified: 2013-11-21
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

0
Comment
Question by:EfrenM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
TarekIsmail earned 500 total points
ID: 33621993
Hi
this is the query you need to use:

SELECT v_R_System.Netbios_Name0, v_GS_SoftwareFile.FileName, v_GS_SoftwareFile.FileDescription, v_GS_SoftwareFile.FileVersion, v_GS_SoftwareFile.FileSize, v_GS_SoftwareFile.FileCount, v_GS_SoftwareFile.FilePath,v_RA_System_SystemOUName.System_OU_Name0
FROM   v_GS_SoftwareFile  join v_R_System
on  
v_R_System.ResourceID = v_GS_SoftwareFile.ResourceID
 inner JOIN v_RA_System_SystemOUName
on v_RA_System_SystemOUName.ResourceID = v_GS_SoftwareFile.ResourceID
where v_GS_SoftwareFile.FileName ='notepad.exe'
ORDER BY v_R_System.Netbios_Name0
0
 
LVL 6

Expert Comment

by:TarekIsmail
ID: 33622119
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
0
 
LVL 2

Author Closing Comment

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

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Update not working 12 234
NTP Servers 4 58
SYSVOL folder permission security best practice ? 14 141
Windows 10 ISO build version 3 95
After having deployed hundreds of thousands of Terminal Services seats worldwide, I still see all the time people asking me that same old question: "If TS/RDS is that reliable why are you telling me I should reboot it that often? My DC/SQL/Exchange/…
Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question