Skip to content

GeyserLaPunk/ActiveDirectory

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 

Repository files navigation

About 7 years history - start from 2010 (https://landpyactivedirectory.codeplex.com/), which will help you to manage Active Directory easily! This library has been used in Lenovo, Tempursealy, Sony, BoostSolutions and other corporations. Enjoy it! I have started my biz! https://fewbox.com

Get From Nuget: https://www.nuget.org/packages/Landpy.ActiveDirectory/

.Net Core Version

E.G: Update a user AD object.

using (var userObject = UserObject.FindOneByCN(this.ADOperator, “pangxiaoliang”))``
{
     if(userObject.Email == "[email protected]")``
     {
          userObject.Email = "[email protected]";``
          userObject.Save();``
     }
}

E.G: Query user AD objects.

// 1. CN end with "liu", Mail conatains "live" (Eg: [email protected]),
// job title is "Dev" and AD object type is user.
// 2. CN start with "pang", Mail conatains "live" (Eg: [email protected]),
// 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);
    }
}

E.G: 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);
    }
}

About

Active Directory Object Model Lib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 94.0%
  • GAP 6.0%