Monday, September 29, 2014

Where do Start Menu\All Programs shortcuts reside on Windows 7 ?


To create a shortcut on Desktop for All users and Start menu /All programs...

Most of us work on this and remember these by hear but its handy when forget... 

For Global / All users Start Menu is located at:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs

All users / Default Desktop is located at:

C:\Users\Public\Desktop

NB:These folders are hidden so make sure to check show hidden file from folder option.

Wednesday, September 17, 2014

SCCM 2012 - Query based collection for Specific app installed per collection


Query based collection for Specific app installed in a collection. This helps if you need to deploy updated version of application and upgrade existing one...

select 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 inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Name of Application"

SCCM 2012 - Software Registered in add and remove programs excluding software updates

If you need the list of apps installed in add remove program and not the installed updates. This Query will be helpful.


Select A.DisplayName0 as 'Name of Software Installed',A.InstallDate0 as 'Date of Install', A.Version0 as 'Version Number',A.Publisher0 as 'Publisher Name'
FROM v_GS_ADD_REMOVE_PROGRAMS A, v_GS_COMPUTER_SYSTEM B
WHERE A.ResourceID = B.ResourceID
AND A.DisplayName0 NOT Like 'Update for Microsoft%'
AND A.DisplayName0 NOT LIKE 'Hotfix for %'
AND A.DisplayName0 NOT LIKE 'Security Update for %'
AND A.DisplayName0 NOT LIKE 'Update for Microsoft %'
AND A.DisplayName0 NOT LIKE 'Update for Office %'
AND A.DisplayName0 NOT LIKE 'Update for Outlook %'
AND A.DisplayName0 NOT LIKE 'Update for Windows %'
AND A.DisplayName0 NOT LIKE 'Windows XP Hotfix%'
AND Name0 = @computer
GROUP BY A.DisplayName0,A.Version0, A.Publisher0,A.InstallDate0
ORDER BY A.DisplayName0

CM 12 - Summary of Computer specific details(Hardware) with IP Address and Subnet

Custom Query for Hardware details with IP Address and Subnet. Please type your collection name to view the reports.


SELECT DISTINCT
                      TOP (100) PERCENT dbo.v_R_System_Valid.Netbios_Name0 AS [Computer Name],
                      dbo.v_R_System_Valid.Resource_Domain_OR_Workgr0 AS [Domain/Workgroup], dbo.v_Site.SiteName AS [SMS Site Name],
                      CASE WHEN (v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 IS NULL OR
                      v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 = '-1')
                      THEN 'Unknown' ELSE v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 END AS [Top Console User],
                      dbo.v_GS_OPERATING_SYSTEM.Caption0 AS [Operating System], dbo.v_GS_OPERATING_SYSTEM.CSDVersion0 AS [Service Pack Level],
                      dbo.v_GS_SYSTEM_ENCLOSURE_UNIQUE.SerialNumber0 AS [Serial Number],
                      dbo.v_GS_SYSTEM_ENCLOSURE_UNIQUE.SMBIOSAssetTag0 AS [Asset Tag], dbo.v_GS_COMPUTER_SYSTEM.Manufacturer0 AS Manufacturer,
                      dbo.v_GS_COMPUTER_SYSTEM.Model0 AS Model, dbo.v_GS_X86_PC_MEMORY.TotalPhysicalMemory0 AS [Memory (KBytes)],
                      dbo.v_GS_PROCESSOR.NormSpeed0 AS [Processor (GHz)],
                          (SELECT     SUM(dbo.v_GS_LOGICAL_DISK.Size0) AS Expr1
                            FROM          dbo.v_GS_LOGICAL_DISK INNER JOIN
                                                   dbo.v_FullCollectionMembership ON dbo.v_FullCollectionMembership.ResourceID = dbo.v_GS_LOGICAL_DISK.ResourceID
                            WHERE      (dbo.v_GS_LOGICAL_DISK.ResourceID = dbo.v_R_System_Valid.ResourceID) AND
                                                   (dbo.v_FullCollectionMembership.CollectionID = @CollectionID)) AS [Disk Space (MB)],
                          (SELECT     SUM(v_GS_LOGICAL_DISK_2.FreeSpace0) AS Expr1
                            FROM          dbo.v_GS_LOGICAL_DISK AS v_GS_LOGICAL_DISK_2 INNER JOIN
                                                   dbo.v_FullCollectionMembership AS v_FullCollectionMembership_2 ON
                                                   v_FullCollectionMembership_2.ResourceID = v_GS_LOGICAL_DISK_2.ResourceID
                            WHERE      (v_GS_LOGICAL_DISK_2.ResourceID = dbo.v_R_System_Valid.ResourceID) AND
                                                   (v_FullCollectionMembership_2.CollectionID = @CollectionID)) AS [Free Disk Space (MB)],
                      dbo.v_RA_System_IPAddresses.IP_Addresses0, dbo.v_RA_System_IPSubnets.IP_Subnets0
FROM         dbo.v_R_System_Valid INNER JOIN
                      dbo.v_GS_OPERATING_SYSTEM ON dbo.v_GS_OPERATING_SYSTEM.ResourceID = dbo.v_R_System_Valid.ResourceID LEFT OUTER JOIN
                      dbo.v_GS_SYSTEM_ENCLOSURE_UNIQUE ON
                      dbo.v_GS_SYSTEM_ENCLOSURE_UNIQUE.ResourceID = dbo.v_R_System_Valid.ResourceID INNER JOIN
                      dbo.v_GS_COMPUTER_SYSTEM ON dbo.v_GS_COMPUTER_SYSTEM.ResourceID = dbo.v_R_System_Valid.ResourceID INNER JOIN
                      dbo.v_GS_X86_PC_MEMORY ON dbo.v_GS_X86_PC_MEMORY.ResourceID = dbo.v_R_System_Valid.ResourceID INNER JOIN
                      dbo.v_GS_PROCESSOR ON dbo.v_GS_PROCESSOR.ResourceID = dbo.v_R_System_Valid.ResourceID INNER JOIN
                      dbo.v_FullCollectionMembership AS v_FullCollectionMembership_1 ON
                      v_FullCollectionMembership_1.ResourceID = dbo.v_R_System_Valid.ResourceID LEFT OUTER JOIN
                      dbo.v_Site ON v_FullCollectionMembership_1.SiteCode = dbo.v_Site.SiteCode INNER JOIN
                      dbo.v_GS_LOGICAL_DISK AS v_GS_LOGICAL_DISK_1 ON v_GS_LOGICAL_DISK_1.ResourceID = dbo.v_R_System_Valid.ResourceID AND
                      v_GS_LOGICAL_DISK_1.DeviceID0 = SUBSTRING(dbo.v_GS_OPERATING_SYSTEM.WindowsDirectory0, 1, 2) INNER JOIN
                      dbo.v_RA_System_IPSubnets ON dbo.v_R_System_Valid.ResourceID = dbo.v_RA_System_IPSubnets.ResourceID INNER JOIN
                      dbo.v_RA_System_IPAddresses ON dbo.v_R_System_Valid.ResourceID = dbo.v_RA_System_IPAddresses.ResourceID LEFT OUTER JOIN
                      dbo.v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP ON
                      dbo.v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.ResourceID = dbo.v_R_System_Valid.ResourceID