Landpy Active Directory Library.

Rating: No reviews yet
Downloads: 657
Change Set: 46886
Released: Sep 2, 2016
Updated: Sep 2, 2016 by pangxiaoliang
Dev status: Stable Help Icon

Recommended Download

Application Landpy.ActiveDirectory.zip
application, 75K, uploaded Sep 2, 2016 - 657 downloads

Release Notes

Landpy Active Directory Library with Active Record pattern!

You can get it from Nuget Package Manager now!

Eg: Update a user AD object.
using (var userObject = UserObject.FindOneByCN(this.ADOperator, “pangxiaoliang”))
{
     if(userObject.Email == "example@landpy.com")
     {
          userObject.Email = "mv@live.cn";
          userObject.Save();
     }
}


Eg: Query user AD objects.
// 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);
    }
}


Eg: Custom query.
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);
    }
}


Note: For more information and the getting start please visit the link https://landpyactivedirectory.codeplex.com/documentation

Reviews for this release

No reviews yet for this release.