Map a script based on IP - VB or KIX

My company has recently adopted the practice of opening branch locations, and our users now rotate amongst the various offices.  As such, we need to provide these users the ability to have certain printers available depending on which office they happen to log into.

One way I was thinking was to do this based on IP, as each office has its own subnet (,, etc) with VPNs between each and the main office, but the problem this presents is that the main office has two levels, and we need to be able to distinguish between those two levels.  

We currently do that by putting the users in those different levels or locations in different AD Orignazational Units, then map drives and printers according to which OU they are in.  This is okay if the users always log into the same locations - but this is not the case.

If I were to put each PC in an OU (can i do this?), can I then check for the OU that the user is logging into then map printers accordingly?  Or, do you have a better approach?

We already use VB for logon scripts, but we are in the process of redoing these in KIX, so either method would be graciously accepted.
LVL 15
nprignanoTechnical ArchitectAsked:
Who is Participating?
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.

you can map in KIX using the EnumIPInfo() function - this will retrieve the IP of the PC that the user is logging into.  also, there is a macro to call - @wrksta - this returns the computer name which you can store all or part of in variable and use in a SELECT...CASE statement.

nprignanoTechnical ArchitectAuthor Commented:
can you post an example of this?  sounds like what I am looking for.


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
nprignanoTechnical ArchitectAuthor Commented:
thanks.  the middle link is something i have not seen yet and will definitely look into more.

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 Server 2003

From novice to tech pro — start learning today.

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.