Enforce / add persistent routes using GPO on 50 subnets

I wud like to add persistent routes for about 50 subnets' PCs using GPO:
Kindly elaborate how this can be done
sunhuxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MaheshArchitectCommented:
put below code in .bat file and add this script as startup script under computer configuration of GPO and apply this GPO to OU containing computers or you may use WMI filter to apply this script on client computers only

route add 172.17.10.0 mask 255.255.0.0 172.16.12.100 -p
echo off

Open in new window


change subnet and mask with yours
1
MaheshArchitectCommented:
OR

Better option could be add above command as schedule task under GP preference in GPO and once schedule task created as GPP item, go to item properties \ common tab and there you will find option to add IP range under item level targeting so that schedule task will be applied to only specified subnets
1
sunhuxAuthor Commented:
There are close to 350 subnets in our organization, so we'll need how to do this in WMI filter
& not to do a lot of manual keying in.

Link below has something on this but it lacks the solution of how to specify the 50 subnets:
https://www.experts-exchange.com/questions/27955716/Adding-routes-via-GPO-or-GPO-script.html
0
MaheshArchitectCommented:
have you tried GPO preferences to target subnets where you want to push route?
check
https://www.grouppolicy.biz/2010/01/how-to-use-group-policy-preferences-to-dynamically-map-printers-with-roaming-profiles/
1
Shaun VermaakTechnical SpecialistCommented:
Persistent routes end up in
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes

Open in new window

route.png
Registry values are perfect for GPO registry preferences and you can even have containers  with their own item level filtering
2

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.