How to make a logon script, that maps network drives ???
Results 1 to 15 of 18

Thread: How to make a logon script, that maps network drives ???

Hybrid View

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    11

    Question How to make a logon script, that maps network drives ???

    We just installed a Windows 2003 server, and are having alot of trouble getting a logon script to work.

    We have read the help files, and done what they say, but it still doesn nothing when trying to login to the server.

    It will log us in, and let us in the apropriate files, but I dont think the script is wroking, or running at all.
    Becuase it is not mapping the network drives and folders, as we told it to.

    Please tell me how to write a simple script to map drives and folders at logon, and how to make it run.

    Thanks alot.

  2. #2
    Registered User
    Join Date
    Apr 2004
    Posts
    11
    Here is the script that we are trying to use.


    Const ENGINEERING_GROUP = "cn=engineering"
    Const FINANCE_GROUP = "cn=finance"
    Const HUMAN_RESOURCES_GROUP = "cn=human resources"

    Set wshNetwork = CreateObject("WScript.Network")
    wshNetwork.MapNetworkDrive "G:", "\\test_share" & wshNetwork.UserName

    Set ADSysInfo = CreateObject("ADSystemInfo")
    Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
    strGroups = LCase(Join(CurrentUser.MemberOf))

    If InStr(strGroups, ENGINEERING_GROUP) Then

    wshNetwork.MapNetworkDrive "L:", "\\R Folder"

    end if

  3. #3
    Tech-To-Tech Mod kato2274's Avatar
    Join Date
    Sep 2001
    Location
    Bentleyville, Pa
    Posts
    2,317
    Quote Originally Posted by jtice
    Here is the script that we are trying to use.


    Const ENGINEERING_GROUP = "cn=engineering"
    Const FINANCE_GROUP = "cn=finance"
    Const HUMAN_RESOURCES_GROUP = "cn=human resources"

    Set wshNetwork = CreateObject("WScript.Network")
    wshNetwork.MapNetworkDrive "G:", "\\test_share" & wshNetwork.UserName

    Set ADSysInfo = CreateObject("ADSystemInfo")
    Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
    strGroups = LCase(Join(CurrentUser.MemberOf))

    If InStr(strGroups, ENGINEERING_GROUP) Then

    wshNetwork.MapNetworkDrive "L:", "\\R Folder"

    end if
    if this running server side or client side? this would be SO much easier to do via active directory users and computers

    example:
    in profiles of engineering group set a logon script of engine.bat

    the engine.bat has the command
    net use L: \\server\share

    for the user specific maps, the %username% variable works in a batch script
    ie.
    net use Z: \\server\home\%username%
    Last edited by kato2274; April 29th, 2004 at 06:05 PM.
    Nonsense prevails, modesty fails
    Grace and virtue turn into stupidity - E. Costello

  4. #4
    Tech-To-Tech Mod kato2274's Avatar
    Join Date
    Sep 2001
    Location
    Bentleyville, Pa
    Posts
    2,317
    it's pretty simple. what have you already done? if you can detail what you tried it will make things a lot easier.

    but basically the script is just a batch file that utilizes net use commands

    i.e.

    net use z: \\server\share

    and you execute it from the user properties in active directory users and computers. under the profile tab there is a place to specify a logon script.

    you must be sure to have the permissions set correctly on the shares so that when you are mapping a share to a drive for a user he/she actually has permissions to use the resource.
    Last edited by kato2274; April 29th, 2004 at 06:05 PM.
    Nonsense prevails, modesty fails
    Grace and virtue turn into stupidity - E. Costello

  5. #5
    Registered User
    Join Date
    Apr 2004
    Posts
    11
    I have tried placing the script in the user part, and under the startup/shutdown parts.

    I actually placed the script in EVERY place I could see that you could put a script.

    We need this to be a global script, not one that is placed in each users profile. That would take more time to do.

    This needs to be a script that is ran when ever ANYone logs in.
    Then that script looks to see who logged in, and what drive is supposed to be mapped to them.

    When we goto login, it basically does nothing, acts like the script isnt even there.

  6. #6
    Registered User
    Join Date
    Apr 2004
    Posts
    11
    I dont see where I can assign a script to a group.
    I went to properties of the group, as I would a user, and I dont see anythign about it there.

    If I goto a users properties, I see where I can add a script.
    But not for a group.

  7. #7
    Tech-To-Tech Mod kato2274's Avatar
    Join Date
    Sep 2001
    Location
    Bentleyville, Pa
    Posts
    2,317
    Quote Originally Posted by jtice
    I dont see where I can assign a script to a group.
    I went to properties of the group, as I would a user, and I dont see anythign about it there.

    If I goto a users properties, I see where I can add a script.
    But not for a group.
    you're right. I got ahead of myself. what I usually do is setup one user for a group. then just copy that user when I need another user in that group. gives them the same properties. ......I was just thinking of it this way because we have group logon scipts.....i.e. development.bat etc. they aren't actually applied in the group properties, but they are applied to the group when creating a new user and I copy an existing development group user
    Nonsense prevails, modesty fails
    Grace and virtue turn into stupidity - E. Costello

  8. #8
    Registered User
    Join Date
    Apr 2004
    Posts
    11
    Quote Originally Posted by kato2274
    you're right. I got ahead of myself. what I usually do is setup one user for a group. then just copy that user when I need another user in that group. gives them the same properties. ......I was just thinking of it this way because we have group logon scipts.....i.e. development.bat etc. they aren't actually applied in the group properties, but they are applied to the group when creating a new user and I copy an existing development group user
    Ah I see what you are doing.
    So, there is no way to assign a script to a group?
    Shouldnt there be a way to make a script run when ANYone logs in?
    And that script map drives according to who that user is?

    I also went to a users profile, and told it to use this script, but it still didnt do anything.

    Also, your are mentioning a .bat file, not a .vbs script file, could that be part of it? Or can they both work?

Similar Threads

  1. [RESOLVED] 70-240: LETS DO THIS!!
    By 70-240 in forum Certification
    Replies: 14
    Last Post: February 20th, 2012, 03:35 AM
  2. create logon script to set IP address in IE
    By death in forum Networking
    Replies: 3
    Last Post: April 23rd, 2001, 09:40 PM
  3. [RESOLVED] W2K network logon
    By gmbruin in forum Windows NT/2000
    Replies: 4
    Last Post: March 22nd, 2001, 05:19 PM
  4. [RESOLVED] NT logon script
    By Note in forum Windows NT/2000
    Replies: 3
    Last Post: August 1st, 2000, 07:59 AM
  5. [RESOLVED] network logon skipped!
    By [email protected] in forum Windows 95/98/98SE/ME
    Replies: 1
    Last Post: April 13th, 2000, 12:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •