How can I get a list of users from Azure AD and save them to a CSV file?

Question: I am looking for some guidance on how to create a flow which will get a list of Azure AD users and then save this list as a CSV file. The goal is that this will be used as a data source in another system. Has anyone created anything similar that they can share or tips on my sequencing or the connectors?

(1) We can generate a list of the users with the Search for users (v2) action. The secret is to leave the search term empty and it will return up to 1000 users by default:

The Search for users (v2) action.  Leave the Search term empty and and it will return up to 1000 users by default.
The Search for users (v2) action. Leave the Search term empty and and it will return up to 1000 users by default. See advanced options if you want to limit the number of results returned.

(2) Add a Select action and select the user properties you want to include in the CSV file:

Add a Select action and select the user properties you want to include in the CSV file
Select the user properties you want to include in the CSV file

(3) Add the Create CSV table action using the output from the Select action as its input:

Add the Create CSV table
Create CSV table action

(4) Save the CSV file to OneDrive or another location

Save the CSV file to OneDrive

Sample runtime output:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Website Built with WordPress.com.

Up ↑

%d bloggers like this: