Skip to main content

Hello,

I have deployed and create some (personal) worklets on one zone, and I am searching a way to easily duplicate them to anoter zone we have on our account.

I see it’s possible for policy, but I don’t find the same “clone” function for worklet.

 

Maybe there is another way to allow worklets to be applied on several zones ?

 

Thanks in advance

 

Hi @Mika T ,

 

While you can clone Patch policies across zones natively within the Console today, unfortunately you cannot do the same for worklets.  You can however leverage our API to perform this action!

Here is an example of a Powershell script that utilizes the Automox API to clone ALL policies (worklets and patch polcies included!) from one target zone to another.
https://gist.github.com/Ax-jguarracino/2abbb50a943e89a6f584c76b897d6a2c

Note, this script would not be run as a worklet, but instead ran locally in Powershell on your device.

If you wanted to adapt the code to just perform “Worklet cloning”, you could add a Where-Object to the $response return and filter on where policy_type_nameis equal to “Custom”.


I hope that helps get you started!

Let me know if you have any questions.


Hi @JohnG-Automox 

Thanks. This powershell script is great.

Is there a further option on script that may be able to clone only a specified list of worklet ID ? (instead of all).

Many thanks.


Reply