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:

$LICENSEOBJECT = @()
$ALLUSERS=Get-MSOLUser -all
$ALLUSERSCOUNT=$ALLUSERS.COUNT
$COUNTER=0

foreach($msolUser in $ALLUSERS)
 {
  $COUNTER++
  $MCOEV=""
  $MCOMEETADV=""
  $MCOSTANDARD=""
  $MCOPSTN1=""
  $MCOPSTN2=""
  $MCOPSTNPP=""  
  $TEAMS1=""

  $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 @{
    "DisplayName"="$($UserInfo.DisplayName)"
    "UserPrincipalName"="$($Msoluser.UserPrincipalName)"
    "TEAMS1"=$TEAMS1.ProvisioningStatus
    "MCOEV"=$MCOEV.ProvisioningStatus
    "MCOMEETADV"=$MCOMEETADV.ProvisioningStatus
    "MCOSTANDARD"=$MCOSTANDARD.ProvisioningStatus
    "MCOPSTN1"=$MCOPSTN1.ProvisioningStatus
    "MCOPSTN2"=$MCOPSTN2.ProvisioningStatus
    "MCOPSTNPP"=$MCOPSTNPP.ProvisioningStatus
   }

   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

 

 

No Script Needed: List all GPOs related to Skype or Lync for your domain.

I saw a question out there asking if there was a script to list the group policy objects in an organization related to Lync or Skype settings.   I’m not aware of one, but I didn’t really look.  I did know that it was possible to check thanks to Pat Richard’s QOS Calculator which includes a tab that generates the PowerShell code to create a GPO for you (seriously, that’s a heck of a tool).  So, I figured I’d take a break and whip the following command up to answer the question, keep in mind I ran it directly from my domain controller as you’ll need the RSAT installed to get the PowerShell module for the GPO.

Get-GPO -all | foreach { if ((Get-GPOReport -guid $_.id -ReportType XML) -match “Lync|Skype”) {write $_.DisplayName}}

*UPDATE: Pat Richard has already optimized my PowerShell command.  New smaller command can be seen above.

Going to Microsoft Ignite? Come See My Session!

I’m blown away and completely honored to be able to speak at this year’s Microsoft Ignite conference in Orlando, Florida!   Danelle Van Der Koon @danelle_vdk (like me, from SWC Technology Partners) and I will be talking about driving adoption through Microsoft FastTrack.

Here’s the synopsis: Struggling to figure out which pieces of Office 365 are going to work best for your end users? Microsoft’s framework, FastTrack, aims to help demystify the process and the path to usage and adoption through envisioning, on-boarding, and driving value. What many may not realize is the largest ROI for Office 365 comes from end users adopting and using the products (beyond Exchange Online). Envisioning and implementing the product are the first steps toward success; but the key to success is driving the value for your implemented products forward through a series of resources. Hear stories from the field of how enablement can help to drive the value of Office 365 and make your Office 365 implementation an even bigger success.

The session will be on Monday, September 25th and the session code is THR1060.  Find it in your session builder and come say hi!

UPDATE:

Brian Ricks has invited several other MVPs out to speak and participate at his session “Getting your Skype for Business issues resolved”.  That session is on Wednesday, Sept 27th and the session code is BRK3370.

UPDATE:

Thanks all who came out!  Here’s are some links pic below if you want to see the decks, as well as a couple of pics:

https://techcommunity.microsoft.com/t5/Microsoft-Ignite-Content-2017/Drive-Office-365-adoption-by-driving-value-through-Microsoft/td-p/99504

https://techcommunity.microsoft.com/t5/Microsoft-Ignite-Content-2017/Getting-your-Skype-for-Business-issues-resolved/m-p/99440

Reminder: Quarterly Skype and Teams User Group Tomorrow!

Quick reminder for those of you in the Chicago area, tomorrow night is our quarterly Microsoft Teams and Skype for Business user group.

These are always fun and valuable, and a great place to network with your peers and make those relationships.  Vendors and local experts attend regularly as well so it’s a place to get those questions answered too!

The first session will cover Microsoft Teams with an In-Depth Demonstration (Chat, A/V, & Meetings). I will be presenting Hybrid Architectures & Related Migration Strategies, which is always a fun topic for me 🙂

To register or to find your own local UC group visit http://www.skypeug.com

This session will be held at the Microsoft offices in the Aon Center (200 East Randolph Drive, Suite 200, Chicago, Illinois, 60601)

Yes, Your Cloud PBX CNAM Might Be Wrong, But Be Patient

For those of you leveraging Microsoft Skype for Business Online Cloud PBX with a number obtained by using a PSTN Calling License, you might have noticed an outbound call showing up with the wrong CNAM, or Caller ID Name.  While Microsoft has handled many of these already, there are still some out there.    If a user brings this to your attention, you can check using opencnam.com, or a number of other tools.  These can even be scripted to check blocks of numbers.

Once you’ve identified the number with an incorrect CNAM, you’ll need to open a ticket with Microsoft, but please be patient, as of right now we’re hearing that there’s a bit of a backlog handling these.

OpenCnam.com Website Screenshot

Reminder: Quarterly Skype for Business User Groups

Quick reminder for those of you in the Chicago area, tomorrow night is our quarterly Microsoft Skype for Business user group.

These are always fun and valuable, and a great place to network with your peers and make those relationships.  Vendors and local experts attend regularly as well so it’s a place to get those questions answered too!

The first session will explore the array of various directory synchronization and client authentication models available today within Office 365, including topics like password synchronization and Modern Authentication.

Our second session will focus on the new Microsoft Teams client and then finish up with a recap of the latest Skype for Business announcements from Enterprise Connect 2017.

To register or to find your own local UC group visit http://www.skypeug.com

This session will be held at the Microsoft offices in Downer’s Grove (23025 Highland Pkwy., Suite 300, Downers Grove, Illinois, 60515)

New Skype Phone Number Assignment: Failed to Return Unique Result

This is a post that mostly serves as a PowerShell reminder to myself, but the long and short is that I had a client attempting to add a new user with a phone number that they believed wasn’t assigned anywhere.  They had run their favored scripts that list all numbers but were coming up short as to why Skype was blocking them from adding the user.

PS C:\Users\AnthonyCaragol\Desktop> .\Lync_Common_Area_Phone_Tool_v1_2.ps1
 New-CsCommonAreaPhone : Filter failed to return unique result, "[LineURI :
 tel:+16305551212] [PrivateLine : tel:+16305551212] "

As it turns out, and I can’t say how or why at this time (comment if you have a guess), but the account was removed from Lync at some point but the attributes were left behind.    In these situations, the commands I use to trace the line to a user object is as follows (where 5551212 is the number):

get-aduser -filter {msRTCSIP-Line -like "*5551212*"}
get-aduser -filter {msRTCSIP-PrivateLine -like "*5551212*"}

Update:  Jeff Brown has fought issues like this before as well, and has taken the fight right into the databases, see his encounter here – https://www.jeffbrown.tech/single-post/2014/11/01/Cleaning-Up-Leftover-Lync-Accounts

 

Move-CSUser returns “Index was outside the bounds of the array”

This is a simple but confusing one my clients have had various issues with, so I thought I’d write something up quickly.  You’re moving Lync or Skype for Business Server users to Skype for Business Online in Office 365.  During the move operation you receive an error similar to the following:

Move-CsUser : Index was outside the bounds of the array.
At line:1 char:1
+ Move-CsUser -Identity "John User" -Target sipfed.online.lync.com
-Credential $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : InvalidOperation: (CN=John User,...=contoso,DC
   =com:OCSADUser) [Move-CsUser], IndexOutOfRangeException
    + FullyQualifiedErrorId : MoveError,Microsoft.Rtc.Management.AD.Cmdlets.Mo
   veOcsUserCmdlet

Not the most helpful error and definitely confusing.  Nine times out of ten, this error is simply telling you that either A) You don’t have the permissions you think you do or B) The user isn’t licensed for what you’re trying to accomplish in the cloud (likely the case if it’s only affecting a single user or a few).

Checking B is easy, login to your O365 portal and ensure that the user has the correct licensing.  Don’t just assume because E1, E3, or E5 is on, that Skype is individually checked.  Double check when the user fails to move.

Checking A is a little more difficult.  You need to ensure that the account(s) you’re using have full access to move the user both on-premises, and into Skype Online.  When in doubt, use a CSAdministrator on-premises and Global Administrator account in Office 365 to test if this is the issue.  Please not that you don’t need the above maximum rights to move users, but it will help you eliminate variables to identify the source of the issue and help you move forward.

It’s also been noted (thanks Mark Vale) that when DirSync or Azure AD Connect is installed prior to Skype or Lync, the attributes may not be properly syncing to/from the tenant as they’re not automatically added with a later Skype installation.  Perhaps you’re using a third party IDM and missed these attributes entirely.  You will need to reconfig AAD Connect or your sync tool of choice to get these added in properly.

Beyond that, we’ve even seen issues with an incorrectly provisioned SQL rights pop up, and a few other oddities, but hopefully this moves you along on your path to the cloud.

 

Reminder: Winter Skype for Business User Group

Quick reminder for those of you in the Chicago area, tomorrow night is our quarterly Microsoft Skype for Business user group.

These are always fun and valuable, and a great place to network with your peers and make those relationships.  Vendors and local experts attend regularly as well so it’s a place to get those questions answered too!

I will be presenting “An Introduction to Enterprise Voice.”  In this presentation, you will learn about the basic features of Enterprise Voice. What exactly is it and how does it work? You will also learn the differences in features between using Enterprise Voice hosted on premise or via Office 365.

To register or to find your own local UC group visit http://www.skypeug.com

This session will be held at the Microsoft offices in the Aon Center (200 East Randolph Drive, Suite 200, Chicago, Illinois, 60601)

AudioCodes IP Phones Certified for Skype for Business Online

In case you missed it, AudioCodes just became the latest phone vendor to become certified for Skype for Business Online, meaning that the 440HD phones can be used both on-premises and online.  Other phones in the series including the 420HD and 450HD should follow shortly.

AudioCodes phones are a very compelling addition to the Skype ecosystem in my opinion due to several factors.

  1. They have the ability to leverage the SILK protocol right on the phone.
  2. The single-vendor aspect for phones, management, and SBC/ATA/Gateway hardware.
  3.  The very competitive price-point.
  4. Their IP phone management suite, which is even available free for up to 500 phones.

You can check out the official press release here for more info:  http://www.audiocodes.com/press-releases/audiocodes-ip-phone-achieves-microsoft-skype-for-business-online-certification

audiocodesjpg