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);
}
}
Landpy.ActiveDirecoty,按照Active Record Pattern设计的方便Lib开源发布的更多相关文章
- Martin Fowler’s Active Record design pattern.
P of EAA: Active Record https://www.martinfowler.com/eaaCatalog/activeRecord.html Active Record An o ...
- DAL、DAO、ORM、Active Record辨析
转自:http://blog.csdn.net/suiye/article/details/7824943 模型 Model 模型是MVC中的概念,指的是读取数据和改变数据的操作(业务逻辑).一开始我 ...
- Yii的学习(5)--Active Record的关联
官网原文:http://www.yiiframework.com/doc/guide/1.1/zh_cn/database.arr 官网中后半段为英文,而且中文的内容比英文少一些,先放到这里,之后有时 ...
- Yii的学习(4)--Active Record
摘自Yii官网:http://www.yiiframework.com/doc/guide/1.1/zh_cn/database.ar 在官网原文的基础上添加了CDbCriteria的详细用法. 虽然 ...
- Active Record 数据库模式-增删改查操作
选择数据 下面的函数帮助你构建 SQL SELECT语句. 备注:如果你正在使用 PHP5,你可以在复杂情况下使用链式语法.本页面底部有具体描述. $this->db->get(); 运行 ...
- Active Record: 資料庫遷移(Migration) (转)
Active Record: 資料庫遷移(Migration) Programming today is a race between software engineers striving to b ...
- Android开源库--ActiveAndroid(active record模式的ORM数据库框架)
Github地址:https://github.com/pardom/ActiveAndroid 前言 我一般在Android开发中,几乎用不到SQLlite,因为一些小数据就直接使用Preferen ...
- Active Record快速入门指南
一.概述 Active Record(中文名:活动记录)是一种领域模型模式,特点是一个模型类对应关系型数据库中的一个表,而模型类的一个实例对应表中的一行记录.关系型数据库往往通过外键来表述实体关系,A ...
- Yii Active Record 查询结果转化成数组
使用Yii 的Active Record 来获取查询结果的时候,返回的结果集是一个对象类型的,有时候为了数据处理的方便希望能够转成数组返回.比如下面的方法: // 查找满足指定条件的结果中的第一行 $ ...
随机推荐
- 149. Best Time to Buy and Sell Stock【medium】
Say you have an array for which the ith element is the price of a given stock on day i. If you were ...
- 解决python2.7 UnicodeDecodeError和UnicodeEncodeError问题
最近在项目中,读取上传的csv文件,并写入时,会报编码问题, with open(origin_file_path, mode='wb')as f: for chunk in file_obj: f. ...
- Spark性能优化指南——基础篇转
前言 在大数据计算领域,Spark已经成为了越来越流行.越来越受欢迎的计算平台之一.Spark的功能涵盖了大数据领域的离线批处理.SQL类处理.流式/实时计算.机器学习.图计算等各种不同类型的计算操作 ...
- oracle相关链接
shilei1的个人空间 http://blog.itpub.net/196700/
- JS中split用法和数组中元素的删除
JS中split用法 <script language="javascript"> function spli(){ datastr="2,2,3,5,6,6 ...
- js 图表插件 chartjs 2.4
PS:该图表插件对手机端支持挺好 网上的文章大多数的参数都是老版本的过时的,最新api查看官网http://www.chartjs.org/docs/ 下载地址 https://github.com ...
- string.h中的库函数
虽然面试的时候,都会叫你不使用c库函数,自己完成某某函数的编写,但是库函数毕竟更让人信赖,我们没有任何理由怀疑库函数而使用自己的版本.不过当做练习,自己还是可以实现一下的.这里记录一下5th c pr ...
- Clock函数用法
clock()是C/C++中的计时函数,而与其相关的数据类型是clock_t.在MSDN中,查得对clock函数定义如下: clock_t clock(void) ; 这个函数返回从“开启这个程序进程 ...
- cocos2dx遇到的坑1
记录下在cocos2dx 2.x时代遇到的问题 1.节点的观念,用节点来管理 2.pushscene popscene 和replacewithscene runwithscene对应 3.lua里释 ...
- 我的电脑(ACER 4750G)升级
升级原因 近期电脑卡的要死,卡到什么程序呢?就是打开"我的电脑"须要2秒中的缓冲时间,这怎样受的了--于是就有种特别想换电脑的冲动:买一个顶配版的台式机.让你给我慢. 一心想着顶配 ...