Computer Performance, Windows 2003, Exchange 2003, Logon Scripts

Code Code 800401E4 - Invalid syntax

Troubleshooting Code 800401E4 - Invalid syntax

Introduction to error Code 800401E4

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...)800401E4 - Invalid Syntax LDAP VBScript error

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.

Variation: Table does not exist. Error 80040E37

The Solutions to Invalid Syntax

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

 

Solarwinds IpMonitorTry 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

Computer Training Software - Recommended Training VideosGuy Thomas recommends Computer Training Software

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.


Do you need extra help?

For interpreting the WSH messages check Diagnose 800 errors.

For general advice try my 7 Troubleshooting techniques

Give something back?

Would you like to help others?  If you have a good example of this error, then please email me, I will publish it with a credit to you:

 *


Google

Webcomputerperformance.co.uk

GFi Events Manager

Guy Recommends: GFi EventsManager

Here is a solution to monitor, manage and archive thousands of events that are generated by devices across your entire network.  Get your free evaluation copy of GFI EventsManager.

 

Home Copyright © 1999-2008 Computer Performance LTD All rights reserved

Please report a broken link, or an error.