Quick Script: Office 365 License Information for Skype and Teams

I found myself in need of a specific script during a tenant migration, one that only included information about Skype for Business Online and Microsoft Teams.  There wasn’t anything out there that exactly matched what I needed, so I created the following with a bit of reverse engineering and help from support.office.com.  If the script is at all helpful, please feel free to use it, hack it up, send me improvements, whatever you’d like.

The outputs of the script is a CSV and a GridView showing the results of the license data.  The names of the licenses are a bit cryptic, but I’ll summarize them below:

  • TEAMS1- Microsoft Teams
  • MCOSTANDARD – Skype for Business Plan 2
  • MCOMEETADV – Audio Conferencing (formerly PSTN Conferencing)
  • MCOEV – Phone System (formerly Cloud PBX)
  • MCOPSTN1 – Domestic Calling Plan
  • MCOPSTN2 – International Calling Plan
  • MCOPSTNPP – Communication Credits

UPDATE: I ran across a tenant with a 120 minute domestic calling plan, which is available through an EA.  This plan is labelled as MCOPSTN_5.

I’m not certain I grabbed all of the values, so please comment and help me improve the script.

The script itself should be run after you connect to your tenant via PowerShell.  If you’re not sure how, read the following article: https://technet.microsoft.com/en-us/library/dn975125.aspx but in a nutshell, you’ll need to download a PowerShell module and run the Connect-MsolService command.

Once you’re connected, the script to run is here:


foreach($msolUser in $ALLUSERS)

  $UserInfo = Get-MSOLUser -UserPrincipalName $msolUser.UserPrincipalName
  foreach($license in $msolUser.Licenses)
    if ($license.servicestatus|where {$_.serviceplan.servicename -like "MCOEV"}) 
      $MCOEV=$license.servicestatus|where {$_.serviceplan.servicename -like "MCOEV"}
    if ($license.servicestatus|where {$_.serviceplan.servicename -like "MCOMEETADV"}) 
      $MCOMEETADV=$license.servicestatus|where {$_.serviceplan.servicename -like "MCOMEETADV"}
    if ($license.servicestatus|where {$_.serviceplan.servicename -like "MCOSTANDARD"})
      $MCOSTANDARD=$license.servicestatus|where {$_.serviceplan.servicename -like "MCOSTANDARD"}

    if ($license.servicestatus|where {$_.serviceplan.servicename -like "MCOPSTN1"})
      $MCOPSTN1=$license.servicestatus|where {$_.serviceplan.servicename -like "MCOPSTN1"}

    if ($license.servicestatus|where {$_.serviceplan.servicename -like "MCOPSTN2"})
      $MCOPSTN2=$license.servicestatus|where {$_.serviceplan.servicename -like "MCOPSTN2"}

    if ($license.servicestatus|where {$_.serviceplan.servicename -like "MCOPSTNPP"})
      $MCOPSTNPP=$license.servicestatus|where {$_.serviceplan.servicename -like "MCOPSTNPP"}

    if ($license.servicestatus|where {$_.serviceplan.servicename -like "TEAMS1"})
      $TEAMS1=$license.servicestatus|where {$_.serviceplan.servicename -like "TEAMS1"}

   $LICENSEOBJECT += New-Object PsObject -Property @{

   write "Processing $($UserInfo.DisplayName) $COUNTER \ $ALLUSERSCOUNT"

#This line creates a CSV for your personal use
$LICENSEOBJECT | SELECT DisplayName,UserPrincipalName,TEAMS1,M* | export-csv License.csv -NoTypeInformation

#This line outputs the data into Out-Gridview
$LICENSEOBJECT | SELECT DisplayName,UserPrincipalName,TEAMS1,M* | Out-GridView



3 thoughts on “Quick Script: Office 365 License Information for Skype and Teams

  1. Jeff Brown

    Interesting that your Communications Credit shows up as “MCOPSTNPP”. Mine still shows up as “MCOPSTNC”. Is this a recently provisioned tenant?

    1. C. Anthony Caragol Post author

      It is, but I was basing that field on the article referenced… I need to figure out (or have someone do it for me) how to create the object based upon the MCO values returned from the connection, rather than having it hardcoded the way it is.

Comments are closed.