Consider the following scenario. You run the Refresh, Replace, Sysprep and Capture, and Custom task sequences with Microsoft Deployment Toolkit 2010 (MDT 2010). In this scenario, you run these sequences, and you receive the following error message after you complete the wizard:
A connection to the distribution share could not be made.
Additionally, the following error message is logged in the MDT log files:
Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed.
This issue occurs most frequently when you are logged on to the client computer as one user, and when you enter different credentials into the deployment wizard or into the Customsettings.ini configuration file.
Additionally, when you perform a User State Migration by using the variables UDDIR and UDSHARE, the deployment may fail if the directory that is specified in UDDIR does not exist.
To fix the problem, you should edit the Ztiutility.vbs file in the deployment share under the scripts folder and also edit the Ztiutiliy.vbs in the
Program Files\Microsoft Deployment Toolkit\Templates\Distribution\Scripts folder. To do this, open the file in Notepad, and then copy the following code:
Case Else
Err.Clear
On Error Resume Next
oNetwork.MapNetworkDrive chr(sDrive)&":", sShare, False
HasError = err.number
ErrDesc = err.Description
On Error Goto 0
If Err.Number <> 0 Then
' There was a some kind of fatal error.
If ErrDesc <> "" then
MapNetworkDriveEx = ErrDesc
Else
MapNetworkDriveEx = "Unable to map UNC Path " & sShare & " :" & "( 0x" & hex(HasError) & " ) "
End if
oLogging.CreateEntry MapNetworkDriveEx & "", iLogType
Exit function
Else
MapNetworkDriveEx = chr(sDrive)&":"
Exit Function
End If
End selectUse the code that you copied to replace following code that is in the
MapNetworkDriveEX function:
Case Else
' Case &h800704C3 ' Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed.
' Case &h8007052E ' Logon failure: unknown user name or bad password.
' There was a some kind of fatal error.
If ErrDesc <> "" then
MapNetworkDriveEx = ErrDesc
Else
MapNetworkDriveEx = "Unable to map UNC Path " & sShare & " :" & "( 0x" & hex(HasError) & " ) "
End if
oLogging.CreateEntry MapNetworkDriveEx & "", iLogType
Exit function
End selectTo fix the problem with the User State Migration, edit the Ztiuserstate.wsf file in the deployment share under the scripts folder. Additionally, edit the Ztiuserstate.wsf file in the
Program Files\Microsoft Deployment Toolkit\Templates\Distribution\Scripts folder. Open the file in Notepad and replace the following code in the
Main function:
Find the following code:
ElseIf oEnvironment.Item("UDShare") <> "" and oEnvironment.Item("UDDir") <> "" then
oEnvironment.Item("StatePath") = oEnvironment.Substitute(oEnvironment.Item("UDShare") & "\" & oEnvironment.Item("UDDir"))
End if
Replace the code that you found with the following code:
ElseIf oEnvironment.Item("UDShare") <> "" and oEnvironment.Item("UDDir") <> "" then
oUtility.ValidateConnection oEnvironment.Substitute(oEnvironment.Item("UDShare"))
oEnvironment.Item("StatePath") = oEnvironment.Substitute(oEnvironment.Item("UDShare") & "\" & oEnvironment.Item("UDDir"))
End if