I wrote a cmdlet that does this and told no one about it... Yours seems easier.
The cmdlet can be sent to a gridview for easy viewing. It shows you 10 columns in Out-GridView: Name - Computer Name InBoundary - Is the computer in a boundary? SiteAssignment - If it is in a boundary, is it assigned a site? Content - If it is in a boundary, is it assigned a DP? IPAddresses - All discovered IP addresses ADSite - Discovered AD Site IPSubnets - Discovered IP subnets InADSiteBoundary - true/false InIPAddressBoundary - true/false InIPSubnetBoundary - true/false It doesn't do anything with IPV6 because IPV6 still scares me. The cmldet is on my GitHub Powershell Scripts repo: https://github.com/Ryan2065/Powershell-Scripts On Thu, Sep 17, 2015 at 1:28 PM, David Jones <[email protected]> wrote: > Just thought I would share a SQL query I made. I was looking for missing > boundaries in SCCM. Like most places we use private IP's. > > If there is a value under 'Subnets Detected' but a NULL under > 'Sorted:Boundary Values' you MIGHT have a missing boundary. You will have > to determine for yourself as it could just be someone VPN'ing in and it's > their local subnet. > > If there is a NULL under 'Subnets Detected' but a value under > 'Sorted:Boundary Values' you MIGHT have a boundary no longer used. Or it > could be nothing is on that subnet right now with an SCCM client. > > The powershell command to add a boundary is: > New-CMBoundary -Name "<boundary_name>" -Type IPSubnet -Value "<subnet_ip>" > example: New-CMBoundary -Name "Boundary 10.0.0.0" -Type IPSubnet -Value > "10.0.0.0" > > The powershell command to remove a boundary is: > Remove-CMBoundary -name "<subnet_displayname>" -force > example: Remove-CMBoundary -name "Boundary 10.0.0.0" -force > > Code: > SELECT > IP_Subnets0 AS 'Subnets Detected', > vSMS_Boundary.Value AS 'Sorted:Boundary Values', > COUNT(v_RA_System_IPSubnets.ResourceID)AS 'Count of Devices', > vSMS_Boundary.DisplayName, > vSMS_Boundary.CreatedOn, > vSMS_Boundary.ModifiedOn > FROM v_RA_System_IPSubnets > Full Join vSMS_Boundary on vSMS_Boundary.Value = > v_RA_System_IPSubnets.IP_Subnets0 > Where (v_RA_System_IPSubnets.IP_Subnets0 like '172.1[6-9].%' or > v_RA_System_IPSubnets.IP_Subnets0 like '172.2[0-9].%' or > v_RA_System_IPSubnets.IP_Subnets0 like '172.3[0-1].%') or > (vSMS_Boundary.Value like '172.1[6-9].%' or > vSMS_Boundary.Value like '172.2[0-9].%' or > vSMS_Boundary.Value like '172.3[0-1].%')or > v_RA_System_IPSubnets.IP_Subnets0 like '10.%' or > v_RA_System_IPSubnets.IP_Subnets0 like '192.168.%' or > vSMS_Boundary.Value like '10.%' or > vSMS_Boundary.Value like '192.168.%' > Group By vSMS_Boundary.Value, > v_RA_System_IPSubnets.IP_Subnets0,vSMS_Boundary.DisplayName,vSMS_Boundary.CreatedOn,vSMS_Boundary.ModifiedOn > Order By [Sorted:Boundary Values] > > Dave > >
