从Datafactory中的Azue SSIS IR中检索ActiveDirectory
我在SSIS中有如下所述的脚本任务。它可以在本地工作,但一旦部署到Azure SSIS IR,它就会失败,并且没有错误消息 如何以不同方式配置Azure SSIS IR,或者如何更改下面的脚本以在Azure SSIS IR中工作从Datafactory中的Azue SSIS IR中检索ActiveDirectory,ssis,azure-data-factory-2,azure-integration-runtime,Ssis,Azure Data Factory 2,Azure Integration Runtime,我在SSIS中有如下所述的脚本任务。它可以在本地工作,但一旦部署到Azure SSIS IR,它就会失败,并且没有错误消息 如何以不同方式配置Azure SSIS IR,或者如何更改下面的脚本以在Azure SSIS IR中工作 public override void CreateNewOutputRows() { // Specify the connnectionstring of your domain // @<a class="vglnk" href="http
public override void CreateNewOutputRows()
{
// Specify the connnectionstring of your domain
// @<a class="vglnk" href="http://mycompany.com" rel="nofollow"><span>mycompany</span><span>.</span><span>com</span></a> => LDAP://DC=mycompany,dc=com
// Consider using a variable or parameter instead
// of this hardcoded value. On the other hand
// how many times does your domain changes
string domainConnectionString = "LDAP://[complete LDAP connection].com/OU=Staff,DC=PMLLP,DC=com";
using (DirectorySearcher ds = new DirectorySearcher(new DirectoryEntry(domainConnectionString)))
{
ds.Filter = "(&" +
"(objectClass=user)" + // Only users and not groups
")";
// See ds. for more options like PageSize.
//ds.PageSize = 1000;
// Find all persons matching your filter
using (SearchResultCollection results = ds.FindAll())
{
// Loop through all rows of the search results
foreach (SearchResult result in results)
{
// Add a new row to the buffer
Output0Buffer.AddRow();
// Fill all columns with the value from the Active Directory
Output0Buffer.employeeID = GetPropertyValue(result, "employeeID");
Output0Buffer.mail = GetPropertyValue(result, "mail");
Output0Buffer.SamAccountName = GetPropertyValue(result, "SamAccountName");
Output0Buffer.UserPrincipalName = GetPropertyValue(result, "UserPrincipalName");
}
}
}
}
public override void CreateNewOutputRows()
{
//指定域的连接字符串
//@=>LDAP://DC=mycompany,DC=com
/或考虑使用变量或参数代替
//这个硬编码的值。另一方面
//您的域更改了多少次
string domainConnectionString=“LDAP://[完成LDAP连接].com/OU=Staff,DC=PMLLP,DC=com”;
使用(DirectorySearcher ds=new DirectorySearcher(new DirectoryEntry(domainConnectionString)))
{
ds.Filter=“(&)”+
“(objectClass=user)”+//仅限用户,不限组
")";
//有关页面大小等更多选项,请参见ds。
//ds.PageSize=1000;
//查找与您的筛选器匹配的所有人员
使用(SearchResultCollection results=ds.FindAll())
{
//循环浏览搜索结果的所有行
foreach(搜索结果中的搜索结果)
{
//向缓冲区添加新行
Output0Buffer.AddRow();
//用Active Directory中的值填充所有列
Output0Buffer.employeeID=GetPropertyValue(结果为“employeeID”);
Output0Buffer.mail=GetPropertyValue(结果为“邮件”);
Output0Buffer.SamAccountName=GetPropertyValue(结果为“SamAccountName”);
Output0Buffer.UserPrincipalName=GetPropertyValue(结果为“UserPrincipalName”);
}
}
}
}
它真的失败了吗,还是没有做任何工作就成功完成了?@digital.aaron它真的失败了,我认为它只是无法连接,但没有安全背景…启用Azure AD的过程看起来相当复杂()。不过,我个人没有太多的设置经验。它是真的失败了,还是没有做任何工作就成功完成了?@digital.aaron它真的失败了,我认为它只是无法连接,但没有安全背景…启用Azure AD的过程看起来相当复杂()。不过,我个人并没有太多的设置经验。