Tag: CM07

PC Serial Number by OU.

For full details, please see http://www.myitforum.com/forums/Active-Directory-Discovery-additional-Attributes-and-broken-reports-and-queries-m238462.aspx select distinct R.ResourceID, R.Name0, R.Client0, BIOS.SerialNumber0 from dbo.v_R_System AS R LEFT OUTER JOIN dbo.v_RA_System_SystemOUName AS OU ON R.ResourceID = OU.ResourceID INNER JOIN dbo.v_GS_PC_BIOS AS BIOS ON R.ResourceID = Bios.ResourceID where OU.System_OU_Name0 = N’GARTEK.TST/DOMAIN CONTROLLERS’

How to Add Blank Columns to a report.

For full details please see: http://www.myitforum.com/forums/SCCM-Report-question-m238232.aspx SELECT DISTINCT CS.Name0 as ‘PC’, ” as ‘Blank column1’, BIOS.SerialNumber0 as ‘SN #’, CS.Manufacturer0 as ‘Manufacturer’, CS.Model0 as ‘Model’, ” as ‘Blank column2’, OS.Caption0 as ‘OS’, OS.CSDVersion0 as ‘Service Pack’, SCUM.TopConsoleUser0 as ‘Top User’, R.User_Name0 AS ‘Last Logged (Heartbeat)’, CS.UserName0 AS ‘Last Logged (HW Inv.)’, BIOS.ReleaseDate0 as ‘Bios Date’, […]

Last Logon User

For full details see: http://www.windows-noob.com/forums/index.php?/topic/7022-last-logged-user/   Select R.Netbios_Name0, R.User_Domain0 + ‘\’ + R.User_Name0, CS.UserName0 from dbo.v_R_System R join dbo.v_GS_COMPUTER_SYSTEM CS on R.ResourceID = CS.ResourceID join dbo.v_FullCollectionMembership FCM on R.ResourceID = FCM.ResourceID Where FCM.CollectionID = ‘SMS00001’

Software by OU

SELECT ARP.DisplayName0, Count(*) AS ‘Count’, ARP.Publisher0, ARP.Version0 FROM dbo.v_Add_Remove_Programs ARP join dbo.v_RA_System_SystemOUName OU on OU.ResourceID = ARP.ResourceID WHERE OU.System_OU_Name0 = @OU GROUP BY ARP.DisplayName0, ARP.Publisher0, ARP.Version0 ORDER BY ARP.Publisher0, ARP.Version0

List of PC by Excel versions

For full detail see forum post. http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/66b71887-acc7-40ac-8634-536784fa5adf SELECT DISTINCT R.Name0 AS ‘Machine Name’, left(SF.FileVersion,2) FROM dbo.v_R_System R INNER JOIN dbo.v_GS_SoftwareFile SF ON R.ResourceID = SF.ResourceID Join dbo.v_GS_SYSTEM S ON R.ResourceID = S.ResourceID WHERE S.SystemRole0 = ‘Workstation’ AND SF.FileName = ‘excel.exe’ AND SF.FilePath LIKE ‘C:\Program Files%’ ORDER BY R.Name0 .csharpcode, .csharpcode pre { font-size: small; color: […]

Count of Manufacturers

For full details see: http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/4e4019b0-a28e-4637-ae8c-4ff523d11c1a select top 3 Manufacturer0, Count(*) from dbo.v_GS_COMPUTER_SYSTEM GROUP BY Manufacturer0 Order by 2 desc

How to find an application installed in the last 7 days

For full details see http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/38f96191-6e3e-4150-8f3a-18b1c4db8d7d SELECT R.Netbios_name0, R.AD_Site_Name0, ARP.DisplayName0, ARP.InstallDate0, DATEDIFF(Day, CONVERT(Datetime,ARP.InstallDate0), GETDATE()) AS [days since installed] FROM dbo.v_R_System R join dbo.v_FullCollectionMembership FCM on FCM.ResourceID = R.ResourceID join dbo.v_ADD_REMOVE_PROGRAMS ARP on ARP.ResourceID = R.ResourceID WHERE (ISDATE(ARP.InstallDate0) =1) AND ARP.DisplayName0 = ‘Enhanced Web Reporting’ AND FCM.CollectionID = ‘SMS00001’ and Datediff(dd,ARP.InstallDate0,getdate()) < 7

Finding Adobe X for both x68 and x64

For full details see http://social.technet.microsoft.com/Forums/en-US/configmgrgeneral/thread/66c80e66-9760-49b3-b429-08bf2ca8f572 http://social.technet.microsoft.com/Forums/en-US/configmanagerapps/thread/b68ce42c-98f5-4500-bced-0e8e901cb211/ select distinct 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 SMS_R_SYSTEM.ResourceID not in (select SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID from SMS_G_System_ADD_REMOVE_PROGRAMS where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like “Adobe Reader X%” ) and SMS_R_SYSTEM.ResourceID not in (select SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceID from SMS_G_System_ADD_REMOVE_PROGRAMS_64 where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like “Adobe Reader X%”)

Query on user history

For full details please see http://www.myitforum.com/Forums/tm.aspx?m=230539&high= SELECT DISTINCT R.Netbios_Name0, tu.SystemConsoleUser0, tu.logontime FROM dbo.v_R_System R join ( SELECT husr.ResourceID, Husr.SystemConsoleUser0, max(Husr.LastConsoleUse0) as logontime FROM dbo.v_HS_SYSTEM_CONSOLE_USER Husr WHERE Husr.SystemConsoleUser0 LIKE ‘Gartek\’ + @variable Group by husr.ResourceID, Husr.SystemConsoleUser0 ) tu on tu.resourceID = R.resourceID WHERE tu.SystemConsoleUser0 LIKE ‘Gartek\’ + @variable ORDER BY R.Netbios_Name0

Find Programs Removed from a PC (updated)

For full details see: http://social.technet.microsoft.com/Forums/en-US/configmgrgeneral/thread/db96da44-a9e0-4996-bca2-286b6e2c473a SELECT DISTINCT CS.Name0, HARP.Publisher0 AS ‘Publisher’, HARP.ProdID0 AS ‘Product’, HARP.DisplayName0 AS ‘Name’ FROM dbo.v_GS_COMPUTER_SYSTEM CS join dbo.v_GS_ADD_REMOVE_PROGRAMS ARP on ARP.ResourceID = CS.ResourceID join dbo.v_HS_ADD_REMOVE_PROGRAMS HARP on HARP.ResourceID = ARP.ResourceID WHERE ARP.DisplayName0<>HARP.DisplayName0 AND HARP.Publisher0 Is Not Null union SELECT DISTINCT CS.Name0, HARP.Publisher0 AS ‘Publisher’, HARP.ProdID0 AS ‘Product’, HARP.DisplayName0 AS ‘Name’ FROM […]