Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Deleted Objects container in VB6 via <WKGUID>

Status
Not open for further replies.

Tomeczek

Programmer
Oct 25, 2012
40
0
0
US
I'm trying to open/read AD Deleted object container using "LDAP://<WKGUID=..." but it fails...
I have to use VB6 (not VB.Net or C#).

Can someone help me?
Here is the failing code:

Code:
Const GUID_DELETED_OBJECTS_CONTAINER_W = "18E2EA80684F11D2B9AA00C04F79F805"

Set oRootDSE = GetObject("LDAP://rootDSE")

sFQDN = oRootDSE.Get("defaultNamingContext")
sDelObjCont = "LDAP://<WKGUID=" & GUID_DELETED_OBJECTS_CONTAINER_W & "," & sFQDN & ">"

Set oDelObjCont = GetObject(sDelObjCont)
'^^^___ fails here:
' Automation error
' There is no such object on the server

thank you in advance!

Tomeczek
 
Looks like VBScript, not VB6.

In any case it sounds like some sort of LDAP syntax issue or something. Examples look like:

Code:
LDAP://<WKGUID=a9d1ca15768811d1aded00c04fd8d5cd,dc=Fabrikam,dc=com>

What is in your sFQDN String?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top