Options

Verifying Persistent Routes via PowerShell

worldmac1worldmac1 Member Posts: 121 ■■□□□□□□□□
Hey guys,
I wasn't certain where to ask this, so I figured this would be good spot. I have over 635 servers and growing. I would like to write a PS script showing the persistent routes on each server. Later, I may want to add a route to the ones that are blank. Is there a way to write a PowerShell script to achieve this? I have been looking and even been dinking around with some commands along with PsExec, but nothing seems to be working for me.

Normally I wouldn't ask this, but I am having a time trying to figure this out, and running out of ideas. icon_sad.gif

I don't mind buying you a beer or two for helping. ;) just saying...

Thanks guys, Greg
Certs in Progress:

CCNP:Routing 300-101 15%
OIIIIIIIO

Comments

  • Options
    NetworkNewbNetworkNewb Member Posts: 3,298 ■■■■■■■■■□
    Does this have the information you are looking for?
    Win32_IP4PersistedRouteTable

    If so could run something like:
    $servers = Get-ADComputer -Filter {operatingsystem -like "*server*"}
    $servers | ForEach {Get-WMIObject -Class Win32_IP4PersistedRouteTable -ComputerName $_.name }

    And could change that to only show what you want and export it to a file...
Sign In or Register to comment.