0 votes


We have a scenario in which our E3, windows 10/11 licenses, Exchange Online, etc are assigned by various security groups. We do however assign certain licenses, Power BI for example, manually in O365.

When terminating an employee, I have noticed that we get an error back when the revoke licenses option is selected, which is perfectly understandable due to how we assign, revoke some license. Where the issue lies is that the revoking licensing command is erroring out and not going through and revoking the licenses that can be revoked.

I've noticed that the script here (https://www.adaxes.com/sdk/ManagingMicrosoft365/#:~:text=To%20revoke%20all%20Microsoft%20365,the%20IAdmM365AccountProperties%20interface%20to%20true%20.&text=To%20assign%20or%20revoke%20a,represents%20the%20license%20you%20need.) will remove all licenses mentioned in the variable at the top but is it possible for that script to be changed so that we can pick which licenses not to attempt to revoke?

Thanks, Gareth

by (180 points)
edited by

1 Answer

+1 vote
by (257k points)
selected by
Best answer

Hello Gareth,

It is not necessary to use scripts for this purpose. You can use a built-in action, Active or modify Microsoft 365 account. In the action, use option Modify properties. In the settings, you can add only the licenses that should be revoked. In the following example, only the Microsoft E5 license will be revoked and other license will remain untouched. image.png


Perfect, thank you as always!

Related questions

0 votes
1 answer

I have a custom command, copied from the buit-in deprovisioning script, that revokes all licenses and blocks sign in; however, I get an insufficient permissions error on the ... be happening. I can assign licenses with no issues. Any help would be appreciated.

asked Apr 12 by Michael Long (70 points)
0 votes
0 answers

When attempting to assign licenses during the "after creating a user" rule we're reciving the following error. Failed to create a remote mailbox for the user. The address ' ... mail attribute to the proper format that isn't the onmicrosoft.com domain as well.

asked Sep 2, 2021 by zorps (20 points)
0 votes
1 answer

In the de-provisioning process, I need to remove all users from all Office 365 groups (UnifiedGroups). I tried to adapt this script but unsuccessfully. https://www.adaxes.com/script-repositor ... -s360.htm Is there any way to do this?

asked Sep 22, 2019 by flaviodouglas (70 points)
0 votes
1 answer

Hi Is there a way to select all members of a group when you click on a group? I know you can do this via the Reports section, but it would be easier to just select them all when viewing the group.

asked Jan 28, 2013 by kjesoo (960 points)
0 votes
1 answer

https://www.adaxes.com/script-repository/remove-all-group-memberships-for-a-user-account-s33.htm I found this script but it only removes 365 groups, security groups, and ... user from all shared mailboxes they are a member of when disabling a user. Thanks!

asked Sep 8 by silicondt (60 points)
3,172 questions
2,874 answers
506,975 users