SCCMinfo

SCCM SQL Query – Part1

 

Here we are giving some SQL queries which can help to get common management required reports for ongoing jobs to be done, also it helps to get quick information on the report which is been looking for. These queries should work straight away by copying and pasting in SQL management studio and give output as mentioned for each query. There could be chances it may not work because changes in either SQL table or SQL Views. These queries also can be used as reference queries to build other queries for desired data reports.

 

SCCM SQL query Add Remove Programs? Or SCCM query Add Remove Programs display name and version? Or SCCM query for Add Remove Programs? Or SCCM query all software installed on all computers?

 

This query is going to give detailed information on software installed on client computers from Add Remove Program List. It would show Computer Name, Software Name, Username, Software Publisher, Software Name, Software Version.

 

 select sys.Netbios_Name0 , sys.User_Name0, arp.publisher0, arp.displayname0, arp.version0
 from v_R_System_Valid sys
 join v_gs_Add_Remove_programs arp on arp.ResourceID=sys.ResourceID 

 

SCCM SQL query for specific software installed?

 

This query is going to give detailed information on specific software’s installed on client computers from Add Remove Program List. It would show Computer Name, Software Name, Username, Software Publisher, Software Name, Software Version.

 

 select sys.Netbios_Name0 , sys.User_Name0, arp.publisher0, arp.displayname0, arp.version0
 from v_R_System_Valid sys
 join v_gs_Add_Remove_programs arp on arp.ResourceID=sys.ResourceID
 where (ARP.DisplayName0 like '%(App Name A)%' and ARP.DisplayName0 like '% App Name B%') 

 

SCCM SQL query software not installed?

 

This query is going to give detailed information on specific software not installed on client computers from Add Remove Program List. It would show Computer Name, Username, Software Publisher, Software Name, Software Version.

 

 select sys.Netbios_Name0 , sys.User_Name0, arp.publisher0, arp.displayname0, arp.version0
 from v_R_System_Valid sys
 join v_gs_Add_Remove_programs arp on arp.ResourceID=sys.ResourceID
 where (ARP.DisplayName0 Not like '%(App Name A)%' and ARP.DisplayName0 Not like '% App Name B%') 

 

SQL query to get serial number SCCM?

 

This query is going to get the serial number of computers with column Computer Name, Username, Serial Number.

 

 select sys.Netbios_Name0 , sys.User_Name0, bios.SerialNumber0
 from v_R_System_Valid sys
 join v_GS_PC_BIOS bios on bios.ResourceID=sys.ResourceID 

 

SCCM SQL query to find OS version?

 

This query is going to get the OS version of computers with column Computer Name, OS Name, OS Version, OS Install Date.

 

 select sys.Netbios_Name0, os.Caption0 as OS_Name, os.Version0 as OS_Version ,os.InstallDate0
 from v_GS_OPERATING_SYSTEM os
 join v_R_System sys on sys.ResourceID=os.ResourceID
 join v_R_System_Valid sysv on sysv.ResourceID=sys.ResourceID 

 

SCCM SQL query to find Chassis Type?

 

This query is going to get the Chassis Type of computers with column Computer Name, Chassis Type.

 

 select distinct sys.Netbios_Name0, CASE en.ChassisTypes0 WHEN 8  THEN'Laptop' WHEN 9  THEN'Laptop'  
 WHEN 10 THEN'Laptop' WhEN 11 THEN'Laptop' WHEN 12 THEN 'Laptop' WHEN 14 THEN 'Laptop' WHEN 
 18 THEN 'Laptop' WHEN 21 THEN 'Laptop' WHEN 3 THEN 'Desktop' WHEN 4 THEN 'Desktop' WHEN 5 
 THEN 'Desktop' WHEN 6 THEN 'Desktop' WHEN 7 THEN 'Desktop' WHEN 15 THEN 'Desktop' end as  
 'Types' 
 from v_R_System_Valid as sys
 join v_GS_SYSTEM_ENCLOSURE as en on en.ResourceID=sys.ResourceID 

 

SCCM SQL query collection members?

 

This query is going to get all members from specified collection ID with column Collection Name, Resource ID.

 

 select fscol.name, fscol.resourceid
 from v_cm_res_coll_(Collection ID) fscol 

 

Note: Replace “(Collection ID)” with collection ID

 

SCCM SQL query installed patches?

 

This query is going to get MS Update status with column Computer Name, Deployment Name, Collection ID, Assignment Name, Collection Name, Reboot Status, Username.

 

 select distinct sys.netbios_name0, cl.name, cm.collectionid, cs.AssignmentName, cs.CollectionName,  
 cst.LastEnforcementIsRebootSupressed, cst.UserID
 From v_r_system_valid sys
 join v_fullcollectionmembership cm on cm.resourceid=sys.resourceid
 join v_collection cl on cl.collectionid=cm.collectionid
 join v_CIAssignment cs on cs.CollectionID=cm.CollectionID
 join v_CIAssignmentStatus cst on cst.ResourceID=sys.ResourceID
 where cs.AssignmentName like '%Microsoft_Updates_%' 

 

SCCM SQL query for installed updates? And SCCM SQL query to find KB installed?

 

Here is another query to get the software installed details with column Computer Name, Bulletin ID, Article ID, Title Name, Patch Month, Status, Assignment Name.

 

 SELECT distinct SYS.Netbios_name0 , UI.BulletinID, UI.ArticleID, UI.Title,datename(year, UI.datecreated)+'-'+ datename (MONTH, UI.datecreated) as 'PatchMonth'  ,CASE when UCS.Status=2 then 'Required' WHEN UCS.Status=3 then 'Installed' when UCS.Status=0 then 'Unknown'  end as 'Status' ,UDS.AssignmentName
 FROM v_R_System_valid AS SYS
 LEFT OUTER JOIN v_Update_ComplianceStatusAll UCS ON SYS.ResourceID = UCS.ResourceID 
 Left outer JOIN v_UpdateInfo UI ON UCS.CI_ID = UI.CI_ID
 left outer join v_FullCollectionMembership CM on cm.ResourceID=sys.ResourceID 
 left outer join v_UpdateDeploymentSummary UDS on uds.CI_ID=ui.CI_ID
 left outer join v_Collection cl on cl.CollectionID=cm.CollectionID  

 

SCCM SQL query to find active clients

 

This query help to get information of client is active or Obsolete with column name Name, Obsolete, Active, Domain

 

 select name , IsObsolete, IsActive, Domain 
 from v_CM_RES_COLL_(Collection ID) 

Note: Replace “(Collection ID)” with collection ID

 

 

SCCM query all systems with specific software product name?

 

This query is going to give detailed information on particular software’s installed on client computers from Add Remove Program List. It would show Computer Name, Software Name, Username, Software Publisher, Software Name, Software Version.

 

 select sys.Netbios_Name0 , sys.User_Name0, arp.publisher0, arp.displayname0, arp.version0
 from v_R_System_Valid sys
 join v_gs_Add_Remove_programs arp on arp.ResourceID=sys.ResourceID
 where arp.displayname0 like ‘%Inte%’ 

 

Note: Replace “Inte” with wild characters of the product name looking for.

 

Find here the link for the SQL table and views.

 

Please share your inputs or if any help required in comment box.

SCCM Server Setup Wizard – List installation requirements

To save time, confusion and to have clarity, please consider below inputs and be ready with the information in handy for installing Configuration Manager Central Administration Site or Primary Site.

 

  1. Decide on Site to be selected, Central Administration Site or Primary Site
  2. Be ready with the license product key to be entered
  3. Be ready with setup downloaded file with Setup Downloader. With this you do not require to download at the time of Site installation, you can select previously downloaded files by giving path of those files.
  4. Server Language selection would be by default as English which cannot be changed.
  5. Client Language selection would be by default as English which cannot be changed.
  6. Be ready with the Site Code to be used. Each Site code must be unique.
  7. Be ready with the friendly and easily identifiable Site Name accordingly to the Site you would want to be known.
  8. Decide on folder path for the installation as it cannot be changed later.
  9. Be ready with SQL server FQDN (Fully Qualified Domain Name), Instance Name, Database Name, and SSB (by default it uses 4022) port.
  10. Be ready with the path for SQL server data file and the SQL server log files.
  11. In case if you decide to install SMS Provider to be remote server then be ready with FQDN of the same else by default it takes site server’s name. Additional SMS provider server can be configured later.
  12. Be ready with input to give for client communication to site server on HTTP or HTTPS, in case to go for HTTPS for secure communication client’s computer must have valid PKI certificate.
  13. Decide on which server to be act as Management Point and Distribution Point Site System, and then be ready with FQDN for the servers.
  14. Service Connection Point to be selected in case of installing CAS or stand-alone Primary Site, at the time of installing child Primary Site this can be skipped.

 

Note: This information is not for installing Secondary Site as it does not support installation using Setup Wizard or by command lines. Installation of Secondary Site happens with in Configuration Manager Console.

 

Please share feedback in comment box.

 

SCCM Prerequisites Checker to install Configuration Manager Site and Site systems

 

There is small utility available in the installation media named prereqchk.exe which help us to find out the readiness details on the site server or remote site server. Make sure to use this utility from the same version of configuration manager which would be used to install site. It identifies and fix the issues which may cause site installation to fail.

 

It is not mandatory to run this utility before site installation, as at the time of installation it runs by default, but it is best practice to run this before site installation to fix any issues avoid any roadblock.

 

Up on starting this utility it first checks for any site is already exist and if yes, then it checks for upgrade reediness. And if it does not find any site then it performs all required checks.

 

It records all the information in the log file name ConfigMgrPrereq.log under root drive.

 

There are some commands line option which can be used to perform the readiness according to the site or site systems role we are going to install.

 

Here we see some command line options with their purpose in brief:

 

/CAS

 

This verifies the local computer meets all requirement for installing Central Administration Site server.

 

/MP

 

This verifies the local computer meets all requirement installing site systems role of Management point.

 

/DP (FQDN of Computer)

 

This verifies the local computer meets all requirement installing site systems role of Distribution point.

 

/SQL (FQDN of Computer)

 

This verifies the local computer meets all requirement to install SQL to host site database.

 

/PRI

 

This verifies the local computer meets all requirement for installing Primary Site server.

 

/INSTALLSQLEXPRESS

 

This verifies the local computer meets all requirement for installing SQL Server Express.

 

Note: This application or utility can be found in Configuration Manager Installation Media\SMSSETUP\BIN\X64 or Configuration Manager Installation Path\BIN\X64  

 

Please share feedback on this topic in comment section.

Windows Server Roles and Features for SCCM Site Server and Site System

 

Before to start installation of any site server or site system’s role of Configuration Manager it is better to have below Windows server features and roles installed and enabled as it requires system restart.

Here are the information on basic feature and roles listed out in tabular format to understand better.

 

Require Windows Server features to be installed and enabled:

 

FeaturesSite Systems
.Net Framework
ASP.Net
HTTP Activation
Non-HTTP Activation
Windows Communication Foundation
Background Intelligent Transfer Services (BITS)Management Point
BranchCacheDistribution Point
Data DeduplicationDistribution Point
Remote Differnerials Compressions (RDC)Site Server or Distribution Point

 

Require Windows Server roles to be installed and enabled:

 

RolesSite Systems
Windows Deployment Services (WDS)PXE Point (For OS deployment)
Windows Server Update Services (WSUS)Software Update Point (For Software Update deployment)
Web Server IIS
Common HTTP Features
Application Development
Management Tools
Security
Distribution Point
Management Point
State Migration Point
Fallback Status Point
Software Update point

Please share feedback in comment section