GPO Scripting: Map Drive Based On Client IP

Posted on 2009-02-23
Last Modified: 2012-05-06
Well, I current have a gpo that calls a vbs script at logon that maps printers based on the client ip addres, it basically looks for the third octet in the IP address of the connecting users then maps the appropriate printer.

I am looking for the same thing, but rather connect to a printer maps a single drive based on the connecing users IP address.
Question by:ValleyENT
    1 Comment
    LVL 5

    Accepted Solution

    You basically have to change one line of the existing script. If you post your script we can add that in for you and you can just copy it back. If I put it together you will have to change the variables, etc to make it work.

    You need to change the AddWindowsPrinterConnection line to something like
    objNetwork.MapNetworkDrive "H:", "\\servername\sharename"

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    733 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

    20 Experts available now in Live!

    Get 1:1 Help Now