Discovering NSX IPSets that Contain an IP Address
As you can tell by the kinds of posts that I've been making recently, I've had the chance to do a fair amount of work with NSX! Within NSX, you can define IPSets to allow you to control the way non-NSX objects (such as physical devices) can interact with your VMs. If you need to figure out which existing IPSet contains a given IP Address, you can run an easy VRNI query (ipset where ip address = <IP Address>)... but you don't always have access to VRNI! So, I put together a PowerNSX script to check on it for me! Using this script is pretty simple: get-appliedNSXIPsets -ipAddr <IP Address in Question>. It will return a table with three columns (NSXSecurityGroup, NSXIPSet, and IPAddress) and one row per unique Security Group / IPSet combination. The script understands IPSets that list multiple objects, but only if they are whole subnets (defined with CIDR notation) or individual IP Addresses. The script does not support ranges of IP Addresses (like 192.168.