In this article, I'll show you to get all O365 users which have not been assigned any license.

Prerequisites

Download and install the following modules.

  1. Microsoft Online Service Sign-in Assistant for IT Professionals RTW
  2. Windows Azure Active Directory Module for Windows PowerShell (64-bit version)

Get a List of Unlicensed Users in Office 365

To get a list of unlicensed users in Office 365, follow these simple steps:

-Open PowerShell with elevated privileges.

-Execute the following command. When you are prompted, enter your O365 global admin account or an account having required privileges.

$credential = Get-Credential

-Execute the following command to connect to O365.

Connect-MsolService -Credential $credential

-Now you are connected, execute the following command to get a list of unlicensed users.

Get-MsolUser -All -UnlicensedUsersOnly

You can also execute the following command. They both will return same result.

Get-MsolUser -All | where {$_.isLicensed -eq $true}

How to Get a List of Unlicensed Users in Office 365
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

One thought on “How to Get a List of Unlicensed Users in Office 365

  • Avatar
    May 21, 2020 at 4:53 pm
    Permalink

    Actually the last line of the article should be: (Currently it shows licensed users and checks for -eq $true)

    You can also execute the following command. They both will return same result.
    Get-MsolUser -All | where {$_.isLicensed -eq $false}

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*