I have recently been running a few large-scale (1000+ mailboxes) and I've had to rely on scripts for assigning licenses and converting mailboxes to shared mailboxes etc.
This blog will cover the script to assign a specific Office 365 license to multiple users, based on their UPN.
- Create a folder on your machine called "Office 365"
- Create a CSV file with the header of "UserPrincipalName" and then fill the column up with the UPNs of the mailboxes/accounts that you wish to convert to Shared Mailboxes. Save this as license.csv
- Open Notepad and add the following contents:
$AccountSkuId = "<tenantname>:STANDARDWOFFPACK_IW_faculty"
$UsageLocation = "AU"
$Users = Import-Csv "C:\Folder\SubFolder\Office 365\License.csv"
$Users | ForEach-Object {
Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId
} - Save this file as "AssignOfficeLicense.ps1"
To find out the AccountSkuId, you can use the following Cmdlet:
Get-MsolAccountSku
Simply copy the entire line of the license you want, and paste that here:
Log into Office 365 through PowerShell. You can follow this blog post to be able to do that. You will also need to use the final cmdlet in that post to connect to MSOL.
Navigate to the Office 365 folder and then run the .ps1 file with the following command:
.\AssignOfficeLicense.ps1
That will then go ahead and start assigning all the Office licenses to the mailboxes that you have mentioned in the CSV file.
Thanks to my colleague Gareth Harris for this script.
Thanks to my colleague Gareth Harris for this script.
PINGBACK1
ReplyDeletePINGBACK1
PINGBACK1
PINGBACK1
PINGBACK1