SQL Command to Query System Center Configuration Manager

SQL Command to Query System Center Configuration Manager

Q: What SQL command can I use against the System Center Configuration Manager (SCCM) database to view all machines that require patches?

A: The SQL code below is based on the reports that are part of Configuration Manager, which will show machines that require patches.

 

select
b.Netbios_Name0 as Name,
case a.Status when 2 then 'Required' when 3 then 'Installed' end as Status,
c.ArticleID,
c.daterevised as ReleasedDate,
c.Title
from v_UpdateComplianceStatus as a, v_R_System as b, v_UpdateInfo as c
where
a.ResourceID = b.ResourceID and
a.CI_ID = c.CI_ID and
c.ArticleID is not null and
a.status = 2
order by b.Netbios_Name0

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish