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?
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
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
1
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.