Anthony K O365
asked on
Office 365 - Removing assigned License from Shared mailboxes using CSV
I am trying to remove Licenses from Shared Mailboxes using the following script:
$AccountSkuId = "Tenant:STANDARDWOFFPACK_I W_FACULTY"
$Users = Import-Csv "C:\mailbox.csv"
$Users | %{
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses $AccountSkuId
}
I get the following error:
"Set-MsolUserLicense : Unable to assign this license because it is invalid. Use the Get-MsolAccountSku cmdlet to
retrieve a list of valid licenses."
I absolutely know that the sku is correct. I also closed and re-ran the PS session connecting to Exchange Online. Any thoughts?
$AccountSkuId = "Tenant:STANDARDWOFFPACK_I
$Users = Import-Csv "C:\mailbox.csv"
$Users | %{
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses $AccountSkuId
}
I get the following error:
"Set-MsolUserLicense : Unable to assign this license because it is invalid. Use the Get-MsolAccountSku cmdlet to
retrieve a list of valid licenses."
I absolutely know that the sku is correct. I also closed and re-ran the PS session connecting to Exchange Online. Any thoughts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER