Active Directory Library C #

Has anyone seen any solid libraries for working with the active directory (mostly user-related) in C # and asp.net. I better get involved with asp membership or create something customized.

I took a look at LINQtoAD , but it no longer works.

+3
source share
3 answers

Is the assembly and namespace insufficient System.DirectoryServices?

+12
source

If you are using .NET 3.5, also check System.DirectoryServices.AccountManagementfor a much simpler interface when it comes to the principles of managing users, groups, computers, etc.

MSDN S.DS.AD:

.NET Framework 3.5

!

+6

OSS, ActiveRecord ( , AD DirectoryEntry, DirectoryEntry LDAP, IIS, WIN .., lib):

: AD.

using (var userObject = UserObject.FindOneByCN(this.ADOperator, "pangxiaoliang"))
{
     if(userObject.Email == "example@landpy.com")
     {
          userObject.Email = "mv@live.cn";
          userObject.Save();
     }
}

: AD.

// 1. CN end with "liu", Mail conatains "live" (Eg: mv@live.cn), job title is "Dev" and AD object type is user.
// 2. CN start with "pang", Mail conatains "live" (Eg: mv@live.cn), job title is "Dev" and AD object type is user.
            IFilter filter =
                new And(
                    new IsUser(),
                    new Contains(PersonAttributeNames.Mail, "live"),
                    new Is(PersonAttributeNames.Title, "Dev"),
                    new Or(
                            new StartWith(AttributeNames.CN, "pang"),
                            new EndWith(AttributeNames.CN, "liu")
                        )
                    );
// Output the user object display name.
foreach (var userObject in UserObject.FindAll(this.ADOperator, filter))
{
    using (userObject)
    {
        Console.WriteLine(userObject.DisplayName);
    }
}

: .

IFilter filter =
    new And(
        new IsUser(),
        new Custom("(!userAccountControl:1.2.840.113556.1.4.803:=2)")
        );
// Output the user object display name.
foreach (var userObject in UserObject.FindAll(this.ADOperator, filter))
{
    using (userObject)
    {
        Console.WriteLine(userObject.DisplayName);
    }
}

https://landpyactivedirectory.codeplex.com/documentation

AD , , , . AD, , :)

0

Source: https://habr.com/ru/post/1733098/


All Articles