Computer Performance, Windows 2003, Exchange 2003, Logon Scripts

Code Error 80005000 -
An invalid ADSI pathname was passed

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.

Two variations of Code Source: 80005000  Errors

  1. An invalid ADSI pathname was passed (Exchange).
  2. An invalid directory pathname was passed (VBScript)

1) An invalid ADSI pathname was passed

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'.

2) Error Code 80005000 in VBScript

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.WSH Code: 80005000 Error VBScript

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:

Const E_ADS_BAD_PATHNAME= &h80005000

Example of a Script with Error 80005000

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

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


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.