none
Assign office 365 license RRS feed

  • Question

  • I have a script which adds an office 365 license to a user, how can I ammend the script so that it added two different AccountSkuID licenses?

    $AccountSkuId = "ExitCodeZero:STANDARDWOFFPACK"
    $UsageLocation = "GB"
    $Users = Import-Csv c:\temp\userlist.csv
    $Users | ForEach-Object {
    Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
    Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId
    }


    Best regards, Wayne

    Friday, August 21, 2015 8:36 AM

Answers

  • It should just be a comma separated string.

    $AccountSkuId = "ExitCodeZero:STANDARDWOFFPACK,ExitCodeZero:OTHEROFFPACK"


    \_(ツ)_/

    • Marked as answer by wmb37 Friday, August 21, 2015 9:42 AM
    Friday, August 21, 2015 9:23 AM

All replies

  • It should just be a comma separated string.

    $AccountSkuId = "ExitCodeZero:STANDARDWOFFPACK,ExitCodeZero:OTHEROFFPACK"


    \_(ツ)_/

    • Marked as answer by wmb37 Friday, August 21, 2015 9:42 AM
    Friday, August 21, 2015 9:23 AM
  • did not work at first but when I put each license in quotes it did so that you for your help

    "ExitCodeZero:STANDARDWOFFPACK","ExitCodeZero:OTHEROFFPACK"


    Best regards, Wayne

    • Marked as answer by wmb37 Friday, August 21, 2015 9:42 AM
    • Unmarked as answer by wmb37 Friday, August 21, 2015 9:42 AM
    Friday, August 21, 2015 9:42 AM