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 66 forks source link

G Suite users with no license #284

Open lucafabbri365 opened 4 years ago

lucafabbri365 commented 4 years ago

Hello, is there a way to retrieve the list of users without an associated G Suite license (without cycling rows with Get-GSUser & Get-GSUserLicense cmdlets) ?

Thank you, Luca

scrthq commented 4 years ago

heyo @lucafabbri365 - Good question! My first though was to go through that same approach you're thinking, will need to check if a direct query is possible but I haven't seen that offhand.

lucafabbri365 commented 4 years ago

Hello @scrthq, thank you for your reply. I also have another question regarding G Suite licenses: is there a way to retrieve all available/applicable licenses (ProductId, ProductName, SkuId, SkuName, total, total assigned, expiration date, etc. - the same information appearing in G Suite console > Billing ) ?

Thank you, Luca

scrthq commented 4 years ago

Hey @lucafabbri365 - I'm not aware of a way to pull the available/assignable licenses per an individual G Suite subscription via API. Maybe through the Reseller API, but PSGSuite doesn't use that currently. If you find any documentation around it, I'd be happy to add it if it's doable!