Link to home
Start Free TrialLog in
Avatar of mggi
mggi

asked on

Windows VB Login Script - Mappings based on location

OK Gurus, consider the following scenario:

Active Directory Network (Windows 2003, SP1)
Multiple offices, connected via VPN.  (Broadband, various speeds)
Corporate Users / Remote office users are set up in individual OUs. Each OU has its own Login Script(s).  
Servers are stored in a single Hardware OU.
Hub and Spoke network organization.
Central Office has Multiple Servers.  Each remote office has a single server.
85% of work is done on Servers located in Central Office.
15% of work is done on Servers located in Field Offices.
Home Folders and TSProfiles for all users (with the exception of user-ids that are remote only) are set up and stored on shared folders w/in the corporate office (central network)
Users access Central applications from local logins within the corporate office, and via Remote Desktop externally.
User's have single logins IDs and passwords.
Login scripts are VBScript
IP Addressing scheme:  Corporate office 10.0.10.x,  remote offices 192.168.x.x

We have login scripts that work, but would like to refine them.   Here's the challenge - Dont want to map network drives / printers of remote devices.  In other words, when logging into the corporate office server, either locally or RDP, I only want to map central resources.  When logging into a field server (either locally or RDP) I only want to map the drives specific to that environment.  The VPN performance is too irregular to allow users to pull files from remote drives over the VPN.


For Corporate office users...in "Corporate OU"
    Internally (PC/Laptop on Local Network) - Regular Corporate Drive Mappings, Map home folder

    RDP or Terminal Server into Corp Office from Home PC - Regular Corporate Drive Mappings, Use   TSProfile Settings

    RDP or Citrix into Remote Server - Remote Server Drive Mappings, No Home Folder, Dont Use Central TSProfile

    When on Travel to Remote Location (not RDP into Corp Office) - Remote Server Drive Mappings, No Home Folder or TSProfile


Remote Office Users ... in separate "XXX Office OUs"
     Local PC Login to Local Server - Local Drive Mappings, no home folder

     Local PC Login to Corporate office via Citrix / RDP (Corporate Drive Mappings, Home Folder

     Home PC Login to Local Server via RDP - Local Drive Mappings, no home folder

Thanks for the suggestions in advance.
ASKER CERTIFIED SOLUTION
Avatar of Ron Malmstead
Ron Malmstead
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you have your Sites defined in AD Sites And Services with the correct subnets, the clients will already know in which site they are. You can retrieve this information like so:

Set objADSysInfo = CreateObject("ADSystemInfo")
ADSite =  objADSysInfo.SiteName

Then, you can let the script decide what to do, for instance:
if ADsite="chicago" then mapprinter("\\chicago1\printer3")

Redwulf - Most people use batch scripts for logon scripts....  mostly because it's easier to understand, and vbscripts only run asynchronously....(they don't wait for one command to finish before running the rest of the code.)

My solution allows you to easily use the network id as a variable in MS-DOS logon scripts....but thanks for your input.