Error 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

Recommended: Solarwinds’ Permissions Analyzer – Free Active Directory ToolFree Permissions Analyzer for Active Directory

I like thePermissions Analyzer because it enables me to see WHO has permissions to do WHAT at a glance.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, and takes into account network share access, then displays the results in a nifty desktop dashboard!

Think of all the frustration that this free SolarWinds utility saves when you are troubleshooting authorization problems for user’s access to a resource.  Give this permissions monitor a try – it’s free!

Download SolarWinds’ Free Permissions Analyser – Active Directory Tool

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

 

See More Windows Update Error Codes 8004 Series

Error 80004005 Unspecified Error   •Error 80041021   •Error 80041001   •Error 80041002

Error 80048820   •Error 8004100E   •Review of SolarWinds Application Monitor (SAM)

Error 80040E14   • Error 80040E37   • Error 80041006   • Error 80041006

Solarwinds Free WMI MonitorGuy Recommends: WMI Monitor and It’s Free!

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.  Fortunately, SolarWinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor


Do you need additional help?

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:

If you like this page then please share it with your friends