Get all E3 User with Intune open selected

lalajee 1,821 Reputation points
2023-11-16T12:08:21.39+00:00

Hi,

Is it possible to get list of all users who has Intune Option Turn on

I like to get all user which have E3 with Intune Option turn on

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Intune | Other
Microsoft Security | Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Crystal-MSFT 53,991 Reputation points Microsoft External Staff
    2023-11-17T02:57:37.75+00:00

    @lalajee, Thanks or posting in Q&A. Based on my testing, to query the user who has Microsoft Intune license assigned, you can run the following PowerShell commands and enter Global administrator account to query the information:

    install-module MSOnline
    import-module MSOnline
    Connect-MsolService
    
    $Users = Get-MsolUser -All
    Write-Host "The user who has Intune license assigned"
    foreach ($User in $Users) 
    {
    
              $ServiceStatus = $user.licenses.ServiceStatus
              $ProvisionName = $ServiceStatus | Where {$_.ServicePlan.ServiceName -eq "INTUNE_A" }
    
              $Data = [PSCustomObject]@{
                   "USER" = $User.UserPrincipalName
                   "Software" = $ProvisionName.ServicePlan.ServiceName
                   "Status" = $ProvisionName.ProvisioningStatus
              }
    
              if($Data.Status -eq "Success" -or $Data.Status -eq "PendingInput")
              {
              Write-Host $Data.USER+ $Data.Software
                          }
              }
    

    User's image

    Hope the above information can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Nick Eckermann 606 Reputation points
    2023-11-17T16:38:54.9466667+00:00

    I would recommend you move to group-based licensing so you can control this better. Direct licensing with some selections for some users and not for others can be a pain.

    https://learn.microsoft.com/en-us/entra/fundamentals/concept-group-based-licensing

    You can migrate them, but make sure you plan accordingly. You can look at the script examples to help with the migration.

    https://learn.microsoft.com/en-us/entra/identity/users/licensing-groups-migrate-users
    https://learn.microsoft.com/en-us/entra/identity/users/licensing-ps-examples

    As far as fixing the script for just E3 users

    Run Get-MsolAccountSku to find your E3 SKU name

    Then modify this section.

    $Users = Get-MsolUser -All | Where-Object {$_.Licenses.AccountSkuId -eq 'tenantName:SKU'}


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.