Is there anyway to apply a NSX security tag to any VM within a VM Folder?
You can try something like this. (Requires PowerNSX)
Get-Folder "XenDesktops" | Get-VM | %{ $_ | New-NsxSecurityTagAssignment -ApplyTag -SecurityTag (Get-NsxSecurityTag internet_access) }
Have a look at Add NSX-T Tags To Virtual Machines with PowerShell
It uses the REST API.
You can also use PowerNSX and the New-NsxSecurityTagAssignment function.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can try something like this. (Requires PowerNSX)
Get-Folder "XenDesktops" | Get-VM | %{ $_ | New-NsxSecurityTagAssignment -ApplyTag -SecurityTag (Get-NsxSecurityTag internet_access) }
Thanks for repeating my answer :smileycry:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference