Results 1 to 7 of 7

Thread: VB log on scripts

  1. #1
    Join Date
    Jul 2004
    Posts
    2,250
    Country
    Sierra Leone

    Default VB log on scripts

    can anyone on this site help me with a vbscript. In not really a programmer but i know that a VB script would be the best language to get this done. what i want to do is map network drives for users when they log into windows domain.I want a script that looks at which active directory group the user is apart of and map a drive for the user based on which folder on the file server that group has access to. any help would be appreciated.
    The price of anything is the amount of life you exchange for it.
    Henry David Thoreau

  2. #2
    Join Date
    Aug 2002
    Posts
    6,133
    Country
    Jamaica

    Default

    I used to do this on our Netware Server, but the commands may be different on a Windows server....
    .
    SHANTI II - Ubuntu 13.04 64bit Desktop
    HP Pav G60-236US 3GB RAM Laptop, Ubuntu 13.04 64bit and Win7 Home

    "So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"


    Changes to posting in Classifieds

  3. #3
    Join Date
    Mar 2004
    Posts
    812
    Country
    United States

    Default

    Code:
    On Error Resume Next
    
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objNetwork = CreateObject("Wscript.Network")
    
    strUserPath = "LDAP://" & objSysInfo.UserName
    Set objUser = GetObject(strUserPath)
    
    For Each strGroup in objUser.MemberOf
        strGroupPath = "LDAP://" & strGroup
        Set objGroup = GetObject(strGroupPath)
        strGroupName = objGroup.CN
    
        Select Case strGroupName
            Case "Finance Users"
                objNetwork.MapNetworkDrive "X:", "\\atl-fs-01\finance"
            
            Case "Human Resource Users" 
                objNetwork.MapNetworkDrive "X:", "\\atl-fs-01\hr"
    
            Case "Manufacturing Users"
                objNetwork.MapNetworkDrive "X:", "\\atl-fs-01\manufacturing"
    
            Case "Shipping and Receiving Users"
                objNetwork.MapNetworkDrive "X:", "\\atl-fs-01\shipping"
        End Select
    Next
    Source for above VBScript

    Have you considered KiXtart? It is much easier than VBScirpt

  4. #4
    Join Date
    Jul 2004
    Posts
    2,250
    Country
    Sierra Leone

    Default

    I used the link below and my mappings work. The problem i have now is that it takes about 2 minutes to complete the log in process and im only mapping a single drive in a test environment. anything i can do to speed up the process?


    http://e-articles.info/e/a/title/Che...-Logon-Script/
    The price of anything is the amount of life you exchange for it.
    Henry David Thoreau

  5. #5
    Join Date
    Mar 2004
    Posts
    812
    Country
    United States

    Default

    Do you mind posting the entire login script?

  6. #6
    Join Date
    Jul 2004
    Posts
    2,250
    Country
    Sierra Leone

    Default

    Quote Originally Posted by juba View Post
    Do you mind posting the entire login script?
    the script is in the link i posted the only difference is i changed the computer name to match my server...
    The price of anything is the amount of life you exchange for it.
    Henry David Thoreau

  7. #7
    Join Date
    Dec 2010
    Posts
    249
    Country
    Jamaica

    Default

    u cud use the net use command
    eg. net use g: \\server\data
    Dip,Bsc,CCNA,CCSP,MCP.. Up next MCSA WINDOWS 8, CCNA SECURITY,CCNP SWITCH,
    CCNA SEEKING AN OPPORTUNITY
    Theres no Friend Like Google..........

Posting Permissions

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