2

I am a beginner with Ldap Server. I am trying to establish connection with my server using LDAP Wizard but dont know the values of the various parameters. could any body suggest the values? I am writing the code which is used to connect to the same server.

From App.Config:

<add key="ActiveDirectoryMainOU" value="Users" />
<add key="ActiveDirectoryDomain" value="intranet" />
<add key="ActiveDirectoryServer" value="intranet.city.com" />
<add key="ServiceAccountUserID" value="superUser" />
<add key="ServiceAccountPassword" value="P0R+@asq" />

From .vb file

...............

strDomain = ConfigurationSettings.AppSettings.Get("ActiveDirectoryDomain")
strDomainControllerLoadBalanced = ConfigurationSettings.AppSettings.Get("ActiveDirectoryServer")
strOUForAccounts = ConfigurationSettings.AppSettings.Get("ActiveDirectoryMainOU")
strServiceAccountUserID = ConfigurationSettings.AppSettings.Get("ServiceAccountUserID")
strServiceAccountPassword = ConfigurationSettings.AppSettings.Get("ServiceAccountPassword")
Try
    searchRoot = New DirectoryEntry(String.Format("LDAP://{0}/OU=" & strOUForAccounts & ",DC=" & strDomain & ",DC=city,DC=com", strDomainControllerLoadBalanced),             strServiceAccountUserID, strServiceAccountPassword, AuthenticationTypes.Secure Or AuthenticationTypes.Sealing Or AuthenticationTypes.ServerBind)
        searcher = New DirectorySearcher(searchRoot)
    searcher.SearchScope = SearchScope.Subtree
    searcher.PageSize = 1000
    searcher.CacheResults = False
    For i = 0 To arPropertiesToLoad.Length - 1
        searcher.PropertiesToLoad.Add(arPropertiesToLoad(i))
    Next
        searcher.Filter = "(&(objectCategory=user)(objectClass=person))" 'get all users
        results = searcher.FindAll()
        For Each result In results
         strObjectGUID = New Guid
             strValues(69) = New String("")

...............

Please suggest in completeing step 3 of profile creation wizard or in completing below fields:

Authentication method(Annonymous, Currently logged on, external(SSL certificate),other)

Mechanism, Principal, Password

also if possible please help in completing next step as well. I am not able to add screenshot because of less reputation.

14578446
  • 1,044
  • 7
  • 30
  • 50

1 Answers1

0

I think you .VB file, where it has this line:

searchRoot = New DirectoryEntry(String.Format("LDAP://{0}/OU=" & strOUForAccounts & ",DC=" & strDomain & ",DC=hilton,DC=com", strDomainControllerLoadBalanced), strServiceAccountUserID, strServiceAccountPassword, AuthenticationTypes.Secure Or AuthenticationTypes.Sealing Or AuthenticationTypes.ServerBind)

I think you have some issued. Inside it, you are building a URL with this part: "LDAP://{0}/OU=" & strOUForAccounts & ",DC=" & strDomain & ",DC=hilton,DC=com"

So first off, the last bit, ,DC=hilton,DC=com is clearly not your domain info. And should probably be stored in the config file somehow. Like in your .App file but in the right format. You can see they try to use the DC=strDomain value but of course, the hilton stuff is clearly not right. (Unless it really is?).

Hopefully the {0} part works, not sure what is being passed into that.

geoffc
  • 4,030
  • 7
  • 44
  • 51
  • changed hilton to 'city' which is my domain, could you suggest something now? – 14578446 Apr 05 '13 at 08:52
  • @14578446 I would suggest tracing out the complete LDAP URL in debug, then trying that LDAP URL outside your code. – geoffc Apr 05 '13 at 12:03