{"id":900,"date":"2013-08-22T14:26:58","date_gmt":"2013-08-22T12:26:58","guid":{"rendered":"http:\/\/sccmfaq.wordpress.com\/?p=900"},"modified":"2013-08-22T14:26:58","modified_gmt":"2013-08-22T12:26:58","slug":"sccm-2012-show-next-effective-maintenance-window","status":"publish","type":"post","link":"https:\/\/blog.hosebei.ch\/?p=900","title":{"rendered":"SCCM 2012 &#8211; Show next effective Maintenance Window"},"content":{"rendered":"<p>Hey, here&#8217;s Martin again.<br \/>\nDid you ever wanted to know, what the effective next maintenance window for a specific Computer in System Center 2012 Configuration Manager is? There isn&#8217;t a built-in Report, that will give you the infomation you are looking for. And if you would like to calculate for yourself, have fun, when your maintenence window was starting a year ago&#8230;<!--more--><br \/>\nAfter a bit googling, a found this blog post, which describes the prcedure for SCCM 2007:<br \/>\nhttp:\/\/social.technet.microsoft.com\/wiki\/contents\/articles\/7870.sccm-2007-create-report-of-upcoming-maintenance-windows-by-client.aspx<\/p>\n<p>It will work, when you Change the following on the Report Query:<br \/>\n<code>;WITH AllServiceWindows AS (<\/p>\n<p>    -- All Service Windows for every resource and collection<\/p>\n<p>    SELECT fcm.ResourceID<\/p>\n<p>         , c.Name AS Collection<\/p>\n<p>         , nsw.Duration<\/p>\n<p>         , nsw.NextServiceWindow<\/p>\n<p>         , ROW_NUMBER() OVER (PARTITION BY  ResourceID ORDER  BY nsw.NextServiceWindow) AS RowNumber<\/p>\n<p>      FROM vSMS_ServiceWindow AS sw<\/p>\n<p>      JOIN v_FullCollectionMembership AS fcm<\/p>\n<p>        ON sw.SiteID = fcm.CollectionID<\/p>\n<p>      JOIN v_Collection AS c<\/p>\n<p>        ON sw.SiteID = c.CollectionID<\/p>\n<p>     CROSS<\/p>\n<p>     APPLY dbo.SCCM_GetNextServiceWindow(sw.Schedules, sw.RecurrenceType) AS  nsw<\/p>\n<p>)<\/p>\n<p>SELECT sys.Name0 AS [Computer Name]<\/p>\n<p>     , sys.Distinguished_Name0 AS  [AD DN]<\/p>\n<p>     , asw.Collection AS  [Collection]<\/p>\n<p>     , CONVERT(CHAR(5), DATEADD(MINUTE, asw.Duration, 0), 108) AS [Duration (HH:MM)]<\/p>\n<p>     , CONVERT(CHAR(16), asw.NextServiceWindow, 120) AS  [Next  Maintenance Window]<\/p>\n<p>     , DATENAME(WEEKDAY, asw.NextServiceWindow) AS  [Day  of Week]<\/p>\n<p>  FROM v_R_System as sys<\/p>\n<p>  LEFT<\/p>\n<p>  JOIN AllServiceWindows AS asw<\/p>\n<p>    ON sys.ResourceID = asw.ResourceID<\/p>\n<p> WHERE sys.Client0 = 1<\/p>\n<p>   AND asw.RowNumber = 1<\/p>\n<p> ORDER<\/p>\n<p>    BY asw.NextServiceWindow<\/p>\n<p>     , asw.Collection<\/p>\n<p>     , sys.Name0<\/code><br \/>\nYou have to Change the line &#8220;sys.description0 AS  [Description]&#8221; because description0 does not longer exist in SCCM 2012. I just choose to Show the distinguished Name of the Computer object.<\/p>\n<p>Hope this helps \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, here&#8217;s Martin again. Did you ever wanted to know, what the effective next maintenance window for a specific Computer in System Center 2012 Configuration Manager is? There isn&#8217;t a built-in Report, that will give you the infomation you are looking for. And if you would like to calculate for yourself, have fun, when your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=900"}],"version-history":[{"count":0,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/900\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}