powershell-intune-samples
powershell-intune-samples copied to clipboard
Adding DeviceConfigurtion/DeviceConfiguration_Copy.ps1 script.
Script to bulk copy (duplicate, clone) Intune online device configuration policies.
Script asks for 2 params
- match - regex to filter the current online policies by displayname
- replace - regex specifying how the displayname of the copied policy shall be changed
Shows the policies that match and would be copied. You are asked to proceed or abort before the (bulk) copying happens, so you can make sure your regexes work as intended.
Example
- match: -FOO-
- replace: -BAR-
- Takes all policies containing "-FOO-" in the displayname, creates copies with names where "-FOO-" is replaced by "-BAR-"
Example
- match: ^(My DCP)$
- replace: $1 Copy
- Takes the policy named "My DCP", creates a copy named "My DCP Copy"
Group assignment is not copied. No local files involved, just copies online to online.