All Projects → codaamok → PSCMContentMgmt

codaamok / PSCMContentMgmt

Licence: GPL-3.0 license
PowerShell module used for managing Microsoft Endpoint Manager Configuration Manager distribution point content.

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to PSCMContentMgmt

vcredist
Lifecycle management for the Microsoft Visual C++ Redistributables
Stars: ✭ 91 (+333.33%)
Mutual labels:  sccm, configmgr
Toolbox
Misc powershell scripts
Stars: ✭ 97 (+361.9%)
Mutual labels:  sccm, configmgr
NVRAppDevOps
Navertica DevOps scripts for managing Microsoft Dynamics 365 Business Central Apps
Stars: ✭ 26 (+23.81%)
Mutual labels:  powershell-module
ADLab
Custom PowerShell module to setup an Active Directory lab environment to practice penetration testing.
Stars: ✭ 143 (+580.95%)
Mutual labels:  powershell-module
PSSystemAdministrator
A PowerShell module for managing users and computers and gathering information in a Windows Active Directory environment.
Stars: ✭ 59 (+180.95%)
Mutual labels:  powershell-module
PowerGRR
PowerGRR is an API client library in PowerShell working on Windows, Linux and macOS for GRR automation and scripting.
Stars: ✭ 52 (+147.62%)
Mutual labels:  powershell-module
Octopus-Cmdlets
A suite of PowerShell cmdlets that enable you to simplify and automate your interactions with an Octopus Deploy server.
Stars: ✭ 40 (+90.48%)
Mutual labels:  powershell-module
Reg2CI
Create System Center Configuration manager ConfigItem (CI's) from a .reg (Registry) or a .pol (Policy) file.
Stars: ✭ 74 (+252.38%)
Mutual labels:  sccm
PowerShell-FeatureFlags
PowerShell module containing a Feature Flags implementation based on a local config file.
Stars: ✭ 15 (-28.57%)
Mutual labels:  powershell-module
OSD
OSD Shared Functions
Stars: ✭ 55 (+161.9%)
Mutual labels:  powershell-module
pwsh-prelude
PowerShell “standard” library for supercharging your productivity. Provides a powerful cross-platform scripting environment enabling efficient analysis and sustainable science in myriad contexts.
Stars: ✭ 26 (+23.81%)
Mutual labels:  powershell-module
TfsCmdlets
PowerShell Cmdlets for Azure DevOps and Team Foundation Server
Stars: ✭ 75 (+257.14%)
Mutual labels:  powershell-module
SCCM-Zone
My ♡ collection of PowerShell scripts and SCCM related stuff :)
Stars: ✭ 73 (+247.62%)
Mutual labels:  sccm
PoShLog
🔩 PoShLog is PowerShell cross-platform logging module. It allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog - https://serilog.net/
Stars: ✭ 108 (+414.29%)
Mutual labels:  powershell-module
PSBlackListChecker
Basic functionality of this module is ability to quickly verify if given IP address is on any of over 80 defined DNSBL lists. Below code will return results only if IP is on any of the lists. Advanced functionality of this module is ability to send reports to your email when things get bad on one of those 80 defined DNSBL listrs.
Stars: ✭ 50 (+138.1%)
Mutual labels:  powershell-module
myTickle
📅 A PowerShell and SQL Server-based reminder system
Stars: ✭ 20 (-4.76%)
Mutual labels:  powershell-module
DNSSuffix
A set of PowerShell tools for managing the computer's primary DNS suffix.
Stars: ✭ 19 (-9.52%)
Mutual labels:  powershell-module
image-customise
Customise a Windows 10/11 or Windows Server image at deployment time, including the default user profile, application packages and OS features
Stars: ✭ 44 (+109.52%)
Mutual labels:  configmgr
Powerexploit
Post-Exploitation 😎 module for Penetration Tester and Hackers.
Stars: ✭ 26 (+23.81%)
Mutual labels:  powershell-module
Invoke-Terraform
A cross-platform PowerShell module for downloading and invoking terraform binaries.
Stars: ✭ 14 (-33.33%)
Mutual labels:  powershell-module

PSCMContentMgmt

Branch Build status Last commit Latest release PowerShell Gallery GitHub
master GitHub Workflow Status (branch) GitHub last commit (branch) GitHub release (latest by date) GitHub Release Date PowerShell Gallery GitHub all releases

PowerShell module used for managing Microsoft Endpoint Manager Configuration Manager distribution point content.

Here are some of the things you can do with it:

  • Query content objects which are distributed to distribution point(s) or distribution point group(s)
  • Compare content objects distributed to distribution point(s) or distribution point group(s)
  • Find content objects in a "distribution failed" state for all or selective distribution points
  • Remove, distribute or redistribute content objects returned by any function to distribution point(s)
  • Find an object in your site by searching on any arbitrary ID (useful when reading logs and want to know what object an ID resolves to)
  • Migrate a distribution point’s content to a new/different distribution point by exporting its content library to prestaged .pkgx files and importing the .pkgx files to the new distribution point
  • Invoke the ContentLibraryCleanup.exe tool

PSCMContentMgmt is a mix of being no more than a wrapper for MEMCM cmdlets or native binaries. Some functions query WMI or invoke WMI methods.

PSCMContentMgmt does not intend to reinvent the wheel from already available cmdlets. Instead it provides a simpler workflow for managing your distribution points by offering:

  • Easy to use pipeline support, so you can easily progress through the motions for tasks such as querying content on a distribution point or distribution point group – perhaps in a particular state (e.g. "distribution failed") – and distributing, redistributing or removing it from another (or the same) distribution point or distribution point group.
  • Consistent property names when dealing with different types of content objects, i.e. the ObjectID property is always PackageID except for Applications/Deployment Types where it is CI_ID (same is true with the -ObjectID parameter for functions that offer it).
  • Functionality which the Configuration Manager module does not provide.

Functions

Requirements

Getting started

Install and import:

Install-Module PSCMContentMgmt -Scope CurrentUser
Import-Module PSCMContentMgmt

Each function will have two parameters to communicate to your environment with:

  • -SiteServer: the FQDN server address of your site server (SMS Provider)
  • -SiteCode: the site code of the environment

Using these parameters once for any function of PSCMContentMgmt enables you to not specify them again. These values are held in memory for as long as the PowerShell session exists.

In other words, if you used Get-DP and passed the parameters -SiteServer and -SiteCode, you do not need to specify them again in subsequent uses of Get-DP, and any other function of PSCMContentMgmt.

If the first function you use after importing PSCMContentMgmt requires -SiteServer and -SiteCode and you have not passed the parameters, you will be prompted for them.

If you want to change the values of -SiteServer or -SiteCode, pass those parameters again for any function and those new values will be used for subsequent calls.

This is intended to provide a fluid user experience where you need not to repeatedly specify these required parameters while using the module interactively. You will notice using Get-Help on any functions of PSCMContentMgmt will indicate these parameters are not mandatory. However the user experience will indicate otherwise. This design choice, which favours user experience, does sacrifice the discoverability of these parameter's mandatory requirement.

Where any of the functions return an object with the property ObjectID, or where a parameter is named -ObjectID, it will always be the PackageID for all content objects (Packages, Driver Packages, Boot Images etc) except for Applications/Deployment Types where it is CI_ID. This enables you to have a property ready to use for Applications with any of the cmdlets from the Configuration Manager module.

Examples

Get-Help "about_PSCMContentMgmt_ExportImport"

To learn more about how to migrate distribution point content using PSCMContentMgmt, please see my SysManSquad blog post or read the help topic Get-Help about_PSCMContentMgmt_ExportImport.


Get-DP -Name "SERVERA%", "SERVERB%" -Exclude "%CMG%"

Return distribution points which have a ServerName property starting with SERVERA or SERVERB, but excluding any that match CMG anywhere in its name.


Get-DP | Get-DPDistributionStatus -DistributionFailed | Group-Object -Property DistributionPoint

Return all distribution points, their associated failed distribution tasks and group the results by distribution point now for an overview.


Get-DP | Get-DPDistributionStatus -DistributionFailed | Start-DPContentRedistribution

Return all distribution points, their associated failed distribution tasks and initiate redistribution for them.


Get-DP -Name "London%" | Get-DPContent

Return all content objects found on distribution points where their ServerName starts with "London".

Note: the same is available for groups with Get-DPGroup and Get-DPGroupContent.


Compare-DPContent -Source "dp1.contoso.com" -Target "dp2.contoso.com"

Return objects which are on dp1.contoso.com but not on dp2.contoso.com.

Note: the same is available for groups with Compare-DPGroupContent.


Compare-DPContent -Source "dp1.contoso.com" -Target "dp2.contoso.com" | Start-DPContentDistribution -DistributionPoint "dp2.contoso.com"

Distribute the missing objects to dp2.contoso.com.

Note: the same is available for groups with Start-DPGroupContentDistribution.


Get-DPContent -DistributionPoint "dp1.contoso.com" -Package | Remove-DPContent

Remove all Packages from a distribution point.

Note: the same is available for groups with Get-DPGroupContent and Remove-DPGroupContent.


Invoke-DPContentLibraryCleanup -DistributionPoint "dp1.contoso.com" -Delete

Invoke the ContentLibraryCleanup.exe tool.


Find-CMObject -ID "ACC00048"

Finds any object which has the PackageID "ACC00048", this includes applications, collections, driver packages, boot images, OS images, OS upgrade images, task sequences and deployment packages.


Find-CMObject -ID "17007122"

Finds any object which has the CI_ID "17007122", this includes applications, deployment types, drivers, configuration items and configuration baselines.


Find-CMObject -ID "ScopeId_B3FF3CC4-0319-4434-9D24-77689C53C615/Application_197d8de7-022d-4c0b-aec4-c339ccc17ba4"

Finds an application which matches the ModelName "ScopeId_B3FF3CC4-0319-4434-9D24-77689C53C615/Application_197d8de7-022d-4c0b-aec4-c339ccc17ba4"

Known issues

  • The Configuration Manager module notoriously returns generic error messages (if any) for most of its cmdlets/functions. Since this module is mostly nothing more than a wrapper for most cmdlets/functions, I just forward those messages on to you so please bear that in mind.
  • Remove-DPContent and Remove-DPGroupContent only removes items that are fully distributed.
  • It is not possible to suppress the output of Export-DPContent (which is essentially just Publish-CMPrestageContent).
  • The functions given by this module are not the most performant method of dealing with distribution point content. Most of the Configuraion Manager cmdlet/functions accept arrays of IDs. Whereas I purposefully chose to call the cmdlets for each object purely for the benefit of giving success/failure results back to the user for each object.

Support

For help, be sure to use Get-Help to check out the About help pages or the comment based help in each of functions (which includes examples). Example commands below if you're unsure:

Get-Help "about_PSCMContentMgmt*"
Get-Help "Find-CMObject" -Detailed

Failing that:

  • If you think you're experiencing, or have found, a bug in PSCMContentMgmt, please open an issue.
  • Ping me on Twitter (@codaamok)
  • Come to the WinAdmins Discord and bug me there, my handle is @acc.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].