If I figure out something elegant, I’ll let you all know.Īfter much swearing and figuring this out on my own, I did find one vague reference to it in Microsoft’sĪssign licenses to user accounts with Office 365 PowerShell document. It can be done, but it’s ugly text parsing. Unfortunately there’s no good way that I know of to tell why you’re getting that error, or walk through a user’s existing licenses and see if it’s already applied. (Get-MsolUser -UserPrincipalName $user).licenses It threw that error because that user already had that license. While the error says the license is invalid, it’s really not. Well, if he is, this is not an example of it. I did like it suggested, and sure enough the SKU was legit:ĪccountSkuId ActiveUnits WarningUnits ConsumedUnits FullyQualifiedErrorId : .InvalidUserLicenseException,Microsoft.Online. on my screen was NINE groups of 7-digit numbers and NINE boxes that would hold 6-digits. SO, I TRIED to do it using the PHONE process. CategoryInfo : OperationStopped: (:), MicrosoftOnlineException It failed, and I dont recall the error, but I believe it was something to the 'invalid key'. Set-MsolUserLicense -UserPrincipalName $user -AddLicenses $lic1 ![]() Use the Get-MsolAccountSku cmdlet to retrieve a list of valid licenses. Set-MsolUserLicense : Unable to assign this license because it is invalid. Here’s the very unpleasant response that PowerShell gave me: PS C:\> $user = C:\> Set-MsolUserLicense -UserPrincipalName $user -AddLicenses $lic1 If you see this message, this means that your Office product key has been blocked and will no longer work. ![]() I get the error 'This product key isn't meant for your region'. Select your version of Office below for help with this error message. PS C:\> $lic1 = " MOD873457:ENTERPRISEPREMIUM" This product cannot be activated because the product key is not valid. Now stuff was getting serious! Here’s the code I ran: I had tested the crap out of this PowerShell script so I trust it more than I trust Shane.īut a couple of days ago I was running my trusty script and I got the error. In this case, I just chalked it up to his ineptitude, which is the source of many of his troubles, so I blew him off. ![]() When Shane was testing my code he kept getting errors. For those of you that have read any of my blog posts, that might come as a shock, but it’s true. As a rule, I have someone proof read all of my blog posts, especially ones that have PowerShell code in it. I’ve been working on a blog post about the script I use to license users inside of Office 365.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |