A PowerShell module for Configuration Manager (SCCM/ConfigMgr) operations and client management tasks.
CMOperations provides commands for interacting with Configuration Manager clients and the SMS Provider. It includes functions for triggering client actions, querying scan history, managing maintenance windows, and more.
# Clone the repository
git clone https://github.com/JordanTheITGuy/CMOperations.git
# Import the module
Import-Module .\CMOperations\CMOperations.psd1- Windows PowerShell 4.0 or later
- Administrative access to target computers
- Configuration Manager client installed on target machines (for client operations)
- Access to SMS Provider (for provider operations)
| Function | Description |
|---|---|
Start-SoftwareUpdateScan |
Triggers SCCM software update scan on a remote computer |
Start-HardwareInventoryScan |
Triggers SCCM hardware inventory scan on a remote computer |
Get-LastHardwareScan |
Gets the last hardware inventory scan time |
Get-UpdatesInSoftwareCenter |
Lists updates available in Software Center |
Install-UpdatesInSoftwareCenter |
Installs updates from Software Center |
Get-NextAvailableMW |
Gets the next available maintenance window |
Get-LastSoftwareUpdateScan |
Gets last software update scan time and WSUS server |
Get-CMOCollectionPath |
Gets collection object path from SMS Provider |
# Without connectivity test
Start-SoftwareUpdateScan -ComputerName 'WORKSTATION01'
# With connectivity test (recommended)
Start-SoftwareUpdateScan -ComputerName 'WORKSTATION01' -ConnectionTest# Standard hardware inventory
Start-HardwareInventoryScan -ComputerName 'WORKSTATION01' -ConnectionTest
# Force a full hardware inventory reset
Start-HardwareInventoryScan -ComputerName 'WORKSTATION01' -ConnectionTest -ForceReset# Get last hardware scan time
Get-LastHardwareScan -ComputerName 'WORKSTATION01' -ConnectionTest
# Get last software update scan time and WSUS server
Get-LastSoftwareUpdateScan -ComputerName 'WORKSTATION01' -ConnectionTest# List available updates
Get-UpdatesInSoftwareCenter -ComputerName 'WORKSTATION01' -ConnectionTest
# Install all available updates
Install-UpdatesInSoftwareCenter -ComputerName 'WORKSTATION01' -AllUpdates -ConnectionTest
# Install specific updates by ArticleID
Install-UpdatesInSoftwareCenter -ComputerName 'WORKSTATION01' -ArticleID @('KB123456', 'KB789012')# Get next maintenance window of any type
Get-NextAvailableMW -ComputerName 'WORKSTATION01' -ConnectionTest
# Get next Software Updates maintenance window
Get-NextAvailableMW -ComputerName 'WORKSTATION01' -ConnectionTest -SoftwareMW
# Get next All Programs maintenance window
Get-NextAvailableMW -ComputerName 'WORKSTATION01' -ConnectionTest -AllProgramsMWGet-CMOCollectionPath -CollectionName 'All Systems' -SiteServerName 'SCCM01'CMOperations/
├── CMOperations.psd1 # Module manifest
├── CMOperations.psm1 # Module loader (dot-sources Public/ and Private/)
├── Public/ # Exported functions (one per file)
│ ├── Get-CMOCollectionPath.ps1
│ ├── Get-LastHardwareScan.ps1
│ ├── Get-LastSoftwareUpdateScan.ps1
│ ├── Get-NextAvailableMW.ps1
│ ├── Get-UpdatesInSoftwareCenter.ps1
│ ├── Install-UpdatesInSoftwareCenter.ps1
│ ├── Start-HardwareInventoryScan.ps1
│ └── Start-SoftwareUpdateScan.ps1
├── Private/ # Internal helper functions
│ ├── Get-ActionLastHardwareScan.ps1
│ ├── Get-ActionLastSoftwareUpdateScan.ps1
│ ├── Get-ActionNextAvailableMW.ps1
│ ├── Get-CMModule.ps1
│ ├── Start-ActionHardwareInventoryScan.ps1
│ ├── Start-ActionResetHardwareInventory.ps1
│ ├── Start-ActionSoftwareUpdateScan.ps1
│ ├── Start-CMOCollectionPath.ps1
│ ├── Test-AdminShare.ps1
│ ├── Test-ConfigMgrAvailable.ps1
│ ├── Test-Connectivity.ps1
│ ├── Test-Module.ps1
│ ├── Test-Ping.ps1
│ └── Test-WinRM.ps1
├── Tests/ # Pester tests
├── README.md
├── CONTRIBUTING.md
└── LICENSE
See CONTRIBUTING.md for guidelines on contributing to this project.
Jordan Benzing - @JordanTheItGuy
This project is licensed under the MIT License - see the LICENSE file for details.
- 1.1.0.0 - Refactored to modular structure (Public/Private folders)
- 1.0.0.8 - Added Get-CMOCollectionPath function
- 1.0.0.7 - Updated with additional helper functions
- 1.0.0.6 - Updated to use new coding standard