SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
234 stars 67 forks source link

Update-GSUserLicense exception #304

Open lucafabbri365 opened 4 years ago

lucafabbri365 commented 4 years ago

Hello, while executing the cmdlet Update-GSUserLicense -User <User> -License G-Suite-Business I get the error below:

Update-GSUserLicense : Exception calling "Execute" with "0" argument(s): "Google.Apis.Requests.RequestError
skuId is required field [400]
Errors [
        Message[skuId is required field] Location[ - ] Reason[required] Domain[global]
        Message[productId is required field] Location[ - ] Reason[required] Domain[global]
        Message[userId is required field] Location[ - ] Reason[required] Domain[global]
]
"
At line:1 char:1
+ Update-GSUserLicense -User <User> -License G-Suite ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Update-GSUserLicense

I was trying to change G Suite user's license from G-Suite-Lite to G-Suite-Business (same product Google-Apps). If I run Remove-GSUserLicense and then Set-GSUserLicense, it works.

Bye, Luca