SQL Query to Get Maintenance Window for member of specific collection | SCCM | ConfigMgr

In Configuration Manager, a Maintenance Window allows client configuration changes at a specific time defined in the Maintenance Window. You can use Maintenance Window to define when Configuration Manager can deploy software updates, applications, or other configuration change tasks.

The below SQL query will provide the details of the Maintenance Window with the collection name for all members in the given collection. The SQL query can be executed from SQL Server Management Studio.

Remember to replace YourCollectionID in bold with the actual Collection ID.

select fcm.Name as 'Server Name',sw.CollectionID,col.Name as 'Collection Name',sw.Name as 'MW Name',sw.Description,sw.StartTime,sw.Duration,sw.IsEnabled from v_ServiceWindow SW

inner join v_FullCollectionMembership fcm on fcm.CollectionID = sw.Collection inner join v_Collection col on col.CollectionID = sw.CollectionID
where fcm.name in (select name from v_FullCollectionMembership where collectionID = 'YourCollectionID')

Related Posts:

Explore More SCCM Guides

Continue building your Microsoft Intune & SCCM skills with step-by-step tutorials covering device management, application deployment, automation, and troubleshooting.

  • Microsoft Intune Learning – Explore comprehensive guides on device enrollment, compliance policies, application deployment, Windows updates, and more.
  • SCCM (Configuration Manager) – Explore more SCCM guides covering device management, application deployment, software updates, troubleshooting, and automation.

Subscribe to Techuisitive Newsletter

Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.

Scroll to Top