Get all E3 User with Intune open selected

lalajee 1,811 Reputation points


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

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,108 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,589 questions
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,232 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Crystal-MSFT 45,086 Reputation points Microsoft Vendor

    @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
    $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 461 Reputation points

    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.

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

    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'}