Forum Discussion

null null's avatar
null null
Iron Contributor
Jun 14, 2017

powershell script , enter the Active directory group; it recursively checks members for e3 license

I want a powershell script where if i  enter the Active directory group; it recursively checks each member ifor office 365 e3 enterprise license.

 

Is there a link or script which i can make use of.

 

thanks

    • null null's avatar
      null null
      Iron Contributor

      HI, 

       

      this is not exactly what i am looking for.

       

      Is there a way to check if an user has the e3 enterprise license using powershell.

       

      If thats possible, i can iterate over a group and get the members to check for e3 license.

       

      thanks

      • VasilMichev's avatar
        VasilMichev
        MVP

        Here's a quick example:

         

        Get-MsolGroupMember -GroupObjectId 9e629d33-d655-440c-89af-15738e59e667 | % {Get-MsolUser -ObjectId $_.ObjectId | ? {$_.Licenses.AccountSkuId -eq "tenant:ENTERPRISEPACK"} }

         

        where you need to replace the group's objectID and the SKU for your tenant's E3 pack. If you want to use on-prem AD group instead, use the Get-ADGroup cmdlet and the user's UPN instead.

Resources