1

我在 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://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");
            }
        }
    }
}
4

0 回答 0