This error code, 800401E4 occurs when you execute a VBScript. You are
probably using a WSH method to connect to LDAP. A wild guess, you are
using the command: GetObject("LDAP//:xyz...)
The Symptoms you get
The script does not manipulate the Active Directory object as you had hoped, instead you get a Windows Script Host error message. The probably scenario is that you are trying to
'Get' an LDAP object.
The Cause of Error 800401E4
Incorrect reference to the domain in an LDAP command. Check the lines in your script which reference to Active Directory. For example: LDAP://domain.
Check the Line: number in your script that references
the 'LDAP:// Provider'.
If necessary, work back for previous LDAP occurrences.
Char 1: often lies! it just means that the whole line will not execute. In
the case of runtime errors you can use this work around. Add this line:
On Error Resume Next
‡
Example of Script with a Code 800401E4 error
In my example, it's line 6 is where the problem lies. Plainly, this syntax is gibberish.
Firstly, you need a colon as in LDAP:// Secondly the dc=cp,dc=com is o.k! But Thirdly "&"/Administrators,group" is rubbish.
Set objGroup = GetObject("LDAP//dc=cp,dc=com"&"/Administrators,group")
Now your error will be different from mine, but I hope that you have picked up
enough clues to solve your problem, if not contact me.
Problem Script
Set objRootDSE =
GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objGroup = GetObject("LDAP//dc=cp,dc=com"&"/Administrators,group")
For Each objUser in objGroup.Members
Wscript.Echo objUser.Name
Next
Correction
Set objRootDSE =
GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objGroup = GetObject _ ("LDAP://cn=Administrators, cn=Builtin, dc=CP,dc=com") For each objMember in objGroup.Members Wscript.Echo objMember.Name Next
Try
a different solution, download SolarWinds ipMonitor
Here is my thinking,
ipMonitor will give you valuable data about your network and servers.
This extra information just may unlock the solution to your error code.
One more thing, sometimes when troubleshooting you go around in circles;
therefore if you try a different, but related approach, you may just crack the
problem.
Free Download
of SolarWinds ipMonitor (21 day eval).
Their topics and material are ideal for getting you started with VBScript. The
videos are easy to follow and you can control the pace. Try their free demo material and then see if you want to buy the full package.
See more about VB Script Training CD.