Home Directories not mapping

From: OregonSteve (steven.r.smothers_at_state.or.us)
Date: 02/27/04


Date: Fri, 27 Feb 2004 09:45:32 -0800

Greetings-

Mixed W2K, W2K3 domain; single site; 3 DCs. Using NetWare client to log
into NetWare file servers and Windows client to authenticate to Domain and
access Windows file servers. Workstations are XP Pro SP1.

Some users sometimes don't get their Home directory mapped when they log in.
They can restart two or three times until they get it. At the same time,
we're using a logon script (VBS) through a GPO, mapping two or three drives.
Again, some people SOMETIMES get an error and don't get those drives mapped.
Here is the error and the script:

Script:
\\Domain.com\SysVol\Domain.com\Policies\...\...\...\...\Lscript.vbs
Line: 54
Char: 4
Error: Logon Failure: The target accouint name is incorrect.
Code: 80070574
Source: (null)

Line 54 is where it identifies the Provider: Set objUser =
GetObject("WinNT://" _
               & strDomain & "/" _
               & strUserName & ",user")

----------------------------------
'System Login Script

Dim WSHNetwork, FSO, strUserName, strUserDomain, ObjGroupDict, objGroup

'---------THIS SECTION SETS VALUES FOR VARIABLES -----------------
Set WSHNetwork = wscript.CreateObject("WScript.Network")
Set FSO = CreateObject("Scripting.FileSystemObject")

strUserName = ""
While strUserName = ""
  wscript.Sleep 500
  strUserName = WSHNetwork.UserName
Wend
strUserDomain = WSHNetwork.UserDomain

Set ObjGroupDict = CreateMemberOfObject(strUserDomain, strUserName)

'----------THIS SECTION NAMES THE SECURITY GROUPS------------------
For Each objGroup In ObjGroupDict

    Select case Ucase(objGroup)
 case "- INFORMATION SYSTEMS"
   call InformationSystems
 case "IS_TECHS"
   call IS_Techs
 case "IS_TRAIN"
   call IS_Train
 case else
    End Select

Next

'----THIS SECTION CREATES THE DICTIONARY OBJECTS ENUMERATING GROUP
MEMBERSHIP----
Function CreateMemberOfObject(strDomain, strUserName)
   Dim objUser, objGroup

'====================================================
'BEGIN LDAP PROVIDER CALL; PREFERRED METHOD OF GATHERING GROUP INFO;
WIN2K/XP ONLY
' Set CreateMemberOfObject = CreateObject("Scripting.Dictionary")
' Set objSysInfo = CreateObject("ADSystemInfo")
' Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
' For Each objGroup In objUser.Groups
' CreateMemberOfObject.Add objGroup.sAMAccountName, "-"
' Next
'END LDAP PROVIDER
'====================================================

   Set CreateMemberOfObject = CreateObject("Scripting.Dictionary")
   CreateMemberOfObject.CompareMode = vbTextCompare
   Set objUser = GetObject("WinNT://" _
               & strDomain & "/" _
               & strUserName & ",user")
   For Each objGroup In objUser.Groups
            CreateMemberOfObject.Add objGroup.Name, "-"
   Next
   Set objUser = Nothing

End Function

'===================================================================
'------------------------- end of main script ----------------------------
'===================================================================

'---------THIS SECTION MAPS DRIVE LETTERS BASED ON GROUP MEMBERSHIP--------

Sub InformationSystems
    WSHNetwork.MapNetworkDrive "I:", "\\Server1\IS\Data", False
' WSHNetwork.MapNetworkDrive "<drive letter>:",
"\\<server>\<share>\<folder>", False
End Sub
'--------------------------------------------------------------------------

Sub IS_Techs
    WSHNetwork.MapNetworkDrive "T:", "\\Server1\IS\Techs", False
' WSHNetwork.MapNetworkDrive "<drive letter>:",
"\\<server>\<share>\<folder>", False
End Sub
'--------------------------------------------------------------------------

Sub IS_Train
   WSHNetwork.MapNetworkDrive "I:", "\\Server1\IS\Data\Train", False
' WSHNetwork.MapNetworkDrive "<drive letter>:",
"\\<server>\<share>\<folder>", False
End Sub



Relevant Pages

  • Re: VBScript error - Logon login script
    ... they don't get drives that are mapped through ... Dim WSHNetwork, FSO, strUserName, strUserDomain, ObjGroupDict, objGroup ... For Each objGroup In ObjGroupDict ... Sub InformationSystems ...
    (microsoft.public.windows.server.scripting)
  • Re: Home Directories not mapping
    ... If you are able to determine that a particular server or servers are the ... > Dim WSHNetwork, FSO, strUserName, strUserDomain, ObjGroupDict, objGroup ... > For Each objGroup In ObjGroupDict ... > Sub InformationSystems ...
    (microsoft.public.win2000.active_directory)
  • Re: VBScript error - Logon login script
    ... The script as written runs for me without error. ... It's acting as if strUserName is blank. ... For Each objGroup In objUser.Groups ... > Sub InformationSystems ...
    (microsoft.public.windows.server.scripting)
  • Re: IsMember and Case Select Map drive
    ... membership, ... remote resources over the network affects speed much more. ... and probably mapping drives. ... Call LoadGroups(objPriObject, objGroup) ...
    (microsoft.public.scripting.vbscript)
  • Re: Home Directories not mapping
    ... Secure channel for domain 'DOMAIN' was successfully set to PDC ... >> looking at those servers to see what state they are in. ... >>> For Each objGroup In ObjGroupDict ... >>> Sub InformationSystems ...
    (microsoft.public.win2000.active_directory)

Loading