Issues mapping Netware drives using windows login script and Group Policy to push it.

问题 Issues mapping Netware drives using windows login script and Group Policy to push it.

  • Freitag, 16. November 2012 20:06
     
     

    We have a mixed Netware and Windows 2003 AD network.  We are looking to eventually eliminate Netware.  One of the first steps was moving login scripts off of Netware and on to Windows.

    We had no Sites setup so I started there.  Each branch got a site and subnet.  I then created a GP Object and attached it to each site.  A login script, a VBS file that looks at group memberships and maps drives based on said memberships.  This is very important as we run software off of our servers at each branch and they must reside on the T drive mapping.  So if you are at branch A you must get t:\serverA\software.  If at branch B you must get T:\serverB\software.  Sites makes this possible where as in Netware I had to determine your IP address to do this.

    Anyway...  I am running into issues and I believe I have a handle on what is happening but not the solution.  If you run the script when logged in you get your drives just fine, all of them.  When you rely on Group Policy during login you only get windows drive mappings.  The drive mappings to Netware servers do not show up.

    I believe somehow the Netware client has not yet connected to the servers when the login script tries to run.  So I put a pause in that delays the script.  Ex. "wcript.sleep(17000)"

    The drive mappings then work.  If you are quick to look for them in explorer after boot you will not see them and then poof because of the pause they show up relatively quickly afterwords.

    Seems all is well right?  At least twice a morning I get a call from a random branch that they can't launch their programs on a computer.  When I connect and check, they have the windows mapping but not the Netware ones.  I know the script ran because of the windows drives.

    My question is...  Is this the best way of achieving this or should I be trying something else for a script?  I will attach an example of my script.

    On Error Resume Next
     
    Set objNetwork = CreateObject("WScript.Network")
    Set objUser = CreateObject("ADSystemInfo")
    Set objCurrentUser = GetObject("LDAP://" & objUser.UserName)
    strGroup = LCase(Join(objCurrentUser.MemberOf))

    WScript.Sleep(17000)

     
    REM ---- Map network drives that whole branch gets ----
    objNetwork.MapNetworkDrive "T:", "\*\NetwareServerA\Software", "false"
    objNetwork.MapNetworkDrive "W:", "\*WindowsServerA\Data", "false"
     
    REM ----Start checking group memberships for drive mappings----
    If InStr(strGroup, lcase("HR")) Then
    objNetwork.MapNetworkDrive "H:", "\*\WindowsServer\HR", "false"
    End If

    ***Of course leave out the * between the \  \ above in the login script.  Couldn't get it to take the post without that.

    Thanks in advance!

Alle Antworten

  • Freitag, 16. November 2012 21:14
     
     
     
    > objNetwork.MapNetworkDrive "W:", "\*WindowsServerA\Data", "false"
    >
     
    Netware is dead for years now ;.) But anyway - error handling always
    might help:
     
    err.clear
    objNetwork.MapNetworkDrive "W:", "\*WindowsServerA\Data", "false"
    if err then
        'write an entry to a log file
        set log = fso.OpenTextFile( "xyz.log", 8, true )
        log.WriteLine err.number
        log.WriteLine err.description
        log.Close
    end if
     
     

    NO THEY ARE NOT EVIL, if you know what you are doing: Good or bad GPOs?
    Wenn meine Antwort hilfreich war, freue ich mich über eine Bewertung! If my answer was helpful, I'm glad about a rating!
  • Montag, 19. November 2012 19:49
     
     
    I put that in the script but I must be doing something wrong as I'm not getting an error log.  The windows drive is again mapping correctly but the Netware drive shows up when it wants to.  I got 2 calls today from one branch.  Tomorrow I will get 2 more from different people who today had no issue.
  • Mittwoch, 21. November 2012 20:01
     
     
     
    > I put that in the script but I must be doing something wrong as I'm
    > not getting an error log.  The windows drive is again mapping
    > correctly but the Netware drive shows up when it wants to.  I got 2
    > calls today from one branch.  Tomorrow I will get 2 more from
    > different people who today had no issue.
     
    For this to work, you need "on error resume next" above the mentioned
    lines. Otherwise, CScript throws a runtime error and dies...
    If you already have that, I'm out of the game and blame the netware
    client (-:
     

    NO THEY ARE NOT EVIL, if you know what you are doing: Good or bad GPOs?
    Wenn meine Antwort hilfreich war, freue ich mich über eine Bewertung! If my answer was helpful, I'm glad about a rating!
  • Freitag, 23. November 2012 16:10
     
     

    I had that at the top of the whole script.  That being said I have no added it right above the err.clear.  Still nothing working yet.

    Netware is a pain, but unfortunately we are stuck with it while I migrate it out.  Once we have all windows server then I can remove the client.

    Thanks for the help.

  • Samstag, 24. November 2012 13:53
     
     
    Then unfortunately, I cannot further assist. I've not seen Netware for more than 20 Years now ;-))

    NO THEY ARE NOT EVIL, if you know what you are doing: Good or bad GPOs?
    Wenn meine Antwort hilfreich war, freue ich mich über eine Bewertung! If my answer was helpful, I'm glad about a rating!