SSIS使用Script task处理Active Directory
来源:互联网 发布:unity3d怎么导入模型 编辑:程序博客网 时间:2024/05/24 08:33
SSIS的Script Task有着很大的自由度,可以通过写代码的方式来实现各种各样的需求。
这里以C#代码为例,对AD信息进行操作。
首先需要添加引用System.DirectoryServices
然后修改main方法即可进行下一步操作
/// <summary> /// This method is called when this script task executes in the control flow. /// Before returning from this method, set the value of Dts.TaskResult to indicate success or failure. /// To open Help, press F1. /// </summary>public void Main(){ try { // get the directory entry root DirectoryEntry dirEntry = new DirectoryEntry(); dirEntry.Path = "LDAP://CNSRVADC01/DC=CORP,DC=Intra"; DirectoryEntries adUsers = dirEntry.Children; DirectoryEntry adUser; // search users DirectorySearcher deSearch = new DirectorySearcher(); deSearch.Filter = ("(&(objectClass=User) (objectCategory=Person))"); deSearch.SearchRoot = dirEntry; SearchResultCollection results = deSearch.FindAll(); for (int i = 0; i < results.Count; i++) { adUser = new DirectoryEntry(results[i].Path); //...add code here to handle the AD INFO } Dts.TaskResult = (int)ScriptResults.Success; } catch (Exception ex) { Dts.TaskResult = (int)ScriptResults.Failure; }}
0 0
- SSIS使用Script task处理Active Directory
- SSIS: Throwing errors from script task/component
- 使用Active Directory
- SSIS中通过Script Task发送邮件 Sql2005
- SSIS中通过Script Task发送邮件 Sql2005
- SSIS basic knowledge - logging, script task & file existence checking
- Lion企业应用测试(4):Active Directory Bind Script
- Active Directory
- Active Directory
- Active Directory
- 使用 System.DirectoryServices 搜索 Active Directory
- 如何通过 Active Directory 使用 Forms 身份验证
- 使用 Microsoft Active Directory 作为 LDAP 服务器
- 刚使用Active Directory的常见问题
- 刚使用Active Directory的常见问题(2)
- 使用 System.DirectoryServices 搜索 Active Directory
- SSIS script task中用代码的方式查询数据库样例
- 微软 BI ssis 中的 script task中用代码直接调用 WCF / Webservice
- java包含哪些基本数据类型及其包装类
- Servlet3.0学习总结--使用注解标注Servlet
- CentOS 6.5 使用rmp包 安装 MySQL 5.6.29
- 瀑布流布局插件Grid-A-Licous
- C# 性能优化
- SSIS使用Script task处理Active Directory
- Tachyon:Spark生态系统中的分布式内存文件系统
- TCP/UDP网络编程
- Java.math.BigDecimal.movePointRight()方法实例
- 浅谈Java中的hashcode方法
- VMware虚拟机文件夹中各文件作用详解
- 在一个字符串的相同指定长度间隔处插入指定字符串
- 第三周上机实践项目 项目3--输出星号图(e)
- display: inline-block间隙问题