Results 1 to 7 of 7

Thread: VB log on scripts

  1. #1
    Join Date
    Jul 2004
    Posts
    2,250
    Rep Power
    0

    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,223
    Rep Power
    0

    Default

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

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


    RIP Ramesh ...

  3. #3
    Join Date
    Mar 2004
    Posts
    812
    Rep Power
    0

    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
    Rep Power
    0

    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
    Rep Power
    0

    Default

    Do you mind posting the entire login script?

  6. #6
    Join Date
    Jul 2004
    Posts
    2,250
    Rep Power
    0

    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
    256
    Rep Power
    0

    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
  •