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 来获取查询结果的时候,返回的结果集是一个对象类型的,有时候为了数据处理的方便希望能够转成数组返回.比如下面的方法: // 查找满足指定条件的结果中的第一行 $ ...
随机推荐
- Python 2.7.9 Demo - 019.01.CRUD oracle by cx_Oracle
select #coding=utf-8 #!/usr/bin/python import cx_Oracle; conn = None; cursor = None; try: conn = cx_ ...
- AngularJS 初始化加载流程
一.AngularJS 初始化加载流程 1.浏览器载入HTML,然后把它解析成DOM.2.浏览器载入angular.js脚本.3.AngularJS等到DOMContentLoaded事件触发.4.A ...
- #include<algorithm>里的函数
#include<algorithm>里的函数 #include<algorithm> 非修改性序列操作(12个) 循环 对序列中的每个元素执行某操作 for_ ...
- 基于jQuery点击圆形边框弹出图片信息
分享一款基于jQuery点击圆形边框弹出图片信息.这是一款鼠标经过图片转换成圆形边框,点击可弹出文字信息.效果图如下: 在线预览 源码下载 实现的代码. html代码: <div id=&q ...
- 如何在linux下实现mysql数据库每天自动备份
建备份文件夹: mkdir mysql_data_bak 建脚本文件: touch autobackupmysql.sh 打开文件 vi autobackupmysql.sh 在脚本中加入如下内容: ...
- efm32 si446x
Linking target: example-trickle.stk3700arm-none-eabi-gcc -Xlinker -Map=example-trickle.stk3700.map - ...
- 老生常谈:vim 配置
1.自动补全 插件名字:NeoComplCache 下载地址:http://www.vim.org/scripts/script.php?script_id=2620 配置:把文件直接复制到vimfi ...
- 嘿, 你知道吗, 再也不需要for循环了!
做一个优雅的程序员 JavaScript是一门优雅的语言, 这个'优雅'体验在JS逻辑层次处于高段位的水平, 什么意思呢, 就是一个js应用的主线剧情一定全部是函数式表达的高层可读逻辑, 还是不懂? ...
- Mysql: Connect/C++ 使用过程中发现返回 std::string 造成的内存泄露
在使用 Connect/C++ ,测试时发现在调用 getString 出现了内存增长的情况. ConstructOutput(); //打印出当前内存 ;i<;++i) { prepareSt ...
- 【转】iOS-APP如何做才安全
iOS应用的安全性 常常被大家忽视. iOS 如何做才安全: 1.首先,我们可以通过iTunes 下载 AppStore的ipa文件(苹果 把开发者上传的ipa包 进行了加壳再放到AppStore中) ...