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.

4

1 回答 1

0

我认为您是 .VB 文件,其中包含以下行:

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)

我想你有一些发行。在其中,您正在使用此部分构建一个 URL: "LDAP://{0}/OU=" & strOUForAccounts & ",DC=" & strDomain & ",DC=hilton,DC=com"

所以首先,最后一点,,DC=hilton,DC=com显然不是您的域信息。并且可能应该以某种方式存储在配置文件中。就像在您的 .App 文件中一样,但格式正确。您可以看到他们尝试使用 DC=strDomain 值,但当然,希尔顿的东西显然是不正确的。(除非它真的是?)。

希望这{0}部分有效,但不确定传递给它的是什么。

于 2013-04-04T13:06:38.987 回答