blog.atwork.at

news and infos about microsoft, technology, cloud and more

How to change Office 365 Licenses in One Step with PowerShell

PowerShell is your friend in any operations where more than 5 Users are involved in Office 365. You can do a lot there: changing Password policies, set user locations, assign licenses and a lot more. In this post I’ll show you how you can change license assignments from a selected user group within Office 365. This is useful for example in current Live@Edu Migrations or when a specified group of users has to change their license assignments and all other users need to stay untouched.

Tenants, who migrate from Live@Edu to Office 365 have to change their licenses from Exchange Online Plan 1 to Plan A2 for students which includes Exchange Online, SharePoint Online, Lync online and Office Web Apps. For free. Just sayin’.

There are different Account SKU’s for Students, Alumni and Faculty:

image

So our challenge is to change the license assignments for students from Exchange Online P1 to Office 365 Plan A2 for students in one step. The second, more ambitious step was to make this possible with only one single line in PowerShell. Smiley

First, connect to the Online Services with

Connect-MsolService

To see the currently available SKU’s in your tenant, use

Get-MsolAccountSku

image

To remove current Exchange Online Licenses and assign Plan A2 only for students in one step you need the following line:

Get-MsolUser -all | Where {$_.Licenses.AccountSkuId -contains "your-tenant-name:EXCHANGESTANDARD_STUDENT"} | Set-MsolUserLicense -AddLicenses "your-tenant-name:STANDARDWOFFPACK_STUDENT" -RemoveLicenses "your-tenant-name:EXCHANGESTANDARD_STUDENT"

To be on the save side you can test that first with only one user:

Get-MsolUser -UserPrincipalName admin@contoso.com | Where {$_.Licenses.AccountSkuId -contains "your-tenant-name:EXCHANGESTANDARD_STUDENT"} | Set-MsolUserLicense -AddLicenses "your-tenant-name:STANDARDWOFFPACK_STUDENT" -RemoveLicenses "your-tenant-name:EXCHANGESTANDARD_STUDENT"

image

Note: if there are a lot of users this can take some time.

Be careful: please reassign licenses in one step at any time to avoid troubles.

Hope that helps!

Comments (3) -

  • Dan Soares

    7/24/2013 11:17:35 PM |

    Thank you for the example. It saved me a little time Smile

    Dan

  • Ole Nilsen

    9/27/2013 11:56:55 AM |

    Thanks for this!

  • Andrey Zacharov

    9/29/2013 4:28:32 PM |

    Save a lot of time 10x

Loading