Simple script to backup device/user collections list from SCCM
Question
Hi All,
I am looking for simple script or steps to schedule in SCCM server to backup device/user collections lists.
Appreciate if anyone share the script or steps. Thank You.
solved
0
Configuration Manager
3 weeks
2021-02-12T09:19:37+05:30
2021-02-12T09:19:37+05:30 0 Answers
13 views
Beginner 0
Answers ( 2 )
Maybe on late side, but you should start DevOps’ing (Device) Collections or at least start using:
https://github.com/prae1809/PowerShell-Scripts/tree/master/OperationalCollections”
And to answer your question: Use this to backup/dump all your device collections:
Export-CMCollection -Name * -ExportFilePath “c:\temp\ExportedCollections.mof” –Verbose –ForceWildcardHandling #-WhatIf
I think the best way to use something like this using wmi
$CMCollection = ([WMIClass]”\\LDCM01\root\sms\site_P35:SMS_Collection”).CreateInstance()
More details https://devblogs.microsoft.com/scripting/use-wmi-and-powershell-to-create-collection-query-rules/