Managing Licenses in Office 365

Seventh-Seal-PNG

As I mentioned earlier, managing licenses in Office 365 is an art unto itself.

Here’s one of Microsoft’s guides to account and license management which provides a solid overview (including a listing of the license types and their supported features).

This post is a description of one approach: specifically, the one I took to reduce the license count of the enterprise Office 365 tenant I manage. It’s certainly not the only way to go about this but it worked rather well for my situation.

Lets’ review the basic steps I outlined in the previous post:

 

  • [You need] A method for gathering in-depth information about the status of user accounts (i.e., active vs. inactive, license type used, etc.) I’ve found Cogmotivediscussed in this post -to be invaluable although you can also use the Active and inactive mailbox report available from the Office 365 portal or by using PowerShell
  • Good familiarity with PowerShell (really key to managing large groups of accounts in an intelligent way)
  • An agreed upon workflow for un-licensing and removing dormant or terminated accounts in a timely way

Applying this to my situation, here’s what I did:

Using the Cogmotive reporting interface, I generated output listing users who hadn’t logged into Office 365 for 90 days.  This was downloaded as an Excel spreadsheet which could be parsed to extract just the information needed (for example, user principal name).

With this data, I was able to create a listing of user principal names against which I could run these simple PowerShell scripts –

Place the dormant accounts on hold (to preserve mailbox data):

GC your-csv-file.txt | % {Set-Mailbox $_ -LitigationHoldEnabled $true –LitigationHoldDuration 30}

Remove the Office 365 accounts’ license to remove the mailbox (with a built-in 30 day grace period):

GC your-csv-file.txt | % {Set-MsolUserLicense -UserPrincipalName $_ -RemoveLicenses youroffice365-domain:ENTERPRISEWITHSCAL}

A few notes:

The PowerShell scripts use the get-content switch (shortened to GC) to examine a CSV file.  The CSV file, whose contents were extracted from the Cogmotive report I mentioned earlier, consists entirely of a simple listing of user principal names (email addresses) piped into the cmdlet strings.

The license type shown in the above scripts – ENTERPRISEWITHSCAL – is the PowerShell (MSOL) label for E4 Plan licenses.  This Windows IT Pro article is a good review of the various license types and how they’re labeled within PowerShell.

Accounts that are not used by people (for example, service accounts) may appear on the dormant account list because of infrequent use or because they’re never directly – or interactively – logged into. Pay special attention to this when you’re creating your CSV file to avoid inadvertently disabling an account that’s in-use (and perhaps critical to some function).

If you discover that one of the accounts you un-licensed should be active, don’t panic; you can recreate the account’s mailbox within 30 days by simply re-applying its license.

This can be done using the Office 365 web portal or with PowerShell:

For a group of users (once again, from a CSV source file) –

GC your-csv-file.txt | % {Set-MsolUserLicense -UserPrincipalName $_ -AddLicenses youroffice365-domain:ENTERPRISEWITHSCAL}

For a single user –

Set-MsolUserLicense -UserPrincipalName  your.username@yourdomain.com -AddLicenses youroffice365-domain:ENTERPRISEWITHSCAL

And remember that the license type you apply may vary.

 

 

Managing Licensing In Office 365

Harold Llyod Hanging from Clock

Migrating your Exchange, SharePoint and Lync (or, as it’s now known, Skype for Business) services to Office 365 can be very challenging.  So challenging in fact, that once you’ve leapt all the technical hurdles and your users are reasonably happy (or perhaps ecstatic, let’s be positive!) you may be unprepared for what will probably be one of your most demanding tasks: managing licenses and associated costs.

In my next post, I’ll write in detail about the method I used to decrease a large firm’s license count and, in turn, the bill due to Microsoft.

Until then, here’s an overview of the tools and skills needed:

  • A method for gathering in-depth information about the status of user accounts (i.e., active vs. inactive, license type used, etc.) I’ve found Cogmotivediscussed in this post -to be invaluable
  • Good familiarity with PowerShell (really key to managing large groups of accounts in an intelligent way)
  • An agreed upon workflow for un-licensing and removing dormant or terminated accounts in a timely way

Here’s one of Microsoft’s guides to managing accounts.  It’s informative, but isn’t quite right for admins who need to control very large data sets.

Next time, I’ll walk you through the approach I took.