1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Log On Script for mapped network drives in 2003 server

Discussion in 'Networking' started by wisdum, Dec 13, 2005.

Thread Status:
Not open for further replies.
Advertisement
  1. wisdum

    wisdum Thread Starter

    Joined:
    Dec 1, 2005
    Messages:
    131
    I am currently trying to find a way to map network drives with a log on script. I have searched the net a bit and haven't had too much luck in finding specifically what i need.

    Here is the scenario:

    I have remote clients that connect through a VPN to our corporate office for AD authentication and other AD services. I have setup home directories for each user, but i need a public share that all the users of the remote office can see. (my main problem is that they all dont know how to use computers so i need to make it as painfully obvious as i can *mapped drives).

    I am looking for a way to create two mapped network drives, one for their individual home folder, and one community folder. I haven't had a problem creating the home folder (that is easy with 2k3), but i can't get my log on script to work properly.

    Here are my questions:

    1. Can i run a log on script and a home folder assignment at the same time? Or do i need to setup the script to create the mapped drive for both folders?

    2. I have found a few places to link a user to a log on script (either by browsing the user in Users and Computers, under the Profile tab by the Home Folder) or with a GPO. Which is the preferred/best/efficient way to do it?

    3. I can't even get my log on script to map a drive on a test account... what am i doing wrong? I have included my script code on the bottom of this post.

    4. Does anyone know of a good site that can help get me through this? Or any other relevant information about best-practice in this scenario?

    ---------log on script--------
    Option Explicit
    Dim objNetwork, strRemotePath1
    Dim strDriveLetter1

    strDriveLetter1 = "M:"
    strRemotePath1 = "\\server\share"
    Set objNetwork = CreateObject("WScript.Network")

    objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1

    Wscript.Quit
    ---------log on script--------
    I was told to save the file as a .vbs so i did... :)

    Thanks for past, present and future help everyone!
     
  2. winterfrost

    winterfrost

    Joined:
    Nov 28, 2005
    Messages:
    120
    Are you testing this locally or across the VPN?
     
  3. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Couldn't you just write a simple batch file or has Microsoft moved away from that in 2003 server.
     
  4. wisdum

    wisdum Thread Starter

    Joined:
    Dec 1, 2005
    Messages:
    131
    I am not testing it over the VPN, yet...but will this afternoon. I should mention that the VPN not with 2k3 server. It is between our smoothwall (www.smoothwall.org) routers, a pretty cool setup.

    I thought about the batch file using Net Use but that seemed a bit old fashioned...

    and actually guys, i think i just got it working!
     
  5. wisdum

    wisdum Thread Starter

    Joined:
    Dec 1, 2005
    Messages:
    131
    Nope, no i dont.

    It works fine when i log in at the corporate office, but when i try and log in at the remote office it doesn't map the drive! However, the home directory i setup for each user works just fine.

    I tried changing the script so that it would look for the server based on IP instead of DNS, still nothing. I figure it comes down to two things. Either the script isn't being run at log on (cauing the drive to not be mapped) or that the script doesn't work over the VPN (which wouldn't make any sense).

    If the script works locally, and i can ping over the vpn (by both name and IP) why wouldn't it work at the remote office?

    I guess i will just have to use Net Use. This brings up a few questions. If i create a batch with Net Use and it maps the drive, will it be mapped permenantly? Or will the batch have to run at every log on?

    Thanks for everyone's help!
     
  6. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    NET USE with the /PERSISTENT:YES should do the trick.
     
  7. winterfrost

    winterfrost

    Joined:
    Nov 28, 2005
    Messages:
    120
    I'd say it's more likely that the script is not running. Obviously you could test this by manually running the login script on one of the remove systems to see if it actually maps the drives.

    How are you specifying the login script -- by Group Policy, or as a User account property? If by GPO, is it possible that the GP is not being applied to the remote computers?

    If you want the drive mapping permanent, then JohnWill has supplied you with the right parameter. Personally I think there is value in running a login script at every login (gives the flexibillity to change drive mappings as well as perform many other administrative tasks, which can be very helpful -- especially at remote sites), so I would spend the time to get the login script working the way it should.

    But as Dennis Miller says... that's just my opinion, I could be wrong! :)
     
  8. wisdum

    wisdum Thread Starter

    Joined:
    Dec 1, 2005
    Messages:
    131
    Update:

    I have recently found out that my GPO isn't traversing the VPN. It goes from a (NAT) 192.168.1.x to a 192.168.5.x.... routing is all setup... but the group policy is not applying to the remote machines.

    I also noticed that netbios names aren't getting through either... does GPO require netbios names to work? i wouldn't think so since 2000/2003 is trying to pull away from netbios and just use DNS... so neither DNS names and netbios names are coming through.

    Is there a trick to get the netbios names to go over the vpn? Are they even necessary?

    thanks again
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/424809

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice