Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMOperations

A PowerShell module for Configuration Manager (SCCM/ConfigMgr) operations and client management tasks.

Overview

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.

Installation

# Clone the repository
git clone https://github.com/JordanTheITGuy/CMOperations.git

# Import the module
Import-Module .\CMOperations\CMOperations.psd1

Requirements

  • 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)

Public Functions

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

Usage Examples

Trigger a Software Update Scan

# Without connectivity test
Start-SoftwareUpdateScan -ComputerName 'WORKSTATION01'

# With connectivity test (recommended)
Start-SoftwareUpdateScan -ComputerName 'WORKSTATION01' -ConnectionTest

Trigger a Hardware Inventory Scan

# Standard hardware inventory
Start-HardwareInventoryScan -ComputerName 'WORKSTATION01' -ConnectionTest

# Force a full hardware inventory reset
Start-HardwareInventoryScan -ComputerName 'WORKSTATION01' -ConnectionTest -ForceReset

Get Last Scan Information

# Get last hardware scan time
Get-LastHardwareScan -ComputerName 'WORKSTATION01' -ConnectionTest

# Get last software update scan time and WSUS server
Get-LastSoftwareUpdateScan -ComputerName 'WORKSTATION01' -ConnectionTest

Manage Software Updates

# 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 Maintenance Windows

# 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 -AllProgramsMW

Query Collection Path

Get-CMOCollectionPath -CollectionName 'All Systems' -SiteServerName 'SCCM01'

Module Structure

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

Contributing

See CONTRIBUTING.md for guidelines on contributing to this project.

Author

Jordan Benzing - @JordanTheItGuy

License

This project is licensed under the MIT License - see the LICENSE file for details.

Version History

  • 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

About

CMOperations Powershell Module. This will be used for live updates to the CMOperations PSModule. Final commits will be published to Technet.

Resources

Contributing

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages