Map Drives by AD Site with VBS?

Posted on 2010-01-04
Last Modified: 2012-05-08
is there anyway to do this?  Im beneath a novice at VB coding.  My company has a need to map drives based on the subnet (site) the computer they are logging into resides on so we can use the same drive letters in multiple sites but to different servers.
Question by:prentcorp
    LVL 74

    Accepted Solution

    If you already have the VB script then the way to do this would be to assign a script to a group policy that is then applied at Site Level, therefor any user logging on at that site will have the script applied.
    LVL 74

    Expert Comment

    by:Glen Knight
    See here:

    this if course relies on your Active Directory Sites and Services being configured?
    LVL 5

    Expert Comment

    hmm yes i suppose you could but why not a simple batch script or kix script?
    LVL 74

    Expert Comment

    by:Glen Knight
    Centrally managed group policies stored across the entire domain against kix or login scripts?

    I know which I prefer :-)

    Author Comment

    Would the user settings for a script in a GPO in another site applied to a computer object work for that user?  

    I was hoping to keep it in a batch file though in the AD user profile tab for "logon script".  Is there a 'IF insite' kinda vbs thing?
    LVL 7

    Assisted Solution


    Lets say you have four subnets and you have defined four sites to those subnest respectively in Active Directory Sites and Services console (Dssite.msc).
    You just have to write four different batch files (scripts) and you can apply them via GPO on all four sites respectively.
    You just have to open dssite.msc, right click the site and go to its properties, go to group policy tab and apply a startup/logon script policy and place the relevent batch file in that GPO 's scripts location (by clicking show files button).



    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    [b]Ok so now I will show you how to add a user name to the description at login. [/b] First connect to your DC (Domain Controller / Active Directory Server) SET PERMISSIONS FOR SCRIPT TO UPDATE COMPUTER DESCRIPTION TO USERNAME 1. Open Active …
    Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    746 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