• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Login script dependent on subnet

Red Storm

Lifer
Figured this would be the best place to ask. The scenario:

A user works at two different locations, each with its own subnet (one is 10.2.10.X, the other is 10.30.10.X). Users at 10.2.10.X use a specific login script, while those at the other location use their own script.

What I need is the correct login script to apply to the user automatically when he logs in. So if he logs in at 10.2, the right login script applies, and vice versa. Any way to do this?
 
As for quick and easy, you can try setting the path of the users login script in their profile (or wherever you specify them) to a DFS share. Put a different script on the file server in each location. DFS will find the closest server. If the user logs in to site A, DFS would direct requests for \\company\special_scripts\bob.cmd to \\site_A_file_server\special_scripts\bob.cmd. At site B it would use \\site_B_file_server\special_scripts\bob.cmd.

I'm not sure if the a DFS path would work in profiles but it's worth a shot.
 
DFS works fine in login scripts. Not the approach I would have thought of but yeah that would work assuming you make sure your subnets are defined in sites and services. Issues pop up if you come from an unknown segment and a random target is picked off the list.

You can also use powershell and VB scripting to do this with case statements on the windows side.

VB here:
http://blogs.technet.com/b/heyscrip...p-a-drive-based-on-the-computer-s-subnet.aspx

Powershell you would do a get-wmiobject from the network stack and build case statements on the strings (looks similar to VB example)
 
Last edited:
Back
Top