Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering if it it is possible to build a logon script, for Windows XP & Vista, that will detect where the user is connected to a particular network (Defined by IP schema). If they are connected to a specific network, then it will display a message such as, "Please note your will not be able to access the XYZ Network Drive, or your company email"

share|improve this question
What OS are you using? – Richard Jan 14 '10 at 11:39
Sorry, edited previous post. Windows XP & Vista – MikeT505 Jan 14 '10 at 11:40

Why do this with batch file gyrations when you can just link GPOs to site objects? The "bonus" being that if you add addt'l subnets or move subnets around you'll never have to edit your script.

If you're looking at this being a user logon script that you want to apply only when users logon to specific computers then you'll need to look at using loopback group policy processing as well.

share|improve this answer
I think that's the gist of what MarkM was suggesting. The only drawback is if a roaming user is physically in a site that's not their home site, and the logon script maps resources in the users home site that aren't available from the remote site (I know it sounds kooky, but stranger configurations have happened). – joeqwerty Jan 14 '10 at 18:42
@joeqwerty: I guess I must not be following, then. I'd write a script that does everything that's supposed to be done when the subject user is in a given site and specify it as a logon script in a GPO linked to the correct site (using filtering mechanisms, as necessary, to insure that it only runs for the right users / computers). There would be no "maps resources in the users home site that aren't avalable" scenarios... – Evan Anderson Jan 14 '10 at 18:45
Thanks Guys I see what you mean. The other issue, one of these sites doesn't have any form of server, its a very small office. Some a batch file that runs at login would probably be better. We need the script to only map a network drive at this site and display a message to user expalining they can't access their company email. – MikeT505 Jan 15 '10 at 15:55
You don't need a server at that office to execute scripts linked from GPOs. If the computers are processing Group Policy (i.e. they can "talk to" a domain controller) while on that site's network then you can definitely deploy a logon script named in a GPO linked to the site to do what you're looking for. – Evan Anderson Jan 15 '10 at 16:18
@Evan: I was probably overcomplicating my thinking based on what's been posted. I was thinking that the remote site might only have a connection to the home site for AD traffic and not file or email resources. So the home site user sitting at the remote site wouldn't have access to mapped drives, mailbox, etc. that exist in the home site. – joeqwerty Jan 16 '10 at 4:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.