Guest User

Untitled

a guest
Sep 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Address CIDR Description VLAN
  2. ------- ---- ----------- ----
  3. 10.15.10.0 24 DMZ 3000
  4. 10.15.11.0 24 Voice 3010
  5. 10.15.12.0 24 Wireless 3020
  6. 10.15.13.0 28 Management 3030
  7. ... ... ... ...
  8.  
  9. $testCon = Test-Connection hostname -Count 1
  10.  
  11. $allSubnets | ForEach-Object {
  12. if((checkSubnet -addr1 ('{0}/{1}' -f $_.Address, $_.CIDR) -addr2 $testCon.IPV4Address.IPAddressToString).Condition -eq $true)
  13. {
  14. [pscustomobject]@{
  15. subnet = ('{0}/{1}' -f $_.Address, $_.CIDR)
  16. desc = $_.Description
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment