Error Code 8000500D - The directory property cannot be found in the cache
Troubleshooting Code 8000500D - The directory property cannot be found in
the cache
Introduction to Code Error 8000500D
This error, code 8000500D usually occurs when you execute a VBScript. WSH error codes 80005xxx point to the error being an object outside the VBScript itself. This error is also known as E_ADS_PROPERTY_NOT_FOUND.
My suggestion is that there is a typo in the LDAP reference in your script.
The Symptoms You Get 8000500D
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 property that has
been misspelt.
The Cause of Code 8000500D
Your VBScript contains an illegal LDAP reference, probably a typing
mistake, maybe an extra letter. Check the spelling of your objects in
the script. Note, a clue in the last line Source: Active Directory.
The Solutions
Double check each of your LDAP objects. In particular, look for naming errors, in this
example it would be in Line: 5. Unfortunately, Char 1: often lies! it just means that
the whole line will not execute.
Another line of attack could be to introduce error correcting code using E_ADS_PROPERTY_NOT_FOUND for example:
Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D
Example 1 of Code 8000500D Script
Note: The Line: 5 deefaultNamingContext
Correction: It should have been defaultNamingContext
'Script to Create a new user account in the GuyDemo OU
'Script created by Guy Thomas
Set oRoot = GetObject("LDAP://rootDSE")
Set oDomain = GetObject("LDAP://" & oRoot.Get("deefaultNamingContext"))
Set oOU=oDomain.Create("organizationalUnit", "ou=GuyDemo")
oOU.Put "Description", "Guy's Script Pure OU"
oOU.SetInfo
Set oUser = oOU.Create("User", "cn=Guy Thomas")
oUser.Put "sAMAccountName", "GuyThomas"
oUser.Put "Description", "Guy's Script made this User"
oUser.SetInfo
oUser.SetPassword "dem0Gu1do"
oUser.AccountDisabled = True
oUser.SetInfo
Wscript.Echo "Success, Check Active Directory Users and Computers - Remember F5"
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.
Example 3 - The phantom space causes : 8000500D Script - The directory property cannot be found in the cache
Problem: objmemberOf = objUser.GetEx("memberOf ")
Solution close up the space objmemberOf = objUser.GetEx("memberOf")
' UsermemberOf .vbs ' To list the groups to which the administrator is a memberOf ' Author Guy Thomas http://computerperformance.co.uk/ ' Version 2.3 - May 2010 '
---------------------------------------------------------------' Option Explicit Dim objRootLDAP, objGroup, objUser, objOU, objmemberOf Dim strOU, strUser, strDNSDomain, strLDAP, strList
'
Commands to bind to AD and extract domain name Set objRootLDAP = GetObject("LDAP://RootDSE") strDNSDomain = objRootLDAP.Get("DefaultNamingContext")
' Build the LDAP DN from strUser, strOU and
strDNSDomain strUser ="cn=Administrator," strOU ="CN=Users," strLDAP ="LDAP://" & strUser & strOU & strDNSDomain
Set objUser = GetObject(strLDAP)
' Heart of the script, extract a list of Groups from memberOf objmemberOf = objUser.GetEx("memberOf ") For Each objGroup in objmemberOf strList = strList & objGroup & vbcr Next
WScript.Echo "Groups for " & strUser & vbCr
& strList
WScript.Quit
' End of Sample User memberOf VBScript
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.