Troubleshooting Code Error 80005000 - An invalid ADSI pathname was passed
My main interest is in VBScript code errors, however code
80005000 is also a common error when installing Exchange. The common thread is an error with the directory pathname. This error is also referred to as E_ADS_BAD_PATHNAME.
When you run Microsoft Exchange 2003 (2000) Server Setup with the /forestprep
switch, the installation fails and you may receive the above error message.
The Cause of error 80005000 in Exchange
You run setup /forestprep, but it does not complete properly. Active Directory 'flags' that it has been run, but in reality it did not finish.
Check the server progress log for entries like.
(G:\admin\src\udog\setupbase\basecomp\baseatom.cxx:775)
Error code 0X80005000 (20480): An invalid ADSI pathname was passed.
The Solution for Exchange
Open ADSI Edit.
Navigate to this location under the Configuration container:
CN=Configuration; CN=Services; select CN=Microsoft Exchange
Right-click CN=Microsoft Exchange, and then click Properties. From the Attributes tab, under Select which properties to view, click Both.
From the Select what property to view pull-down menu, select Heuristics.
If the value is set to 2, then you have already run ForestPrep.
Solution, reset the Heuristics property, click Clear, and then click Apply. The Value(s) field will have
change to 'not set'.
This variation of error code 80005000 occurs when you execute a VBScript.
Error: An invalid directory pathname was passed
Source: Active Directory
The Symptoms you get 80005000
When you execute the script you get a WSH message box like this (See diagram). The
VBScript does execute as you hoped.
One possibility is that you are using an LDAP object which has
been misspelled. Another cause could be missing speech marks in a
value.
The Cause of Code Error 80005000
Your VBScript contains an illegal LDAP reference, probably a typing
mistake, maybe an extra letter.
In this particular instance there is a knock on effect of a variable not
being properly declared. When the script needs to use the variable in line
8, WSH flags the error as Code 80005000.
The Solutions to Error 80005000
Check the spelling of all your objects and methods. Look for clues
particularly in the Line: x number. However, in this particular example the root
cause is earlier in line 4.
Another plan would be to introduce error correcting code using E_ADS_BAD_PATHNAME for example:
Briefly, the idea of the script is to create a new user using the variable
guyname. The problem is that the value of guyname is not in speech
marks.
Problem Line 4 - strNewUser = bilbo277
Solution Line 4 - strNewUser = "bilbo277"
'CREATE USER AND SET PASSWORD Dim strNewUser, strPasswd
strNewUser = bilbo277 strPasswd = Pa££w0rd Set objOU=GetObject("LDAP://ou=Droitwich,dc=cp,dc=com") set objUser =
objOU.Create("User","cn="& strNewUser) objUser.Put "sAMAccountName","bilbo577" ObjUser.SetInfo objUser.SetPassword strPasswd
Solution with double quotes around the variable.
'CREATE USER AND SET PASSWORD Dim strNewUser, strPasswd
strNewUser = "bilbo277" strPasswd = Pa££w0rd Set objOU=GetObject("LDAP://ou=Droitwich,dc=cp,dc=com") set objUser =
objOU.Create("User","cn="& strNewUser) objUser.Put "sAMAccountName","bilbo577" ObjUser.SetInfo objUser.SetPassword strPasswd
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
Another Example of Error 80005000
The problem is the order of group, domain
The correct sequence is group, domain. Also ou, domain.
Perhaps you can spot the error on line
16, domain, strContainer.
' GroupEnum.vbs ' Sample VBScript to discover who is a member or the Administrators ' Author Guy Thomas http://computerperformance.co.uk/ ' Version 1.2 May 2005 '
----------------------------------------------------------' Option Explicit Dim strMember, strDNSDomain, strContainer Dim objGroup, objRootDSE, arrMemberOf
' Bind to Active Directory'
strContainer = "cn=Administrators,cn=Builtin, " Set objRootDSE = GetObject("LDAP://RootDSE") strDNSDomain = objRootDSE.Get("DefaultNamingContext")
' Get the Builtin Administrators group Set
objGroup = GetObject ("LDAP://" & strDNSDomain & strContainer ) objGroup.getInfo
arrMemberOf = objGroup.GetEx("member")
' Loop = For Each .... Next WScript.Echo "Members of Group " &
strContainer For Each strMember in arrMemberOf WScript.echo strMember Next
Wscript.Quit
' End of Sample Group Enum Member Script
Another Example of Error 80005000
' GroupEnum.vbs ' Sample VBScript to discover who is a member or the Administrators ' Author Guy Thomas http://computerperformance.co.uk/ ' Version 1.2 May 2005 '
----------------------------------------------------------' Option Explicit Dim strMember, strDNSDomain, strContainer Dim objGroup, objRootDSE, arrMemberOf
' Bind to Active Directory'
strContainer = "cn=Administrators,cn=Builtin, " Set objRootDSE = GetObject("LDAP://RootDSE") strDNSDomain = objRootDSE.Get("DefaultNamingContext")
' Get the Builtin Administrators group Set
objGroup = GetObject ("LDAP://" & strContainer & strDNSDomain ) objGroup.getInfo
arrMemberOf = objGroup.GetEx("member")
' Loop = For Each .... Next WScript.Echo "Members of Group " &
strContainer For Each strMember in arrMemberOf WScript.echo strMember Next
Wscript.Quit
' End of Sample Group Enum Member Script
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.