I haven't worked with an LDAP before so I am a bit lost. I need to connect to an LDAP source find a specific attribute and change it. The input for the program is a CSV file with a list of users. The program is supposed to read the UID from the CSV file find the record in the LDAP and replace a certain attribute. I haven't a clue how to do this. Could any one point me in the right direction please?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
@KenL Almost got me there. I also had to set the AuthenticationType of the DirectoryEntry to get it to work. Also, pay attention to how you are using wildcards (Kleene Stars).
code wise it is a lot simpler than you think. You need to create a connection to the directory, set up a searcher, then search by property name.
SType is the name type, and Name is the actual user name
First Element of response, using ADSI (old fashion)
How to do Almost everything (with ADSI) on Active Directory with C#
Second Element of response, begining .NET 3.5 Microsoft introduce 'Principal' and 'AccountManagement'.
How to do Almost everything (with AccountManagement) on Active Directory with C#
Third Element of response, you can use low level (native LDAP) protocol with System.DirectoryServices.Protocols (S.DS.P).