I need a report broken down by WSUS group membership then by Computer stating which updates are approved but not installed.
The report needs to be executable from a scheduling system and deliverable via email to recipients.
OS - Windows 2008R2, WSUS 3.0 SP2, Active Directory - Native Mode, Computers configured by GPO and configured to add themselves to pre-existing WSUS groups automatically based on GPO. There is one unique configuration GPO per Active Directory group. WSUS groups
were created by importing Active Directory groups with a PowerShell command.
No recent configuration changes, functionaility does not exist in current product.
I've investigated the WinDB SUSDB Public Views and constructed a join statement to retrieve the relevant fields. Then investigated installing the MSSQL Studio Express and using the sqlcmd command. And using the Windows Task Sceduler with an Xpath query to email a report on completion of a task that runs an sqlcmd query on a schedule.
The following is a first pass at the procedure:
sqlcmd -d SUSDB -i report.sql -o report.txt
SET NOCOUNT ON
SET ANSI_WARNINGS OFF
SELECT
vCTG.Name AS Target_Group,
vCT.Name AS Computer,
vU.CreationDate AS [Microsoft_Released],
vUA.CreationDate AS [WSUS_Approved],
vUA.AdministratorName AS [Approved_By],
vU.KnowledgebaseArticle AS [KB_Article],
fSM.Name AS State,
vU.SecurityBulletin AS [Security_Bulletin],
vU.MsrcSeverity AS [Severity_Rating],
vU.DefaultTitle AS Description
FROM
PUBLIC_VIEWS.vUpdateApproval AS vUA
INNER JOIN
PUBLIC_VIEWS.vUpdate AS vU ON vU.UpdateId = vUA.UpdateId
INNER JOIN
PUBLIC_VIEWS.vUpdateInstallationInfoBasic AS vUII ON vUII.UpdateId = vUA.UpdateId AND vUII.State = 2
INNER JOIN
PUBLIC_VIEWS.fnUpdateInstallationStateMap() AS fSM ON vUII.State = fSM.Id
INNER JOIN
PUBLIC_VIEWS.vComputerTargetGroup AS vCTG ON vUA.ComputerTargetGroupId = vCTG.ComputerTargetGroupId
INNER JOIN
PUBLIC_VIEWS.vComputerTarget AS vCT ON vUII.ComputerTargetId = vCT.ComputerTargetId
WHERE
(vCTG.Name = N'TargetGroup Servers')
ORDER BY Computer, [Microsoft_Released], [WSUS_Approved]
The Xpath command for using the Windows Task Scheduler to email the report was trivial.
I would appreciate commentary on whether the assumptions made when constructing the query are valid. And whether there is a simpler or more efficient way of extracting the information.
Thank you for your time.