gdcobb
asked on
Windows scrip is not running on one specific pc
We are running win2003 server, and xp prof clients. Script logon.vbs doesn't work on one specific PC. Interesting is that same script works without problem for the same users on other clients. When user logs in on that not working pc scrip gives error:
-------------------------- -
Windows Script Host
-------------------------- -
Script: \\backup\netlogon\logon.vb s
Line: 60
Char: 5
Error: This network connection does not exist.
Code: 800708CA
Source: WSHNetwork.RemoveNetworkDr ive
-------------------------- -
OK
-------------------------- -
I don't know is it network settings or something but everything looks the same to me. I don't think we have to look at script coz 50+ computers works with no problem just that on doesn't.
Any ideas?
Thanks
--------------------------
Windows Script Host
--------------------------
Script: \\backup\netlogon\logon.vb
Line: 60
Char: 5
Error: This network connection does not exist.
Code: 800708CA
Source: WSHNetwork.RemoveNetworkDr
--------------------------
OK
--------------------------
I don't know is it network settings or something but everything looks the same to me. I don't think we have to look at script coz 50+ computers works with no problem just that on doesn't.
Any ideas?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Does the logon script complete the rest of it's jobs and is everthing ok at the end?
Basically it looks like that is the line that reads...
objNetwork.RemoveNetworkDr ive "S:", True, True
So if the S: drive does not exist it could throw that error because it cannot remove a drive mapping that is not there.
Basically it looks like that is the line that reads...
objNetwork.RemoveNetworkDr
So if the S: drive does not exist it could throw that error because it cannot remove a drive mapping that is not there.
ASKER
I deleted line 60
so now script gives me error on the line 60 again (original script would be line 61 you know what i mean)
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sjohnson\Desktop\ logon.vbs
Line: 60
Char: 9
Error: The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.
Code: 800704F1
Source: WSHNetwork.MapNetworkDrive
-------------------------- -
OK
-------------------------- -
so now script gives me error on the line 60 again (original script would be line 61 you know what i mean)
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sjohnson\Desktop\
Line: 60
Char: 9
Error: The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.
Code: 800704F1
Source: WSHNetwork.MapNetworkDrive
--------------------------
OK
--------------------------
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Presumably this user is a member of the "software" group so continues to this section, and also may have an issues as suggested above. Please check the real error which is occuring during the connection please as follows:
Running these commands instead:
on error resume next
wscript.echo "Trying S:"
objNetwork.MapNetworkDrive "S:", "\\cxmserver\data$\softwar e"
if err.number <> 0 then wscript.echo "Error S:" & err.number & " " & err.description
for me for instance returns the following as I have a local "S:" drive:
Trying S:
Error S:-2147024811 The local device name is already in use.
Running these commands instead:
on error resume next
wscript.echo "Trying S:"
objNetwork.MapNetworkDrive
if err.number <> 0 then wscript.echo "Error S:" & err.number & " " & err.description
for me for instance returns the following as I have a local "S:" drive:
Trying S:
Error S:-2147024811 The local device name is already in use.
ASKER
This PC turns out has more problems windows just started to act funny (some menu items missing, doesn't select options and etc) so I don't see reason to deal with it i'll go and rebuild it. Thanks for the thought i will spread the points
ASKER
The problem is not related with script.
Fair enough, trouble when we let users at the Pc's :-)
ASKER
Dim objRootDSE, objTrans, strNetBIOSDomain, objNetwork, strNTName
Dim strUserDN, strComputerDN, objUser, strDNSDomain
Dim strComputer, objComputer, objGroup1, objGroup2
Dim strHomeDrive, strHomeShare
Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path, strUNCPrinter
' Constants for the NameTranslate object.
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
Set objNetwork = CreateObject("Wscript.Netw
' Loop required for Win9x clients during logon.
strNTName = ""
On Error Resume Next
Do While strNTName = ""
strNTName = objNetwork.userName
Err.Clear
If Wscript.Version > 5 Then
Wscript.Sleep 100
End If
Loop
On Error GoTo 0
' Determine DNS domain name from RootDSE object.
Set objRootDSE = GetObject("LDAP://cxmserve
on error resume next
strDNSDomain = objRootDSE.Get("defaultNam
' Use the NameTranslate object to find the NetBIOS domain name from the
' DNS domain name.
Set objTrans = CreateObject("NameTranslat
objTrans.Init ADS_NAME_INITTYPE_GC, ""
objTrans.Set ADS_NAME_TYPE_1779, strDNSDomain
strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE
' Remove trailing backslash.
strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
' Use the NameTranslate object to convert the NT user name to the
' Distinguished Name required for the LDAP provider.
objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strNTName
strUserDN = objTrans.Get(ADS_NAME_TYPE
' Bind to the user object in Active Directory with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
' Bind to a group object in Active Directory with the LDAP provider.
Set objGroup1 = GetObject("LDAP://cn=Softw
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Krono
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Every
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Minit
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Bar Code Group,ou=groups,dc=cxm,dc=
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Payro
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=prism
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=jde documentation group,ou=groups,dc=cxm,dc=
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Micro
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Die Room EDM group,ou=groups,dc=cxm,dc=
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=print
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Die Room Inventory Group,ou=groups,dc=cxm,dc=
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Judie
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Mobil
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=DWG,o
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=all Clear,ou=Groups,dc=cxm,dc=
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=jmill
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set objGroup1 = GetObject("LDAP://cn=Maint
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser
On Error Resume Next
objNetwork.MapNetworkDrive
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDr
objNetwork.MapNetworkDrive
End If
On Error GoTo 0
End If
Set WshNetwork = WScript.CreateObject("WScr
On Error Resume Next
Set WSHPrinters = WSHNetwork.EnumPrinterConn
PrinterPath = "\\cxmserver\Finishing LJ 5si"
PrinterExists = False
For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
If WSHPrinters.Item(LOOP_COUN
PrinterExists = True
End If
Next
If PrinterExists = 0 Then
WshNetwork.AddWindowsPrint
End If
Set objNetwork = Wscript.CreateObject ("WScript.Network")
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
Set objNetwork = Wscript.CreateObject ("WScript.Network")
' Clean up.
Set objRootDSE = Nothing
Set objTrans = Nothing
Set objNetwork = Nothing
Set objUser = Nothing
Set objComputer = Nothing
Set objGroup1 = Nothing
Set objGroup2 = Nothing