zoukankan      html  css  js  c++  java
  • Landpy.ActiveDirecoty,按照Active Record Pattern设计的方便Lib开源发布

    想方便的操作AD吗,不想记住那么多AD Attribute名称和常量?请使用Landpy.ActiveDirecoty库,按照Active Record Pattern设计的AD Lib已经在CodePlex上开源发布。

    目前已知BoostSolutions AD产品线、Sony公司内部系统、Tempursealy公司、Lenovo公司使用。

    http://landpyactivedirectory.codeplex.com/

    Project Description

    Active Directory Object Model Library, which will help you to operate AD easily!
    This lib will bring you to the AD Active Record Parttern world, enjoy it now!

    Operate the Active Directory object with Active Record pattern, forget hundreds of the AD attribute names and AD attribute const values, forget all the details of the ActiveDirectory and enjoy your self.
    And you can also use the code to generate the filter to get the AD object search result, all the code is clear and simple. 
    More over: With the using code block you will dispose the no management resource easily. 
    Note: For more information and the getting start please visit the linkhttps://landpyactivedirectory.codeplex.com/documentation

    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);
        }
    }

     

  • 相关阅读:
    #研发解决方案#研发协作平台CloudEngine
    人生做出的选择越多,友谊的小船翻得越快?
    告诉别人你是谁:边界的那些事儿
    如何从零开始搭建一个技术平台?
    Windows10 自动配置切换IP地址
    Human disease database
    R语言install.packages("jpeg")报错
    RStudio中,出现中文乱码问题的解决方案(修改文件编码)
    How do I run Adobe Flash on Chrome?
    RGB颜色查询对照表
  • 原文地址:https://www.cnblogs.com/pangxiaoliang/p/ActiveDirectory.html
Copyright © 2011-2022 走看看