Solved

SCCM query filename and OU

Posted on 2010-09-07
3
1,229 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Every system administrator encounters once in while in a problem where the solution seems to be a needle in haystack.  My needle was an anti-virus version causing problems with my Exchange server. I have an HP DL350 with Windows Server 2008 Stand…
Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

756 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