Configuration Manager ships with a built-in report showing maintenance windows for a single computer. I have just done a few modifications to that report (added a few columns and removed the prompt).
SELECT TOP (100) PERCENT sw.Name AS [MW Name], sw.Description, sw.StartTime, sw.Duration AS ‘Duration Minutes’, sw.IsEnabled AS ‘MW Enabled’,
dbo.v_R_System.Name0, dbo.v_R_System.Operating_System_Name_and0
FROM dbo.v_ServiceWindow AS sw INNER JOIN
dbo.v_FullCollectionMembership AS fcm ON sw.CollectionID = fcm.CollectionID INNER JOIN dbo.v_R_System ON fcm.ResourceID = dbo.v_R_System.ResourceID
WHERE (dbo.v_R_System.Operating_System_Name_and0 LIKE ‘%server%’)
ORDER BY [MW Name], dbo.v_R_System.Name0
Too bad the script is not usable for those that do not know how to format SQL queries….
Kent – I get an “incorrect syntax near .” when I try to execute this script while in Report Builder. Any idea where the error is?
I had to re-type the single quotes ” ‘ “. Here is my code directly from SQL Management Studio.
SELECT TOP (100) PERCENT sw.Name AS [MW Name], sw.Description, sw.StartTime, sw.Duration AS ‘Duration Minutes’, sw.IsEnabled AS ‘MW Enabled’, dbo.v_R_System.Name0, dbo.v_R_System.Operating_System_Name_and0
FROM dbo.v_ServiceWindow AS sw
INNER JOIN dbo.v_FullCollectionMembership AS fcm ON sw.CollectionID = fcm.CollectionID
INNER JOIN dbo.v_R_System ON fcm.ResourceID = dbo.v_R_System.ResourceID
WHERE (dbo.v_R_System.Operating_System_Name_and0 LIKE ‘%server%’)
ORDER BY [MW Name], dbo.v_R_System.Name0