Set of Operational SCCM Collections

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

 
 
 
 
 
4.8 Star
(62)
26,431 times
Add to favorites
System Center
8/27/2018
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Over Complicated
    1 Posts | Last post October 30, 2018
    • This used to be such a useful script, I wish you would offer download links to the old reliable versions.
      
      Firstly, the get site code lines fail, we have multiple site codes. you are better off just prompting for the site code, this makes it much more flexible.
      
      Secondly, there are no logs being created - this is extremely poor, there are no excuses for no logs.
      
      Thirdly as many have pointed out, if they are already using the previous collections as includes/excludes/limiting collections, they can just delete them and recreate them can they? Not having the option to skip deleting them makes this script valueless to many people who used to use it.
      
      Finally, the on screen errors are utterly pointless, what am I supposed to do with these? How can a typical user begin to look into the problem without contacting you for assistance, because you have suppressed any useful message from PowerShell...
      
      Please Benoit, if this script is to be of value to a wide community, can you architect it to from a higher level view so its of use to the many and not the few?
      
      
      There was an error creating the: Clients Version | Not Latest (1806) collection.
      -----------------
      -----------------
      There was an error moving the: Clients Version | Not Latest (1806) collection to EMEA.
      -----------------
      -----------------
      There was an error creating the: Hardware Inventory | Clients Not Reporting since 14 Days collection.
      -----------------
      -----------------
      There was an error moving the: Hardware Inventory | Clients Not Reporting since 14 Days collection to EMEA.
      -----------------
      -----------------
      There was an error creating the: System Health | Clients Active collection.
      -----------------
      -----------------
      There was an error moving the: System Health | Clients Active collection to EMEA.
      -----------------
      -----------------
      There was an error creating the: System Health | Clients Inactive collection.
      -----------------
      -----------------
      
  • Query Windows Server 2019
    1 Posts | Last post October 15, 2018
    • Hi 
      Do you have a query script for Windows Server 2019, 10.0.17763.1
      I haven't got it works,
      
      ------------------------------------------
      Thanks in advance 
      Sokoban
  • I cannot delete old collections
    1 Posts | Last post October 11, 2018
    • I also need the script to just skip already created collections and only to create those that do not exist. I have used these collections for different deployments and also limiting and removing devices from another collections.
  • No more deleting collections please
    1 Posts | Last post July 09, 2018
    • Agreeing with Bhushan and Krayzie Se7en.  Please add in a function that skips already created collections. We are really grateful for the work you've done and use these collections as limits for other collections etc.
  • Can you move this to something like more collaborative?
    1 Posts | Last post July 02, 2018
    • I'm suggesting this be moved to github?  it would make it easier for folks to add some adjustments.
  • Can you please add an if function
    1 Posts | Last post May 28, 2018
    • Can you please add an if function like below so we won't have to delete and recreate these collections all over again ? (Delete and recreate causes to change the collection ID which later causes dependent collection to fail at times. Hence the request.) 
      
      
      if ((Get-CMCollection -Name $Collection1.Name).count -eq 1) {
      
      Write-host *** Collection $Collection1.Name already exists ***
      
      }
      
      else 
      {
      New-CMDeviceCollection -Name $Collection1.Name -Comment "All devices detected by SCCM" -LimitingCollectionName $LimitingCollection -RefreshSchedule $Schedule -RefreshType 2 | Out-Null
      Add-CMDeviceCollectionQueryMembershipRule -CollectionName $Collection1.Name -QueryExpression $Collection1.Query -RuleName $Collection1.Name
      Write-host *** Collection $Collection1.Name created ***
      }
      
      for each collection and then remove the if ($error -eq 1) part with warning to delete the existing collections. 
      
      Basically we are really grateful of the work you've done and use these collections as limits for other collections etc. and when you update the script, this may help us add only the new ones instead of recreating all of them.  
      
      Hope you'd like the idea.
      
      Thanks 
      Bhushan
      
  • Script has already been run or a collection name already exist
    1 Posts | Last post April 11, 2018
    • Same as KacCouilard, how can we get around this?
      
      I even deleted all collections with | in the name, no joy.
  • Prompt to delete All Operational collection
    2 Posts | Last post March 29, 2018
    • Hi Benoit, 
      I last used your script very successful in July of 2017.  Today when I run 2.10.ps1
      I get a prompt to delete All Operational collection, pressing enter to continue quits the script and no new collections are installed.  I thought your script would continue past same names? 
      "Script has already been run or a collection name already exist.  Delete All Operational collection before re-executing the script!  Press enter to continue..." 
      What to do? Thank you. 
    • Working on a new version to handle that. For now, just delete the previously created collection manually and re-run the script.
  • Wrong version in query for Clients Version | 1802
    2 Posts | Last post March 29, 2018
    • $Collection77 = @{Name = "Clients Version | 1802"; Query = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.ClientVersion = '5.00.8634.1700'"}
      
      According to: https://buildnumbers.wordpress.com/sccm/
      
      Client version is: 5.00.8634.1007 for 1802, and not: 5.00.8634.1700 which is the console version.
      
    • Typo... fixed ! Thank you
  • Suggestion
    2 Posts | Last post March 27, 2018
    • Hello Mr. Lecours,
      
      I really like your script, so i wanted to provide you with some feedback. For the device collection "Client Version|1710" i would update the query to 
      
      select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.ClientVersion like "5.00.8577.1%" 
      
      instead of using "5.00.8577.100%" 
      
      then you will get the all clients for version 1710 even after the hotfix is applied.
      
      Otherwise thank you for saving me a whole bunch of time
      
      
    • Fixed in 2.10. Thank you
1 - 10 of 60 Items