Queries per minute per user issue
pompushko opened this issue · 2 comments
Hello
How can I manage Quota exceeded issue when working with 5-10 of requests/users ?
I extend limit in Google API page. But doesn’t help...
Should I use pause between Get-GSUserLicense commands or any other solution?
[2021-04-01 11:13:30] [e] Cannot assign Google Vault Former Employee license. Please check manually![2021-04-01 11:13:30] [e] Cannot assign Google Vault Former Employee license. Please check manually!Get-GSUserLicense : Exception calling "Execute" with "0" argument(s): "Google.Apis.Requests.RequestErrorQuota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service 'licensing.googleapis.com' for consumer 'project_number:XXXXXXXXXXXX'. [403]Errors [ Message[Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service 'licensing.googleapis.com' for consumer 'project_number:XXXXXXXXXXXX'.] Location[ - ] Reason[rateLimitExceeded] Domain[usageLimits]]"At ManageExpiredAccounts.ps1:267 char:18+ ... if(!(Get-GSUserLicense -User (get-aduser $UserAccount.SamAccou ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSUserLicense Get-GSUserLicense : Exception calling "Execute" with "0" argument(s): "Google.Apis.Requests.RequestErrorUser does not have a license for specified sku and product [404]Errors [ Message[User does not have a license for specified sku and product] Location[ - ] Reason[notFound] Domain[global]]"At ManageExpiredAccounts.ps1:269 char:22+ ... if(!(Get-GSUserLicense -User (get-aduser $UserAccount.SamAccou ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSUserLicense [2021-04-01 11:13:31] [w] License Google Vault Former Employee is here!
I'm unable to replicate this error, are you able to share your script?
function SearchGSuiteUserLicenses($UserEmail)
{
# Check GSuite Licenses
Start-Sleep -s 1
$AccountGSuiteLicenses = Get-GSUserLicense -User $UserEmail -CheckAll -Verbose
if ($AccountGSuiteLicenses -ne $null){
return (($AccountGSuiteLicenses | Select-Object -Expand SkuName) -join ', ')
}
else{
return $null
}
}
Btw, I face issue, when user has license, but Get-GSUserLicense show warning with "No license found for user". It happens....