djd23
asked on
Windows Script Host 80041002 error when running a VBS login script
Hey all,
I have deployed a log on script that runs a VBS script. This runs ok on around 30 TS servers, but it comes up with a 80041002 error on 2 of the servers. They are all Windows 2003 SP2 servers running Citrix.
The error shown is
Line: 4
Char: 1
Error: 0x80041002
Code: 80041002
Source: (Null)
The allow.vbs script is -
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv" )
strKeyPath = "Software\Microsoft\Window s\CurrentV ersion\Int ernet Settings\" _
& "ZoneMap\domains\internal. uk\testmai l.ad"
objReg.CreateKey HKEY_CURRENT_USER,strKeyPa th
strValueName = "https"
dwValue = 2
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPa th,strValu eName,dwVa lue
I have no idea what to look for and how to fix this for the two servers that are being affected.
I have deployed a log on script that runs a VBS script. This runs ok on around 30 TS servers, but it comes up with a 80041002 error on 2 of the servers. They are all Windows 2003 SP2 servers running Citrix.
The error shown is
Line: 4
Char: 1
Error: 0x80041002
Code: 80041002
Source: (Null)
The allow.vbs script is -
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv"
strKeyPath = "Software\Microsoft\Window
& "ZoneMap\domains\internal.
objReg.CreateKey HKEY_CURRENT_USER,strKeyPa
strValueName = "https"
dwValue = 2
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPa
I have no idea what to look for and how to fix this for the two servers that are being affected.
What OS and SP are the servers that it works on?
ASKER
Windows 2003 SP2 as well, they should all be the same OS (version & patch level)
There have been a few times I have seen computers have issues with the strComputer = ".", so here is a different way to get the computer name. Try this and let me know if it works any better.
Const HKEY_CURRENT_USER = &H80000001
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "ZoneMap\domains\internal.uk\testmail.ad"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
strValueName = "https"
dwValue = 2
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue
The error code seems to be WBEM_E_NOT_FOUND - can you check whether the registry key in question exists on the machines where the script fails?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers, will give the above a try today.
The other servers run Citrix and are in the same OU, so have the same group Policies applied.
The other servers run Citrix and are in the same OU, so have the same group Policies applied.
ASKER
rlandquist: I get the same error but on line 6 when running your script.
jkr: The key should exist, if nto I would like it created?
RobSampson: This seemed to have done the trick - man thanks
jkr: The key should exist, if nto I would like it created?
RobSampson: This seemed to have done the trick - man thanks
Great. Thanks for the grade.
Regards,
Rob.
Regards,
Rob.