SQL Report: Windows Service Pack Level by OS
Filed under:
Patch Management Solution
Reporting, Security
Submitted by MFINN on 4 September, 2008 - 16:14.
One of the problems with the canned compliance reports is the lack of easily isolated Service Pack information, so I created a report that allows you to select Windows 2000, XP, or Vista and then filter out the most recent SP for that OS.
- Create a new report
- Give your report a meaningful name
- Enter SQL directly
- Copy and paste this SQL into the text box
- Click finish (testing won't work here, because we need to create a few parameters first)
*Continued below*
SELECT T0.[Name] AS 'Name', T0.[Domain] AS 'Domain', T0.[Last Logon User] AS 'Last Logon User', T1.[OS Name] AS 'OS Name', T1.[Service Pack] AS 'Service Pack' FROM [Inv_AeX_OS_Operating_System] T1 RIGHT OUTER JOIN [Inv_AeX_AC_Identification] T0 ON T1.[_ResourceGuid] = T0.[_ResourceGuid] WHERE T1.[OS Name] LIKE %version% AND T1.[Service Pack] NOT LIKE %spchoice% ORDER BY T0.[Name] ASC
Create version parameter:
This will allow you to select which version of windows you want to query.
- Click the pencil icon to edit the report
- Click the "New Parameter" button
- For Name, type "version" (without the quotations)
- Select "Dropdown" from the dropdown menu
- Place a check in the "Prompt user for value..." box
- For User Prompt, type "Select Windows Version" (without the quotations)
- Make sure "List Type" is set to "Fixed List"
- Make sure "Value Type" is set to "String"
- For Value, Type "2000;%2000%|XP;%XP%|Vista;%Vista%" (without the quotations)
- Click "OK"
Create spchoice parameter:
This will allow you to select the most recent SP level and will filter those from your report
- Click the "New Parameter" button
- For Name, type "spchoice" (without the quotations)
- Select "Dropdown" from the dropdown menu
- Place a check in the "Prompt user for value..." box
- For User Prompt, type "Select Service Pack Level" (without the quotations)
- Make sure "List Type" is set to "Fixed List"
- Make sure "Value Type" is set to "String"
- For Value, Type "SP1;%1%|SP2;%2%|SP3;%3%|SP4;%4%" (without the quotations)
- Click "OK"
Now just click "Apply" and your report is ready for use.
(28 votes)
- Login or register to post comments
- 2215 reads
- Printer-friendly version















