To be more efficient, cost-effective and adapted to their business needs, a client asked me to create a script to automate the assignment of user licenses on Office 365. In a collegial environment, where all users have the same licenses, it is quite simple to create a PowerShell script (see below) and to program it with task scheduler on a company server.
Here the script will automatically associate a first Plan E1 license that includes Exchange, Sharepoint and Lync options. Next, the script will add the Office365Pro Plus license which allows students to install the Office suite on their personal computer.
Before you can use the script below some prerequisites:
- Microsoft Online Service Sign-in Assistant must be installed on your server
- The MsOnline PowerShell Module(32-bit or 64-bit) must also be installed on the server
- You must use a Global Administrator account for your Office 365 tenant
- Finally, don’t forget to encrypt your password