Code Error 80040E14 - Error: One or more errors occurred during processing of command
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
This 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 each tool teaches me more about how the
underlying system operates.
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
Guy
Recommends: Permissions Analyzer - Free Active Directory Tool
I like the
Permissions Monitor because it enables me to see quickly WHO has permissions
to do WHAT. When you launch this tool it analyzes a users effective NTFS
permissions for a specific file or folder, takes into account network share
access, then displays the results in a nifty desktop dashboard!
Think of all the frustration that this free utility saves when you are
troubleshooting authorization problems for users access to a resource.
'* 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.
Guy
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.
Thus utility makes it easy to check the health of a router or firewall. Check the real-time performance and availability statistics for any device
on your network.