I added to the Tom's code the calls to the GET and DELETE REST APIs.
The GET call allows to see what plan is applied to the specified machines.
The DELETE call allows to remove a plan specifically applied - as an exception - to the specified machines.
The target machines are specified as in the original script, based on Azure resource tags or a resource group.
I added to the Tom's code the calls to the GET and DELETE REST APIs. The GET call allows to see what plan is applied to the specified machines. The DELETE call allows to remove a plan specifically applied - as an exception - to the specified machines. The target machines are specified as in the original script, based on Azure resource tags or a resource group.