Set of Operational SCCM Collections

This script will create a set of 100 SCCM collections for your various needs. These collections can be used for operational tasks afterward.

 
 
 
 
 
4.8 Star
(64)
39,659 times
Add to favorites
System Center
1/13/2020
E-mail Twitter del.icio.us Digg Facebook
  • Errors / Collection entries not working.
    1 Posts | Last post March 28, 2017
    • Benoit,
      
      After a long process of commenting everything, and then manually trying each individual create collection step, the following do not work on SCCM 1511 console/site version of 5.00.8325.1000.
      
      
      New-CMDeviceCollection -Name $Collection11.Name -Comment “All physical servers” -LimitingCollectionName $Collection10.Name -RefreshSchedule $Schedule -RefreshType 2 | Out-Null
      Add-CMDeviceCollectionQueryMembershipRule -CollectionName $Collection11.Name -QueryExpression $Collection11.Query -RuleName $Collection11.Name
      Write-host *** Collection $Collection11.Name created ***
      
      This is the message.
      “Script has already been run or a collection name already exist. Delete All Operational collection before re-executing the script!”
      
      This occurs with just the default collections:
      
      All Systems
      All Unknown Computers
      All Desktop and Server Clients
      All Mobile Devices
  • PreProd and Exclude PreProd
    1 Posts | Last post March 07, 2017
    • Hello,
      
      It would be interesting to add 2 collections for process  of upgrade client.
      The "ADM - Exclude Upgrade Clients" collection and "ADM - PreProduction Clients" collection with exclusion of "ADM - Exclude Upgrade Clients".
      
      Bye
  • All clients not latest doesn't actually point at 1610
    1 Posts | Last post March 04, 2017
    • There's an all clients not latest that points to 1606.  It appears it never got the update.  Changing the name and updating the filter on the query makes it function as expected.
  • "Optimized script" with loop
    1 Posts | Last post February 20, 2017
    • Hey Benoit,
      
      thanks for your wonderful script, it's truly useful, however I modified it slightly so it's easier to add additional collections without having to do this at 3 different locations (initial confit, the actual creating and the moving to the folder).
      
      I created an array of collections and added the "properties" Comment and Foldername.
      Then I loop to the array to create the collection and move it directly to the foldername. This setup allows you just to add a new entry in the array and everything else will happen automatically. 
       
      As I can't add the script here (to long), feel free to reach out to me so I Can mail it to you and you can share if you want.
      You can reach me on : Tom.Degreef@CCSD.Be
  • Updating Operational Collections
    2 Posts | Last post February 03, 2017
    • I have been running v2.1 and want to update my Operational folder to include all the latest additions such as Server 2016 and v1607 etc.
      
      I can't seem to find a way to run this script and have it only add collections that don't already exist. I thought it was default behaviour but it seems to instantly give the error telling me to delete all operational collections and try again.
      
      I can't do that, as I have deployments on some of these collections. :(
    • You could remove the "Try/catch {}" statement to remove error handling. You'll get a bunch of error on already created collection but new ones will be created.
  • Two suggested fixes
    2 Posts | Last post February 03, 2017
    • 1. As pointed out by others, on line 121 you named the collection client 1606 but it should be client 1610.
      
      2. For client 2012R2 CU3 there are multiple versions. Changing the query to the following will catch them all: SMS_R_System.ClientVersion = '5.00.8239.1403' or SMS_R_System.ClientVersion = '5.00.8239.1406' or SMS_R_System.ClientVersion = '5.00.8239.1407'"
    • Good catch. Will be updated in 2.6.
  • Actually...
    1 Posts | Last post January 20, 2017
    • I should have said you can just use .% at the end of the query instead of .1%. But whatever, you get the idea.
  • Fixing Client Version Query for all "Client Version" collections
    1 Posts | Last post January 19, 2017
    • There are client versions with different minor versions that aren't accounted for in the script as it's written. I see that it has been addressed for a couple of client versions, but my recommendation would be to wildcard the last part of the minor version number for every client version collection with ".1%". For example: where SMS_R_System.ClientVersion like '5.00.8458.1%'
      
      I would do this for both R2 and Current Branch clients. This covers all of the possible patch level scenarios... This is a good reference for what I'm talking about with Current Branch https://buildnumbers.wordpress.com/sccm/
  • Allow Community Contributions?
    1 Posts | Last post January 19, 2017
    • What are your thoughts on moving this to GitHub to allow community contributions?
  • re-install is possible ?
    8 Posts | Last post December 21, 2016
    • Hi, I tried to install the first time and I got a message saying that it lacked "Cmdlet Library". I canceled the script and installed the cmdlet, but when I tried to run the script again I got this error: Script has already been run or a collection name already exist. Delete All Operational collection before re-executing the script!
      
      
      but there's no "all operational" collection in my "device collections", there is a solution for me to use it?
    • The script is looking for a "Operational" folder not a collection.
    • Phillip, Were you able to re-install this script ? I am getting the same error when I try to re-run the powershell command. I have made sure the operational folder is removed.
      thanks
      jared
      
    • There's a small typo on row 121, it says "Clients Version | 1606" but it should be "Clients Version | 1610". The 1606 already exists on row 106, and therefore it throws an error just before moving the collections to the "Operational" folder.
      
      Thanks for the script, fantastic collections in a minute!
    • Thanks coldKingdom, I was getting the same error, but overlooked that line.  
      
      Thanks Benoit, this script is very helpful.  Much appreciated!
    • I'm seeing this error too. I ran a previous version of the script, but I want to be able to create collections for the different versions of Windows 10. I fixed the typo on row 121, but I'm still getting the error "Script has already been run or a collection name already exist. Delete All Operational collection before re-executing the script !"
      
      
    • I give huge kudos to "Benoit Lecours" for writing this script, please what is the best way to reinstall after an upgrade. The script always gives this error even though I deleted the enter collection in the Operational folder including and recreated that folder only.
      See error
      Script has already been run or collection name already exist. Delete ALL Operational collection before re-executing the script!.
      
      The other alternative would be to adjust the script and target a new folder Operationa12(:( which i do not want to do)
      
      See some changes i did to the script
      Line 121 ...."Clients Version | 1610"
    • He creates the collections in "Device Collections" and then moves it to "Operational". Make sure you don't have any of the new collections under "Device Collections" before running the script again. When it fails, 99% are created, but not moved.
      
      To summarize: Remove all the new collections created by the script under "Device Collections" and the "Operational"-folder if it exists and then run the script again.
      
      Hope it works for you RobSheppard & iSegunB!
41 - 50 of 73 Items