0

以下是相关代码:

    string ldapPath = Settings.Default.LDAPServer + Settings.Default.StartPath;
entry = new DirectoryEntry(ldapPath, username, password, AuthenticationTypes.None);
     `entry.Properties[propertyName]` // The exception is throwed at this line inside of 

GetAllOccurencesOfProperty- 方法:

这是错误消息:

2013-04-23 13:55:44,895 ERROR [12] EPiServer.DataAbstraction.ScheduledJob.ExecuteStaticMethod - 3.1.2 Failed to execute job 94d9b172-591b-4893-8d29-1204b99cf8bd
System.Exception: CurrentPrincipal: eivind. LDAP: ldap://DC.opent_dom.local:389/. Error:System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at SSP.ADPhonebook.Job.LDAP.GetAllOccurencesOfProperty(DirectoryEntry entry, String propertyName) in C:\repo\products\EPiServer\src\trunk\SSP.ADPhonebook\Job\LDAP.cs:line 80
at SSP.ADPhonebook.Job.ADOUAndUserImport.Import.GetDirectoryEntryPage(DirectoryEntry entry) in C:\repo\products\EPiServer\src\trunk\SSP.ADPhonebook\Job\ADOUAndUserImport.cs:line 117
at SSP.ADPhonebook.Job.ADOUAndUserImport.Import.Execute() in C:\repo\products\EPiServer\src\trunk\SSP.ADPhonebook\Job\ADOUAndUserImport.cs:line 61
at SSP.ADPhonebook.Job.ADOUAndUserImport.Execute() in C:\repo\products\EPiServer\src\trunk\SSP.ADPhonebook\Job\ADOUAndUserImport.cs:line 31
at SSP.ADPhonebook.Job.ADOUAndUserImport.Execute() in C:\repo\products\EPiServer\src\trunk\SSP.ADPhonebook\Job\ADOUAndUserImport.cs:line 39

ldapPath: ldap://DC.opent_dom.local:389/OU=Rådmann,OU=Jevnaker Kommune,OU=brukere,DC=opent_dom,DC=local

我可以在 LDAP 浏览器中浏览该地址。

4

1 回答 1

0

解决方案: ldap必须大写。我ldap://DC.opent_dom.local:389/OU=Rådmann,OU=Jevnaker Kommune,OU=brukere,DC=opent_dom,DC=local改为

LDAP://DC.opent_dom.local:389/OU=Rådmann,OU=Jevnaker Kommune,OU=brukere,DC=opent_dom,DC=local
于 2013-04-23T13:03:38.397 回答