Assign Specific Office 365 Licenses for Bulk of Users

Problem:

I need to assign specific of users all licenses except Exchange online. How can you do that?

10

Solution:

To assign specific of users all licenses except Exchange online,  you need to do the following:

  1. Create CSV for those users as below
  2. 23

  3. Connect to office 365 using PowerShell
  4. import-module MSOnline
    $msolcred = get-credential
    connect-msolservice -credential $msolcred

    04 07

  5. To get subscription of office 365
  6. Get-MsolAccountSku

    09

  7. To get name of exchange license, you need to run this command
  8. Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq “ENTERPRISEPACK”} | ForEach-Object {$_.ServiceStatus}

    14

  9. To enable license for specific users except Exchange online, you need to run below commands
  10. $noExchange = New-MsolLicenseOptions -AccountSkuId mlab10:ENTERPRISEPACK -DisabledPlans EXCHANGE_S_ENTERPRISE

    Import-Csv .\UPN.CSV | foreach-object {Set-MsolUserLicense -UserPrincipalName $_.UPN -AddLicenses mlab10:ENTERPRISEPACK -LicenseOptions $noexchange} | Set-MsolUser -UsageLocation “SA”

    18

  11. Verify those users take license except Exchange online with GUI & PowerShell
  12. (get-msoluser -UserPrincipalName david@imperialits.com).licenses.servicestatus

    21 22

Advertisements
This entry was posted in Office 365, Office 365. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s