This is a module that takes a target application name, creates standardized collections, and deploys the target application to those collections.
The org standards being implemented are documented here: https://uofi.atlassian.net/wiki/spaces/engritprivate/pages/36185162/MECM+-+Org+shared+collections+and+deployments?src=search.
This is not official MECM terminology, but we call these "deployment collections" because the collection's sole purpose is to be the single point of deployment for a given app, and any collections which should receive this deployment should simply be added as an include rule in the collection's membership rules. As described on the wiki page above, this prevents the same application from being redundantly deployed to many scattered collections.
For creating ad-hoc collections with a standardized evaluation schedule, but without any deployments special naming rules, see: https://github.com/engrit-illinois/New-CMOrgModelCollection.
Note: this module is currently written specifically for use in the College of Engineering of the University of Illinois. It's published mostly for reference and requires refactoring for use in other organizations.
- By default, the module creates nothing; you must specify one or more of the following switch parameters to create the relevant collection(s)/deployment(s).
-Available: Creates an Available collection with theInstallaction.-Required: Creates a Required collection with theInstallaction.-Uninstall: Creates a Required collection with theUninstallaction.
- All collections will be created with a standard membership evaluation schedule of 1am daily.
- All deployments will be configured to respect supersedence, if the app package has supersedence configured. If it doesn't, then you will see a benign warning that supersedence conditions were not met.
- Supersedence is preferred. If you must deploy without supersedence, please do so manually.
- By default, the created collections will have a limiting collection of
UIUC-ENGR-All Systems, unless the-ISOnlyswitch parameter is specified. - Created collections will have a standard name format of
UIUC-ENGR-Deploy <app> (<purpose>), unless the-ISOnlyswitch parameter is specified. - By default, created collections will show up in the root of
\Assets and Compliance\Overview\Device Collections.- Specifying the
-MoveCollectionsToFolderswitch and-CollectionsFolderparameter will automatically move (all) the created collections to the specified folder. - For org-level collections, the appropriate folder is
\DeviceCollection\UIUC-ENGR\.Org shared collections\Deployments. - For IS collections, the appropriate folder is
\DeviceCollection\UIUC-ENGR\Instructional\Deployment Collections\Software\Installs.
- Specifying the
- Note: The target app must be distributed to your distribution point before running this module to create collections. If it's not, the collections will be created, but the deployments to those collections will not. If this happens, simply delete the newly-created collections, distribute the app, and run the module again.
- Only supports PowerShell 5.1.
- Download
New-CMOrgModelDeploymentCollection.psm1to the appropriate subdirectory of your PowerShell modules directory. - Make sure to distribute the app to your DPs/DP group first.
- Run it, e.g.:
New-CMOrgModelDeploymentCollection -App "Slack - Latest" -Available - Take note of the output logged to the console.
Required string.
The exact name of the application package for which to create collections and which to deploy to those collections.
Supports Tab-Completion, though it can take a while depending on your MECM environment.
Recommend the following workflow:
Prep-MECM- Start typing your partial desired result.
- Tab.
- Ctrl-Space to display the full list.
- Navigate the list with arrow keys and select your desired application.
Optional switch.
If specified, the module will create a new Application Group deployment, rather than a deployment for just an Application.
Optional switch.
If specified, the behavior will change per the following:
- The created collections will have a name format of
UIUC-ENGR-IS Deploy <app> (<purpose>)instead ofUIUC-ENGR-Deploy <app> (<purpose>). - The created collections will have a limiting collection of
UIUC-ENGR-Instructional, instead ofUIUC-ENGR-All Systems.
Optional switch.
If specified, an "Available" deployment/collection with the "Install" action will be created.
Collection will be named like UIUC-ENGR-IS Deploy <app> (Available).
Optional switch.
If specified, a "Required" deployment/collection with the "Install" action will be created.
Collection will be named like UIUC-ENGR-IS Deploy <app> (Required).
Optional switch.
If specified, a "Required" collection/deployment with the "Uninstall" action will be created.
Collection will be named like UIUC-ENGR-IS Uninstall <app> (Required).
Optional switch.
By default deployments are created with automatic update supersedence enabled (if the application has a supersedence relationship configured).
If specified, deployments will be created without automatic update supersedence enabled, regardless.
Our org guidelines are generally to always enable automatic update supersedence on deployments if it's available on the application (see wiki link above). So only use this if you have a specific reason to disable supersedence, such as the application being interactive, or older versions not uninstalling cleanly, etc.
Optional switch.
If specified, the created deployment will have the Install Behavior setting enabled, which will automatically stop the process specified on the "Install Behavior" tab of the given application deployment.
Only valid for Required deployments.
Optional string.
If specified, (all of) the created collections will be moved to the folder specified, after their deployment has been created.
The specified value should look something like \DeviceCollection\UIUC-ENGR\.Org shared collections\Deployments\....
The actual folder path which gets used is based on the specified path value as well as the value of -SiteCode, e.g. MP0:\DeviceCollection\UIUC-ENGR\etc....
Optional switch.
If specified, (all of) the created collections will be moved to the folder specified by -ISCollectionsFolder, after their deployment has been created.
Has no effect if -MoveCollectionsToFolder is specified.
Optional string.
The folder to which created collections will be moved, if -MoveCollectionsToISFolder is specified.
Default is \DeviceCollection\UIUC-ENGR\Instructional\Deployment Collections\Software\Installs.
Optional string.
Specifies the prefix which the script assumes that all collections and apps have.
Default value is UIUC-ENGR-.
Script behavior is undefined if your unit's collections/deployments do not use a consistent prefix.
This prefix methodology is probably somewhat unique to the mutli-tenant design of the UofI MECM infrastructure.
Optional integer.
The number of seconds to wait after creating a collection to deploy the app to that collection.
Default is 30.
If you are getting errors with deployments, try raising this value. It's possible MECM is being slow and not recognizing that the newly created collection exists before the script tries to deploy to it.
Optional switch.
When specified the module will attempt to run regardless of the current version of PowerShell.
Normally, the module refuses to run if the current version of PowerShell is greater than 5.1.
Optional string. Recommend leaving default.
The site code of the MECM site to connect to.
Default is MP0.
Optional string. Recommend leaving default.
The SMS provider machine name.
Default is sccmcas.ad.uillinois.edu.
Optional string. Recommend leaving default.
The path to the ConfigurationManager Powershell module installed on the local machine (as part of the admin console).
Default is $($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1.
- By mseng3. See my other projects here: https://github.com/mmseng/code-compendium.