My previous post showed how to add a NSX security tag using VRO this one is similar but removes it:
Parameters
![](https://i1.wp.com/blog.jgriffiths.org/wp-content/uploads/2018/12/1-1.png?fit=1024%2C145)
Attributes
![](https://i1.wp.com/blog.jgriffiths.org/wp-content/uploads/2018/12/2-1.png?fit=1024%2C128)
Scriptable task:
![](https://i2.wp.com/blog.jgriffiths.org/wp-content/uploads/2018/12/3-1.png?fit=1024%2C615)
Code for cut and paste:
//name = ‘dev-214’;
vms = VcPlugin.getAllVirtualMachines();
for each (vm in vms) {
if (vm.Name == name) {
System.log(“VM name: ” + vm.name + ” MOID: ” + vm.id);
machineMOID = vm.id;
}
}
NSXSecurityTagManager.detachSecurityTagsOnVm(connection, tags, machineMOID);