Better license assignment in O365

powershell

Hello!
Since the last time I wrote about this original script for license assignment in Office365 cloud there were some changes. Now there are two parts of the script, for different groups of people in the company. And had to add timezone and language assignment also. And some more debugging output too.

For the first part of the script it didn’t change much, just added a line to assign the same timezone and language for everyone and changed a filter template.

Then I added a second part of the script, this one has a bit more logic. This group needs to be assigned the same timezone but different language (for the interface). By different language I mean Lithuanian or English.

Language assignment is done by checking a PreferredLanguage attribute in a cloud user, which gets synchronized with our on-prem AD service. To change this attribute, you need to change it in your AD server, because you can’t do that directly on the cloud. By default the script sets a Lithuanian language, however if that attribute is set to “EN”, then this user gets a “en-US” language.

After the license is assigned to a user, it takes about 2-3 minutes for a mailbox to be created. The actual time differs from user to user, so I had to add a function that would pause further execution until the mailbox is created and ready.
There is a cmdlet “Test-MapiConnectivity”, added that to a do-while loop with sleep and had a function “waitForMAPI()”

This script can be found in my projects folder here.

That is all.

Leave a Reply

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