Active Directory- Get Object Properties For Each Data in Excel

Hey guys,

I’m trying to get some values in my excel DataTable with Active Directory-Get Object Properties activity. But when I try to get values from excel data , it gives error for me on for each side.

Is there any suggestion , how can I get values and convert them to for AD Activity type in for each ?

Workflow ;

Variable Panel;



I think DistinguishedName property will be the following.


Please modify the above columnname to actual column which has dn.


1 Like


When I try it ;

My Data:


Hi @burakavuncu,

What’s the type argument you have selected for, For Each activity

Kind Regards,
Sanjit Pal


Array of String

Change it to the IEnumerable data row and try the way as @Yoichi said, this might can solve the issue.

I try but same as before ;

@burakavuncu kindly follow this approach

1 Like


Can you try to set just DataRow instead of IEnumerable<DataRow> at TypeArgument property of ForEach activity?


Hey Mate,

Can you share excel template file too please?

Best regards,

Yea mate,
Active_Directory.xaml (15.7 KB)
sample.xlsx (11.5 KB)

My excel and my xaml .

It works by the way ,ı can pass now ı just need to write all outputs coming from “Get Object Properties” to excel. How can ı do that?

I need to write results to excel .


@burakavuncu there are multiple ways to do it but you can follow the below approach:

  1. Use a build datatable activity to create the datatable structure outside the for each loop.
  2. Inside the loop use add data row activity to add the value to the table
  3. After for each use write range activity and pass the datatable variable to that activity it will dump all the data to the excel file.

Hey Mate,

Could you send me example if you have ?

Cause when ı try it ı got error on add data row .

Error :slight_smile:

@burakavuncu PFA the example, this is just for reference
AddDataFromADToExcel.xaml (13.6 KB)