The Red Hat Ecosystem Catalog is the official source for discovering and learning more about the Red Hat Ecosystem of both Red Hat and certified third-party products and services.
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

66Modules1Plugin
Ansible collection for managing Microsoft System Center Configuration Manager (MECM/SCCM/ConfigMgr)
This collection provides Ansible modules and plugins to manage Microsoft System Center Configuration Manager (MECM/SCCM/ConfigMgr) infrastructure through automation.
The microsoft.mecm collection provides a comprehensive set of Ansible modules
for automating Microsoft System Center Configuration Manager (MECM/SCCM/ConfigMgr)
environments on Windows. It is designed for IT administrators and infrastructure
engineers who need to manage MECM objects - such as applications, device collections,
software updates, maintenance windows, as well as managing client Software Center update installations - through repeatable, idempotent Ansible playbooks.
By leveraging this collection, teams can eliminate manual console-based workflows,
enforce consistent configuration across their MECM hierarchy, and integrate
Configuration Manager management into broader infrastructure-as-code pipelines.
>= 2.16.0>= 3.12pywinrm — required for WinRM connectivityBefore using this collection, you need to install it with the Ansible Galaxy command-line tool:
ansible-galaxy collection install ansible.microsoft.mecm
You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:
---
collections:
- name: ansible.microsoft.mecm
Note that if you install the collection from Ansible Galaxy, it will not be upgraded automatically when you upgrade the ansible package. To upgrade the collection to the latest available version, run the following command:
ansible-galaxy collection install ansible.microsoft.mecm --upgrade
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version 0.1.0:
ansible-galaxy collection install ansible.microsoft.mecm:==0.1.0
See using Ansible collections for more details.
The microsoft.mecm collection is designed to automate the most common day-to-day tasks
performed by MECM administrators — from managing device collections and scheduling maintenance
windows to deploying operating systems via task sequences.
The examples below represent real operational workflows that can be integrated
directly into your infrastructure-as-code pipelines.
Install all available security updates on SCCM-managed Windows clients and safely reboot if required.
- name: Patch Windows clients and reboot if needed
hosts: windows_servers
tasks:
- name: Install security updates
microsoft.mecm.install_updates:
categories:
- Security
wait_for_completion: true
timeout_minutes: 90
register: patch_result
- name: Reboot if required
ansible.windows.win_reboot:
reboot_timeout: 600
when: patch_result.reboot_required
Create and maintain device collections scoped by WQL query expressions, ensuring consistent group membership across the MECM hierarchy.
- name: Manage device collections
hosts: mecm_server
tasks:
- name: Create a collection of all production servers
microsoft.mecm.device_collection:
site_code: "ECO"
name: "Servers - Production"
limiting_collection_name: "All Systems"
refresh_type: Periodic
schedule_recur_interval: Days
schedule_recur_count: 1
schedule_start: "2026-01-01 06:00"
state: present
device_collection_query_rules:
- rule_name: "Production Servers"
query_expression: >
select * from SMS_R_System
where SMS_R_System.OperatingSystemNameandVersion like '%Server%'
Enforce recurring maintenance windows on collections to control when software updates and task sequences are permitted to run.
- name: Configure patching maintenance windows
hosts: mecm_server
tasks:
- name: Set nightly software-update window for Tier-1 servers
microsoft.mecm.maintenance_windows:
site_code: "ECO"
device_collection_name: "Servers - Tier 1"
name: "Nightly SU Window"
apply_to: SoftwareUpdatesOnly
sched_recur_type: Daily
sched_recur_count: 1
sched_duration_count: 4
sched_duration_interval: Hours
sched_start: "01/01/2026 02:00:00"
state: present
All modules in this collection are validated through automated integration tests that run against a live Microsoft MECM environment.
| Ansible Version | Python Version |
|---|---|
stable-2.16 | 3.12 |
stable-2.17 | 3.12 |
stable-2.18 | 3.12 |
stable-2.19 | 3.12 |
devel | 3.13 |
Each module has a dedicated integration test target under tests/integration/targets/.
All playbooks and module documentation are linted with ansible-lint v6.22.0.
install_updates module reports reboot_required but does not
trigger a reboot itself. Use ansible.windows.win_reboot in your playbook to handle reboots
safely after update installation.install_updates is called with wait_for_completion: false,
no installation results are returned. Verify completion through other means (e.g., re-running
with wait_for_completion: true or checking the MECM console).create_method: import, the module always
reports changed: true because MECM overwrites the task sequence on every import regardless
of whether the content has changed.device_collection module requires the
limiting_collection_name to already exist in MECM before the module runs.maintenance_windows module requires the target
device_collection_name to already exist; it will fail if the collection is absent.The content of this collection is made by people like you, a community of individuals collaborating on making the world better through developing automation software.
We are actively accepting new contributors and all types of contributions are very welcome.
Don't know how to start? Refer to the Ansible community guide!
Want to submit code changes? Take a look at the Quick-start development guide.
We also use the following guidelines:
As a Red Hat Ansible Certified Content, this collection is entitled to support through Ansible Automation Platform (AAP) through the Red Hat Ansible team.
If a support case cannot be opened with Red Hat or the collection has been obtained either from Galaxy or GitHub, you can open a GitHub issue on this repo but this has no guarantee of support or timeframes for a response.
See the changelog.
At the Microsoft MECM collection, our mission is to produce and maintain simple, flexible, and powerful open-source software tailored to Microsoft Configuration Manager automation and management.
We welcome members from all skill levels to participate actively in our open, inclusive, and vibrant community. Whether you are an expert or just beginning your journey with Ansible and Microsoft MECM, you are encouraged to contribute, share insights, and collaborate with fellow enthusiasts!
We follow the Ansible Code of Conduct in all our interactions within this project.
If you encounter abusive behavior, please refer to the policy violations section of the Code for information on how to raise a complaint.
microsoft and mecm tags.For more information about communication, see the Ansible communication guide.
The current maintainers are listed in the MAINTAINERS file. If you have questions or need help, feel free to mention them in the proposals.
To learn how to maintain/become a maintainer of this collection, refer to the Maintainer guidelines.
It is necessary for maintainers of this collection to be subscribed to:
Watch button -> All Activity in the upper right corner of the repository's homepage).They also should be subscribed to Ansible's The Bullhorn newsletter.
The process of decision making in this collection is based on discussing and finding consensus among participants. Every voice is important. If you have something on your mind, create an issue or dedicated discussion and let's discuss it!
GNU General Public License v3.0 or later.
See LICENSE to see the full text.
| Product |
|---|
| 2.7 |
This collection is self-contained and has no external Ansible dependencies.
This collection is not being used by other collections.