Share via

Maintenance window query

liven stool 85 Reputation points
2023-12-23T10:23:44.7833333+00:00

I need a query to get all the maintenance window, I need the collection name, collection ID, MW name, schedule, duration, apply to(All deployments, Software updates, Task Sequences) .

Anyone can help me?

Microsoft Security | Intune | Configuration Manager | Other

Answer accepted by question author

AllenLiu-MSFT 49,441 Reputation points Microsoft External Staff
2023-12-25T02:47:45.77+00:00

Hi, @liven stool

Thank you for posting in Microsoft Q&A forum.

Check this query:

select c.Name as CollectionName,c.CollectionID,sw.Name as SWName,sw.Description as schedule,sw.Duration,

case

when sw.ServiceWindowType=1 then 'All deployments'

when sw.ServiceWindowType=4 then 'Software updates'

when sw.ServiceWindowType=5 then 'Task sequences'

end as 'Apply to'

from v_ServiceWindow sw

join v_collection c on c.collectionid=sw.CollectionID


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Sherry Kissinger 5,626 Reputation points
    2023-12-23T22:27:00.2433333+00:00

    Select c.Name, sw.*

    from v_ServiceWindow sw

    join v_collection c on c.collectionid=sw.CollectionID

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.