remove all licenses from a user in O365

Welcome Forums General PowerShell Q&A remove all licenses from a user in O365

Viewing 6 reply threads
  • Author
    Posts
    • #227335
      Participant
      Topics: 47
      Replies: 98
      Points: 645
      Rank: Major Contributor

      Hi,
      I’m trying to remove all the licenses from a given user in 0365

      when I try to execute this code

      then I get this error

       

      how do I solve this?

       

      Paul

       

      • This topic was modified 8 months, 2 weeks ago by acer460527.
    • #227371
      Participant
      Topics: 10
      Replies: 2480
      Points: 6,537
      Helping Hand
      Rank: Community MVP

      According to the help this should be enough:

    • #227377
      Participant
      Topics: 47
      Replies: 98
      Points: 645
      Rank: Major Contributor

      Hi Olaf,

      When I try your code I get this error

      which seems to be the same as mine by the looks of it

       

      Paul

    • #227392
      Participant
      Topics: 10
      Replies: 2480
      Points: 6,537
      Helping Hand
      Rank: Community MVP

      Hmmm …. did you assign the licenses through a group membership or direct?

    • #227422
      Participant
      Topics: 1
      Replies: 59
      Points: 588
      Helping Hand
      Rank: Major Contributor

      Hello Paul,

      What type of license you have on the tenant?

      Some licenses need to be removed before the others, as they might be dependent on each other.

      Please review following thread:

      https://techcommunity.microsoft.com/t5/office-365/error-when-trying-to-remove-a-license/m-p/308969

    • #227428
      Participant
      Topics: 47
      Replies: 98
      Points: 645
      Rank: Major Contributor

      Olaf,
      I know that for the Office365 the user is put in a security group in AD to be able to use office when I look up the same user in AzureAD then I see this info if this is usefull to you

      Communications Credits
      Active
      1/1
      Inherited (Office365License-Users)
      Enterprise Mobility + Security E5
      Active
      9/9
      Inherited (Office365License-Users)
      Office 365 E5
      Active
      36/39
      Inherited (Office365License-Users)

       

      or do I need to remove the licenses directly from azureAD?

       

      Update:

      removing the license from on Prem AD sorted this out

       

      Paul

       

      • This reply was modified 8 months, 2 weeks ago by acer460527.
      • This reply was modified 8 months, 2 weeks ago by acer460527.
    • #227470
      Participant
      Topics: 10
      Replies: 2480
      Points: 6,537
      Helping Hand
      Rank: Community MVP

      or do I need to remove the licenses directly from azureAD?

      You can remove the licenses this way only when you assigned them directly. … it’s a kind of logic … when you remove the license while the according group membership is still “active” the license will “come back“. 😉

Viewing 6 reply threads
  • The topic ‘remove all licenses from a user in O365’ is closed to new replies.