[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1524
  • Last Modified:

eDirectory/LDAP and VB.NET

I am attemping to connect to our eDirectory using VB.NET via LDAP and I keep getting a "InteropServices.COMException" exception. I am able to connect to our eDirectory using an LDAP Browser anonymously. Here is a snippet of my code:

Imports System.DirectoryServices

Public Sub New()
    dim root as new directoryEntry("ldap://xx.xxx.x.xxx")
    dim searcher as new directorysearcher(root)
    search.filter = ("cn=Username")
    search.searchscope = searchscope.subtree
    dim results as searchresultcollection
    results = search.findall()    <--- failing here
End Sub

Any assistance would be appreciated
0
liebrand
Asked:
liebrand
  • 2
  • 2
1 Solution
 
Bob LearnedCommented:
What is the full text of the Interop exception?
0
 
liebrandAuthor Commented:
I figured it out...  the path had to have an uppercase LDAP:// (i had ldap://)   very strange....


I would like to close this PAQ.
0
 
Bob LearnedCommented:
You need to post a question in Community Support to close this question.
0
 
liebrandAuthor Commented:
Ok -- thanks...

I was re-reading the directoryservices overview and I saw this under the path property:

"Note   The portion of the Path that identifies the provider (precedes "://") is case sensitive. For example, "LDAP://" or "WinNT://"."
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now