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
[2021-08-06 11:43:40] [i] Working with: user@DOMAIN.com
VERBOSE: Getting License SKU 'G-Suite-Enterprise' for User 'user@DOMAIN.com'
VERBOSE: Getting License SKU 'Google-Vault-Former-Employee' for User 'user@DOMAIN.com'
Get-GSUserLicense : Exception calling "Execute" with "0" argument(s): "Google.Apis.Requests.RequestError
User 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 line:18 char:35
+ ... Licenses += Get-GSUserLicense -User $UserEmail -SkuId Google-Vault-Fo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSUserLicense
[2021-08-06 11:43:40] [i] Error: Method invocation failed because [Google.Apis.Licensing.v1.Data.LicenseAssignment] does not contain a method named 'op_Addition'.
[2021-08-06 11:43:40] [i] License found: Google Workspace Enterprise Plus
Hello