By double mapping I mean this:
In the user's account profile there is an entry for mapping the home folder. Ex: H: \\japan\is
In the login script there is a statement to map H: to the homeshare (which should be pulled from the account profile)
Here's the script:
'**********************************************************************************
' Set Environment Variables
'*********************************************************************************
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set WSHShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
Domain = WSHNetwork.UserDomain
UserName = ""
While UserName = ""
UserName = WSHNetwork.UserName
MyGroups = GetGroups(Domain, UserName)
Wend
'*********************************************************************************
' Main Process:
'*********************************************************************************
GrpMeb UserName
ShowBox
Wscript.Quit
'*********************************************************************************
'Function: GetGroups
'*********************************************************************************
Function GetGroups(Domain, UserName)
Set objUser = GetObject("WinNT://" & Domain & "/" & UserName)
GetGroups=""
For Each objGroup In objUser.Groups
GetGroups=GetGroups & "[" & UCase(objGroup.Name) & "]"
Next
End Function
'********************************************************************************
'Function: InGroup
'********************************************************************************
Function InGroup(strGroup)
InGroup=False
If InStr(MyGroups,"[" & UCase(strGroup) & "]") Then
InGroup=True
End If
End Function
'*********************************************************************************
' MapDrives Subroutine
'*********************************************************************************
Sub MapDrive(sDrive,sShare)
On Error Resume Next
WSHNetwork.RemoveNetworkDrive sDrive
Err.Clear
WSHNetwork.MapNetworkDrive sDrive,sShare
End Sub
'********************************************************************************
'Map Drives:
'********************************************************************************
Sub GrpMeb(UNAME)
MapDrive "P:", "\\coral\dbfiles"
MapDrive "I:", "\\coral\dbase"
MapDrive "N:", "\\japan\public"
If INGROUP ("finance") Then
MapDrive "R:", "\\scotia\finance"
End If
If INGROUP ("abms") Then
MapDrive "Z:", "\\prresource\abms"
End If
If INGROUP ("information systems") Then
MapDrive "R:", "\\japan\cde$"
End If
If INGROUP ("information systems") Then
MapDrive "X:", "\\scotia\trackit"
End If
If INGROUP ("application testers") Then
MapDrive "L:", "\\scotia\dev"
End If
If INGROUP ("imax") Then
MapDrive "S:", "\\black\imax"
End If
If INGROUP ("entrendex") Then
MapDrive "T:", "\\seto\entrendex"
End If
If INGROUP ("human resources") Then
MapDrive "R:", "\\scotia\cobra"
End If
If INGROUP ("shared_folders") Then
MapDrive "R:", "\\mbs2\mbs"
End If
Return = WSHShell.Run("\\scotia\ofcscan\autopcc.exe", 5, true)
On Error Resume Next
WSHNetwork.RemoveNetworkDrive "H:"
Err.Clear
strCmd = "net.exe use H: /home >null"
WshShell.Run strCmd, 0
strCmd = "net.exe time \\aral /set /yes >null"
WshShell.Run strCmd, 0
End Sub
'
'********************************************************************************
'Display Dialog:
'********************************************************************************
Sub ShowBox
strMsgtxt = "You are mapped to the following drive letters:" & vbNewLine
strMsgtxt = strMsgtxt & "P: = \\coral\dbfiles" & vbNewLine
strMsgtxt = strMsgtxt & "I: = \\coral\dbase" & vbNewLine
strMsgtxt = strMsgtxt & "N: = \\japan\public" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\scotia\finance" & vbNewLine
strMsgtxt = strMsgtxt & "Z: = \\prresource\abms" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\japan\cde$" & vbNewLine
strMsgtxt = strMsgtxt & "X: = \\scotia\trackit" & vbNewLine
strMsgtxt = strMsgtxt & "L: = \\scotia\dev" & vbNewLine
strMsgtxt = strMsgtxt & "S: = \\black\imax" & vbNewLine
strMsgtxt = strMsgtxt & "T: = \\seto\entrendex" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\scotia\cobra" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\mbs2\mbs" & vbNewLine
strMsgtxt = strMsgtxt & "You are mapped to the following printers:" & vbNewLine
strMsgtxt = strMsgtxt & "H: = Home Drive" & vbNewLine
msgbox = WshShell.Popup(strMsgtxt, 2, "Logon Script", 0)
End Sub
I should clarify that when I say reboots....it is actually blue screening...that is if I turn off auto reboot. The error messages are consistent with a stop error 00000025. There is no additional information in the event log. I have looked at articles dealing with the stop error but they do not apply to this particular situation.
Thanks