Microsoft Office 365Powershell
Bulk Assign Office 365 User Licenses with PowerShell: Step-by-Step Guide
Table of Contents
Table of Contents
Managing user licenses in Office 365 can be a time-consuming task, especially when dealing with multiple users. This guide will walk you through how to efficiently assign licenses to multiple users at once using PowerShell scripts, saving you valuable time and ensuring accurate license assignments.
We will utilize PowerShell, a powerful tool for automating tasks in Office 365 environments, to streamline the process of assigning user licenses.
Identify the license SKU you want to assign. You can list all available SKUs with:
Get-MsolAccountSku
Create a CSV file with columns for UserPrincipalName and LicenseAssignment:
UserPrincipalName, LicenseAssignment
user1@domain.com, ENTERPRISEPACK
user2@domain.com, ENTERPRISEPACK
Run the following PowerShell script to assign licenses to users in bulk:
$Users = Import-Csv -Path "C:\Path\to\Your\File.csv"
foreach ($User in $Users) {
Set-MsolUserLicense -UserPrincipalName $User.UserPrincipalName -AddLicenses "TENANT:ENTERPRISEPACK"
}
To verify that the licenses have been assigned correctly, you can run:
Get-MsolUser | ft UserPrincipalName, Licenses
By following these steps, you can efficiently assign Office 365 user licenses in bulk using PowerShell scripts. This method not only saves time but also ensures accurate and consistent license assignments across multiple users. If you’re also interested in creating single or bulk users in Office 365, refer to this helpful guide: Effortless User Account Creation in Office 365 with PowerShell: Single & Bulk User Setup Guide. For further automation, consider exploring PowerShell scripts for other Office 365 management tasks.