Map a script based on IP - VB or KIX

Posted on 2006-04-25
Last Modified: 2007-12-19
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.
Question by:nprignano
    LVL 1

    Expert Comment

    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.

    LVL 15

    Author Comment

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

    LVL 1

    Accepted Solution

    LVL 15

    Author Comment

    thanks.  the middle link is something i have not seen yet and will definitely look into more.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
    Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now