Tag: SCCM

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’

SCCM 2012 Table has multiple records for Server IP

For full details see http://social.technet.microsoft.com/Forums/en-US/configmanagergeneral/thread/43686ca9-3064-4533-8f94-f28c889b4511/   HS view are for History data, not current data. RA views are discovery data views. vSMS are “extra” views.. I don’t generally use them.   It is generally better to limit the use of NOT LIKE statements Here is the clean up SELECT R.ResourceID AS ‘ResourceID’, R.Netbios_Name0 AS ‘Name’, […]

PC by Gateway

  select CS.Name0, CS.UserName0, NA.Description0, NAC.IPAddress0, NAC.MACAddress0, NAC.DefaultIPGateway0 From dbo.v_GS_COMPUTER_SYSTEM CS join dbo.v_GS_NETWORK_ADAPTER_CONFIGUR NAC on NAC.ResourceID = CS.ResourceID join dbo.v_GS_NETWORK_ADAPTER NA on NA.ResourceID = CS.ResourceID and NAC.ServiceName0 = NA.ServiceName0 Where NAC.DefaultIPGateway0 = ‘192.168.1.1’ or NAC.DefaultIPGateway0 = ‘192.168.5.1’

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: […]

IE7 Collection

For full detail please see forum post   select * from SMS_R_System left join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId left join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.ProdID = “ie7” or SMS_G_System_ADD_REMOVE_PROGRAMS_64.ProdID = “ie7”

Four reports to answer questions within the reporting forums

So I have been running with my head cut of these days but I always like to make sure that the Reporting forum questions are answer… http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/threads   For more detail about each of the post see: http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/377b785d-254b-48b9-adfa-b93869a6b599 http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/2dc7d374-fb7b-461d-b123-8b59d68667dc http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/f1b05190-d69b-4f2f-a7c9-166b966892ba http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/d2d4fe26-2dad-4ee6-8fb2-ccb7cb6acc23     Anyways, since I have been behind on things, I thought that I […]

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