Hello all, After beating my head against the wall for some time now, I have decided to ask for help! Basically I need a report/query that will give me two columns:
PackageServerName | Subnet
SITE1PS01 | 10.99.90.0
SITE2PS01 | 10.94.49.0
This seems like it shouldn't be all that hard, but I'm just having all sorts of troubles. I'm trying to work with the vSubnet, vSiteSubnetMap, PackageServerServingSite, PackageServerServingSubnet, etc, but I can't get it to all add up. I'm fearing that I need to use a cursor (oh how I hate cursors!) Anyone have a bright idea? This should only return subnets which are mapped to a particular site, which is associated with a Package server. There are a few Stored Procedures which are close as well, but still not getting me what I need. The following almost works...but the PackageServerServingSubnet table seems to only have the explicitly matched results (i.e. the subnet that the PS itself is on):
select vc.Name, sub.[Subnet]
FROM vSubnet sub
JOIN PackageServerServingSubnet as pss on pss.[SubnetGuid] = sub.Guid
JOIN vComputer vc ON pss.[PackageServerGuid] = vc.Guid
ORDER BY vc.Name