How to Remove Office 365 License From a User Account After Being Suspended for a Certain Time

Okta Workflows how-to guides are questions and answers from weekly community office hours, MacAdmins Workflows Slack channel, and other places. Read all other how-to guides

On to the question. 

How to remove Office 365 license a user account after being suspended for a certain time?

Note: I don’t yet have access to O360 Admin account (Workflows connection) so I’m proving a high-level overview of the solution. I will update this post once I have access to a O360 Admin connection.

The solution consists of two flows:

  1. Save the time when user was suspended
    • Trigger a flow with Okta – User Suspended card and save the time a user was suspended, their Okta ID, and any other information needed such as O365 login
  2. Use Okta – Scheduled Flow card to check the table and compare the date now against the date a user was suspended
    • If the difference between dates is greater than [X days], remove the license from the user and delete the row in a table

This is the first flow (save the time when user was suspended):

Save suspended user information to a table

Table with suspended user information:

Table with suspended user information

More resources to help you learn:

 📺 Short how-to Workflows videos to help you become a better automation builder.

 🍿 A collection of helpful Workflows tips.

Published by

Leave a Reply

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

You are commenting using your 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.