cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Get all users through Office 365 Users connector through Search for users (V2)

I'm trying to retrieve all our internal users through the Office 365 Users connector using Search for users (V2) in Power Automate. I would like to display all the users with a @company.com emailaddress. When searching on @company.com or just @ I don't get any results. When searching on my own firstname.lastname@company.com I do get a result. I can't find any documentation on the search field of Search for users (V2). How does it exactly work? Can I use wildcards?

 

searchusers.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Get all users through Office 365 Users connector through Search for users (V2)

Thank you. I found a solution by just changing the pagination setting to 2000 and filtering the array to reduce the input to only real employee accounts. 

View solution in original post

7 REPLIES 7
Highlighted
Super User III
Super User III

Re: Get all users through Office 365 Users connector through Search for users (V2)

The Search for Users searches a particular search term, for example a full email address, and unfortunately you can't use a wildcard with it to get back all users. https://docs.microsoft.com/en-us/connectors/office365users/ 

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Highlighted
Frequent Visitor

Re: Get all users through Office 365 Users connector through Search for users (V2)

Hi RobElliot,

 

Thank you for your reply. When I leave the search term empty the connector returns all the users. The problem is that it only returns the first 1000 users and the rest gets paginated. If I could search on the domainname of the emailaddress the result would only be 450. I can search firstname.lastname@company.com but I cant search on company.com because this returns zero results.

 

Kind regards

Highlighted
Community Support
Community Support

Re: Get all users through Office 365 Users connector through Search for users (V2)

Hi @SBS,

 

You could use the Get group members action of the Auzre AD connector, it will return all members of the Groups, also, if you want to get all the members in the tenant, you could get all groups ID to put into the Get group members, then append them into an array:Annotation 2020-01-01 143702.png

Get Members of a group

Annotation 2020-01-01 144821.png

Get members of multiple Groups

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Get all users through Office 365 Users connector through Search for users (V2)

Thank you. I found a solution by just changing the pagination setting to 2000 and filtering the array to reduce the input to only real employee accounts. 

View solution in original post

Highlighted
New Member

Re: Get all users through Office 365 Users connector through Search for users (V2)

I am interested to know how you achieved that as I am trying to do a very similar thing.

"changing the pagination setting to 2000 and filtering the array to reduce the input to only real employee accounts"

 

Although tests succeed, I don't seem to get any data returned.

 

 

Highlighted
Advocate II
Advocate II

Re: Get all users through Office 365 Users connector through Search for users (V2)

Click the "..." on the right hand corner of the Action,

Turn on "Pagination" and enter your Threshold

 
Highlighted
Advocate II
Advocate II

Re: Get all users through Office 365 Users connector through Search for users (V2)

Add image for your reference:

page.png

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,605)