VMware Cloud Community
pamiller21
Enthusiast
Enthusiast
Jump to solution

Find VMs without NSX Security Tags

Is there a way to make a report that shows any vms without a security tag attached, print it to html, and add a total at the bottom.  Is this doable or is something needed to pull this data from NSX?

0 Kudos
25 Replies
LucD
Leadership
Leadership
Jump to solution

You can open a regular SR (you don't need a Developer Support contract).

See PowerCLI Support Breakdown
Refer to that post when GSS claims you do need Developer Support.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pamiller21
Enthusiast
Enthusiast
Jump to solution

Entered the SR under NSX and support said they can check if the script is hitting it but that is all. No further support given.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You should also be able to open a SR under PowerCLI afaik


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pamiller21
Enthusiast
Enthusiast
Jump to solution

After messing around for a few hours I think I got it.  I needed to connect to a vcenter first then it worked.  Now I am working on finding VMs without any security group assigned.  Sorry for the switching of gears, but I think the group might be easier and get me same content.  But missing something as this just named all my VMs.

get-vm | select name | ?{ ( Get-NsxSecurityGroup $_) -eq $null}

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Great.

Can you try like this

Get-VM |

where {(Get-NsxSecuritytagassignment -VirtualMachine $_) -eq $null}

select name


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pamiller21
Enthusiast
Enthusiast
Jump to solution

This is perfect, thank you so much!

0 Kudos