Office365 License allocation by power shell

Hi,

I am trying to allocate Office365 license by powershell scripting but it's give below error. Anybody can help me? Also I need to allocate "Office 365 Enterprise E3" under only Exchange Online (Plan 2)" license. Other licenses like sharepoint, Skype, Azure shouldn't be allocated. Can you please help me? Thanks

Error:

Set-MsolUserLicense : Cannot bind parameter 'LicenseOptions'. Cannot convert the "-MsolUserLicense" value of type "System.String" to type "Microsoft.Online.Administration.LicenseOption".

September 4th, 2015 11:32am

Could you provide a script syntax that you are trying to run?
Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 11:52am

$AccountSkuId = "TEST:ENTERPRISEPACK"

$UsageLocation = "US"

$LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId

$Users = Import-Csv c:\Users.csv

$Users | ForEach-Object {

Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation

Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId -LicenseOptions $LicenseOptions

}

September 4th, 2015 11:57am

Your issue is explained here

https://technet.microsoft.com/en-us/library/dn771769.aspx

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 7:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics