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

MS Flow - Check if user has Office 365 license

I'm currently working on a Flow that adds members to an Office 365 Group/Team after an approval action.  However, some members may not have Office 365 licenses yet and this causes the Flow to error out.  Is there any way to check if a user is licensed before the Flow tries to add them to a Team?  Is there a way to do this using an HTTP request rather than an Azure Function?  Or, is there a pre-existing action that can do this?

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: MS Flow - Check if user has Office 365 license

@sposvc 

Another way of approaching this is to set the "Configure run after" setting for the action(s) after the action causing the error.  This will allow you to move on even if there is an error.

Let me know if you need an example.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Frequent Visitor

Re: MS Flow - Check if user has Office 365 license

I had considered using the "Configure run after" setting but it isn't available on the affected action item. It is only available two levels up.  Plus, if I set up the "Configure run after" feature to continue even after a fail, I won't know that something had gone wrong, is that correct?
Flow1.png

Highlighted
Community Support
Community Support

Re: MS Flow - Check if user has Office 365 license

Hi @sposvc ,

 

Please check if the following workaround will work for you.

 

In my scenario, I am going to check if certain user exists in a group, if not, create user using Azure AD action, delay 1 minute to add the user to the group.

1.PNG

 

Further, there is a similar request on Flow Ideas Forum about Assign Office 365 License in Flow, please check and vote it at here:

https://powerusers.microsoft.com/t5/Flow-Ideas/Assign-Office-365-License-in-Flow-Fully-Automate-Onbo...

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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: MS Flow - Check if user has Office 365 license

Unfortunately, I am unable to use that workaround for a couple of reasons - first, we haven't implemented any licensing groups in our organization and it would take quite some time to move forward with such a change and second, the users who potentially wouldn't have a license would probably (but not always) be assigned an F1 license which is apparently not available with group licensing. What we'd like to do is check for a license, if the user doesn't have a license, our IT group would be emailed.  Users who do have a license would be added to the Team.  Is there any other way of doing this?  Please let me know and I appreciate all suggestions!

Highlighted
Community Support
Community Support

Re: MS Flow - Check if user has Office 365 license

Hi @sposvc ,

 

Thanks for updating.

 

I am afraid that there is no direct action would be used to achieve your scenario.

 

You may consider running PowerShell. Here is a blog on run any PnP-PowerShell in One Azure Function from Microsoft flow for your reference:

http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow

 

Hope this doc on view licensed and unlicensed users with Office 365 PowerShell will be helpful:

https://docs.microsoft.com/en-us/office365/enterprise/powershell/view-licensed-and-unlicensed-users-...

 

 

Best regards,

Mabel

 

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

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
Users online (5,933)