1. A prerequisite to assigning licenses is settting the usage location. This script applies US to all users. If the usage location was not already set, you’ll need to run this, defining usage location as appropriate.
get-msoluser -all | set-msoluser -usagelocation US
2. You will need the SKU number for licensing
Get-MsolAccountSku
3. Copy that SKU number for the license you would like to apply to the users in bulk.
domain:STANDARDWOFFPACK_STUDENT
4. Make a variable with that SKU
$licensetype=domain:STANDARDWOFFPACK_STUDENT
5. Make changes.
Get-MsolUser -All | where-object {$_.UserPrincipalName -like “*@domain.org” -and $_.isLicensed -like “FALSE”} | Set-MSOLUserLicense -AddLicenses $licensetype