Tuesday, April 4, 2017

SCCM Machine name with OS and bit value report



SQL Query:

SELECT        dbo.v_GS_SYSTEM.Name0, dbo.v_GS_SYSTEM.SystemType0, dbo.v_GS_OPERATING_SYSTEM.Caption0
FROM            dbo.v_GS_SYSTEM INNER JOIN

                         dbo.v_GS_OPERATING_SYSTEM ON dbo.v_GS_SYSTEM.ResourceID = dbo.v_GS_OPERATING_SYSTEM.ResourceID

Friday, March 10, 2017

SCCM application displayname report with AD site and user name


Query:


SELECT     TOP (100) PERCENT dbo.v_R_System.Netbios_Name0, dbo.v_R_System.AD_Site_Name0, dbo.v_R_System.User_Name0, dbo.v_R_System.Operating_System_Name_and0, 
                      dbo.v_Add_Remove_Programs.DisplayName0, dbo.v_Add_Remove_Programs.InstallDate0, dbo.v_Add_Remove_Programs.Publisher0, dbo.v_Add_Remove_Programs.Version0
FROM         dbo.v_Add_Remove_Programs INNER JOIN
                      dbo.v_R_System ON dbo.v_Add_Remove_Programs.ResourceID = dbo.v_R_System.ResourceID
WHERE     (dbo.v_Add_Remove_Programs.DisplayName0 LIKE '%topspro%')
ORDER BY dbo.v_R_System.Netbios_Name0 

Thursday, March 9, 2017

SCCM Internet Explorer detection method



Registry method:

HKLM\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer

svcVersion

begins with 11 or 10 or 9 or 8 (for diff versions of IE)

OR

HKLM\SOFTWARE\Microsoft\Internet Explorer

svcVersion

begins with 11 or 10 or 9 or 8 (for diff versions of IE)

Detection method will work post reboot

SCCM Adobe Flashplayer detection method



install_flash_player_24_active_x.msi:

HKLM\SOFTWARE\Macromedia\FlashPlayerActiveX
Version
24.0.0.194

install_flash_player_24_plugin.msi

HKLM\SOFTWARE\Macromedia\FlashPlayerPlugin
Verison
24.0.0.194

install_flash_player_24_ppapi.msi

HKLM\SOFTWARE\Macromedia\FlashPlayerPepper
Version
24.0.0.194

SCCM Identify package ID installed with user rights or system rights report


Package ID value with 1 --> Run mode - Run with user rights--> User context installation
Package ID value with 0--> Run mode - Run with administrative rights - system context installation


Query:


DECLARE @ProgramFlags TABLE (
   BitFlag INT PRIMARY KEY,
   Meaning VARCHAR(128),
   Description VARCHAR(512)
)
INSERT INTO @ProgramFlags
VALUES
   (2,'USECUSTOMPROGRESSMSG','The task sequence shows a custom progress user interface message.'),
   (16,'DEFAULT_PROGRAM','This is a default program.'),
   (32,'DISABLEMOMALERTONRUNNING','Disables MOM alerts while the program runs.'),
   (64,'MOMALERTONFAIL','Generates MOM alert if the program fails.'),
   (128,'RUN_DEPENDANT_ALWAYS','If set, this program”s immediate dependent should always be run.'),
   (256,'WINDOWS_CE','Indicates a device program.  If set, the program is not offered to desktop clients.'),
   (1024,'COUNTDOWN','The countdown dialog is not displayed.'),
   (4096,'DISABLED','The program is disabled.'),
   (8192,'UNATTENDED','The program requires no user interaction.'),
   (16384,'USERCONTEXT','The program can only run when a user is logged on.'),
   (32768,'ADMINRIGHTS','The program must be run as the local Administrator account.'),
   (65536,'EVERYUSER','The program must be run by every user for whom it is valid. Valid only for mandatory jobs.'),
   (131072,'NOUSERLOGGEDIN','The program is only run when no user is logged on.'),
   (262144,'OKTOQUIT','The program will restart the computer'),
   (524288,'OKTOREBOOT','Configuration Manager restarts the computer when the program has finished running successfully.'),
   (1048576,'USEUNCPATH','Use a UNC path (no drive letter to access)'),
   (2097152,'PERSISTCONNECTION','Persists the connection to the drive specified in the DriveLetter property.  The USEUNCPATH bit flag must not be set.'),
   (4194304,'RUNMINIMIZED','Run the program as a minimized window.'),
   (8388608,'RUNMAXIMIZED','Run the program as a maximized window.'),
   (16777216,'HIDEWINDOW','Hide the program window.'),
   (33554432,'OKTOLOGOFF','Logoff user when program completes successfully.'),
   (134217728,'ANY_PLATFORM','Override check for platform support.'),
   (536870912,'SUPPORT_UNINSTALL','Run uninstall from the registry key when the advertisement expires.');
WITH cte AS (
   SELECT
      f.BitFlag,
      f.Meaning,
      (f.BitFlag & p.ProgramFlags)/f.BitFlag AS [Enabled],
      p.PackageID,
      p.ProgramName
   FROM
      dbo.v_Program p
      CROSS JOIN @ProgramFlags f
)  
SELECT
   PackageID,
   ProgramName,
   MAX(CASE BitFlag WHEN 2 THEN [Enabled] END) AS [USECUSTOMPROGRESSMSG],
   MAX(CASE BitFlag WHEN 16 THEN [Enabled] END) AS [DEFAULT_PROGRAM],
   MAX(CASE BitFlag WHEN 32 THEN [Enabled] END) AS [DISABLEMOMALERTONRUNNING],
   MAX(CASE BitFlag WHEN 64 THEN [Enabled] END) AS [MOMALERTONFAIL],
   MAX(CASE BitFlag WHEN 128 THEN [Enabled] END) AS [RUN_DEPENDANT_ALWAYS],
   MAX(CASE BitFlag WHEN 256 THEN [Enabled] END) AS [WINDOWS_CE],
   MAX(CASE BitFlag WHEN 1024 THEN [Enabled] END) AS [COUNTDOWN],
   MAX(CASE BitFlag WHEN 4096 THEN [Enabled] END) AS [DISABLED],
   MAX(CASE BitFlag WHEN 8192 THEN [Enabled] END) AS [UNATTENDED],
   MAX(CASE BitFlag WHEN 16384 THEN [Enabled] END) AS [USERCONTEXT],
   MAX(CASE BitFlag WHEN 32768 THEN [Enabled] END) AS [ADMINRIGHTS],
   MAX(CASE BitFlag WHEN 65536 THEN [Enabled] END) AS [EVERYUSER],
   MAX(CASE BitFlag WHEN 131072 THEN [Enabled] END) AS [NOUSERLOGGEDIN],
   MAX(CASE BitFlag WHEN 262144 THEN [Enabled] END) AS [OKTOQUIT],
   MAX(CASE BitFlag WHEN 524288 THEN [Enabled] END) AS [OKTOREBOOT],
   MAX(CASE BitFlag WHEN 1048576 THEN [Enabled] END) AS [USEUNCPATH],
   MAX(CASE BitFlag WHEN 2097152 THEN [Enabled] END) AS [PERSISTCONNECTION],
   MAX(CASE BitFlag WHEN 4194304 THEN [Enabled] END) AS [RUNMINIMIZED],
   MAX(CASE BitFlag WHEN 8388608 THEN [Enabled] END) AS [RUNMAXIMIZED],
   MAX(CASE BitFlag WHEN 16777216 THEN [Enabled] END) AS [HIDEWINDOW],
   MAX(CASE BitFlag WHEN 33554432 THEN [Enabled] END) AS [OKTOLOGOFF],
   MAX(CASE BitFlag WHEN 134217728 THEN [Enabled] END) AS [ANY_PLATFORM],
   MAX(CASE BitFlag WHEN 536870912 THEN [Enabled] END) AS [SUPPORT_UNINSTALL]
FROM
   cte
GROUP BY
   PackageID,

   ProgramName

SCCM count of particular applications report

Query:

select
    DisplayName0,
    Version0,
    Count (Distinct arp.ResourceID)
From
    dbo.v_Add_Remove_Programs ARP
Where
    DisplayName0 Like ('%A%') or
    DisplayName0 Like ('%B%') or
    DisplayName0 Like ('%C%')

Group by
    DisplayName0,
    Version0
Order by
    DisplayName0,
    Version0

SCCM applications displayname report with install source location and username




Query:


SELECT        dbo.v_GS_SYSTEM.Name0 AS [Machine Name], dbo.v_R_System.User_Name0 AS UserName, dbo.v_GS_SYSTEM.SystemType0 AS [Proceesor Type], dbo.v_R_System.AD_Site_Name0 AS [AD Site Name],
                         dbo.v_R_System.Operating_System_Name_and0 AS [Operating System], dbo.v_GS_INSTALLED_SOFTWARE.Publisher0 AS Manufacture,
                         dbo.v_GS_INSTALLED_SOFTWARE.ARPDisplayName0 AS [ARP Application Name], dbo.v_GS_INSTALLED_SOFTWARE.ProductName0 AS [Application Name],
                         dbo.v_GS_INSTALLED_SOFTWARE.ProductVersion0 AS [Software Version], dbo.v_GS_INSTALLED_SOFTWARE.InstallDate0 AS InstallDate, dbo.v_GS_INSTALLED_SOFTWARE.InstallSource0 AS [Install Source],
                         dbo.v_GS_INSTALLED_SOFTWARE.InstalledLocation0 AS [Installed Location]
FROM            dbo.v_GS_INSTALLED_SOFTWARE INNER JOIN
                         dbo.v_R_System ON dbo.v_GS_INSTALLED_SOFTWARE.ResourceID = dbo.v_R_System.ResourceID INNER JOIN
                         dbo.v_GS_SYSTEM ON dbo.v_R_System.ResourceID = dbo.v_GS_SYSTEM.ResourceID
WHERE        (dbo.v_GS_INSTALLED_SOFTWARE.ARPDisplayName0 LIKE '%autocad%')

order by dbo.v_GS_INSTALLED_SOFTWARE.InstallDate0 desc