Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Viewing hidden or deleted Exchange objects via ADSI/LDAP


View products that this article applies to.

This article was previously published under Q196850

↑ Back to the top


Summary

In order to view hidden and deleted objects in the Exchange directory, you must explicitly connect to the server as an Exchange admin account and specify an additional username component of "cn=admin".

↑ Back to the top


More information

You can bind explicitly as an admin by using a Bind DN (ADSI username) of the following form:
   "cn=username,dc=domain,cn=admin"
				
The username and domain should be replaced with appropriate values, while the cn=admin portion is literal and should be used as is.

The following Microsoft Visual Basic code illustrates binding as an admin using ADSI LDAP:
   Set adsNS = GetObject("LDAP:")
   Set adsObj = adsNS.OpenDsObject(strObjName,"cn=" & strUser & ",dc=" & _

      strDomain & ",cn=admin" , strPassword, 0 )
				
NOTE: When you connect with "cn=admin", hidden and deleted objects appear mixed with normal objects. You must test for (or filter on) the Is-Deleted or Hide-From-Address-Book properties to distinguish them from normal objects.

↑ Back to the top


References

For more information about using ADSI, Lightweight Directory Access Protocol (LDAP), and Exchange, visit the following Microsoft Web site: For additional information about using LDAP to view hidden and deleted objects, click the following article number to view the article in the Microsoft Knowledge Base:
185475� LDAP search returns no entries for hidden or deleted objects

↑ Back to the top


Keywords: KB196850, kbinfo, kbapi

↑ Back to the top

Article Info
Article ID : 196850
Revision : 5
Created on : 3/1/2005
Published on : 3/1/2005
Exists online : False
Views : 351