Troubleshooting Code 80040E14 - One or more errors occurred during
processing of command
Introduction to error Code 80040E14
This error code, 80040E14 occurs when you execute a VBScript. You are
probably using a WSH method to connect to LDAP. My wild guess is that there is extra speech mark, or there is something fishy with one of your quotation marks.
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
manipulate an LDAP object.
The Cause of Code 80040E14
The most likely cause is incorrect reference to the domain in your LDAP command. Check lines which reference Active Directory, for example: LDAP://domain.
Check the Line: number in your script that references the 'Provider'.
If necessary, work back for previous occurrences of LDAP. Incidentally, 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
Guy Recommends: SolarWinds Engineer's Toolset v10
The Engineer's Toolset v10 provides a
comprehensive console of utilities for troubleshooting computer problems. Guy says
it helps me monitor what's occurring on the network, and the tools
teaches me more about how the system literally operates.
There are so many good gadgets, it's like having free rein of a
sweetshop. Thankfully the utilities are displayed logically: monitoring, discovery, diagnostic, and Cisco tools.
Download your copy of the Engineer's Toolset v 10
Example of a VBScript with Error 80040E14
In this instance, you need to pay close attention to the speech marks. Note the error is actually on line 15: it should be 'LDAP:// & strDomain ' .
One pair of single quotes. Not 'LDAP:// ' & strDomain ' with extra single quote.
I just could not get the script to work with the strDomain variable......
Until I mastered binding to LDAP.
Example Script 1
' Get Domain name
from RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDomain = objRootDSE.Get("DefaultNamingContext")
WScript.Echo strDomain ' This is Extra line Guy put in to test
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "Select printerName, serverName from " _
& " 'LDAP://' & strDomain ' where objectClass='printQueue'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo "Printer Name: " & objRecordSet.Fields("printerName").Value
Wscript.Echo "Server Name: " & objRecordSet.Fields("serverName").Value
objRecordSet.MoveNext
Loop
Example Script 2 - Kindly Sent in by Steven McCarty
Option Explicit '* On Error Resume Next
is enabled for the WScript.Echo to show Err.Number On Error Resume
Next
'* Dimension variables Dim objCommand, objConnection, objRecordSet,
strLDAPQuerySearch, strLDAPQueryReturn, strLDAPQueryScope,
strLDAPQueryCommandText 'Initialize Objects Set objCommand =
CreateObject("ADODB.Command") Set objConnection = CreateObject("ADODB.Connection")
'* Normally, I use the extract query out of ADUC, but '* forget
that ADUC places a wrapper around the query. '* This query will fail
with 80040E14 strLDAPQuerySearch = "(&(objectCategory=group)(objectClass=group)(dLMemSubmitPerms=*))(!(dLMemSubmitPerms=A
'Test' Group))" WScript.Echo strLDAPQuerySearch strLDAPQueryReturn
= "sAMAccountName, cn, ADsPath" strLDAPQueryScope = "subtree"
strLDAPQueryCommandText = "<LDAP://" & GetObject("LDAP://RootDSE").Get(("defaultNamingContext"))
& ">;" & strLDAPQuerySearch & ";" & strLDAPQueryReturn & ";" &
strLDAPQueryScope objCommand.ActiveConnection = objConnection
objCommand.CommandText = strLDAPQueryCommandText
objCommand.Properties("Page Size") = 99 Err.Clear Set objRecordSet
= objCommand.Execute WScript.Echo Hex(Err.Number)
'* If we place the same AND wrapper around the query, ' as ADUC
does, the query will not fail strLDAPQuerySearch = "(&" &
strLDAPQuerySearch & ")" WScript.Echo strLDAPQuerySearch
strLDAPQueryCommandText = "<LDAP://" & GetObject("LDAP://RootDSE").Get(("defaultNamingContext"))
& ">;" & strLDAPQuerySearch & ";" & strLDAPQueryReturn & ";" &
strLDAPQueryScope objCommand.CommandText = strLDAPQueryCommandText
Err.Clear Set objRecordSet = objCommand.Execute WScript.Echo Hex(Err.Number)
Using Windows Explorer, navigate to %systemroot%\system32\wbem directory and
delete the Repository directory. By default, the repository folder is located in the C:\Windows\system32\wbem directory. Switch to Command Prompt window, and type: net start winmgmt
Re-Register
the DLLs
The .DLL and .EXE files which WMI uses are located in %windir%\system32\wbem. This is how you re-register all the .DLL and .EXE files in the WBEM directory. To re-register the WMI components, run
the following commands at the command prompt:
cd /d %windir%\system32\wbem for %i in (*.dll) do RegSvr32 -s %i for %i in (*.exe) do %i /RegServer
Re-Install WMI files
If you suspect
that the WMI files are damaged, then you could re-install them from the Windows Server 2003 or XP CD. Here is the nifty command:
I thank Riaan, Shane and Ramesh for supplying this extra information on WMI Errors in general and 80041xxx in particular.
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.