How to report GSuite licences state every day

160 views
Skip to first unread message

Pavel Lyko

unread,
Sep 16, 2019, 3:34:25 AM9/16/19
to GAM for G Suite
Hi guys.
I need to be informed every day about how many licences we have total a how many we used.
When I run gam report domain todrive, ill become GSpredsheet with many information, also this two:

accounts:apps_total_licenses
accounts:apps_used_licenses

Now, i want to send only this two answers to some email adress.
Is there any possibility to run GAM command thru Task manager and send result to email? 

Or, is there a another solution for this?

thx
Pavel

Mikhail S.

unread,
Sep 23, 2019, 6:25:12 PM9/23/19
to GAM for G Suite
Run this in powershell to filter out both lines you want.

& "C:\gam-64\gam.exe" report domain | Select-string -pattern 'accounts:apps_'

The whole thing looks something like that:

# Before you start do the following:
# 1. Generate encrypted .xml file with O365 credentials to be used for sending emails. Note: if you are sending emails from your own account, use an app password.
#    Run following commands:
#    $cred = Get-Credential
#    $cred | Export-CliXml c:\temp\emailcreds.clixml
#    Copy emailcreds.clixml file to location you want and reference its path below as $emailcreds variable. This file is bound to your computer.

$emailcreds = Import-CliXml "C:\Some_Folder\emailcreds.clixml"
$body = & "C:\gam-64\gam.exe" report domain | Select-string -pattern 'accounts:apps_'
$subject = 'G-Suite license report ' + (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
    Send-MailMessage -SmtpServer "smtp.office365.com" `
        -Port 587 `
        -Credential (New-Object System.Management.Automation.PSCredential -ArgumentList $emailcreds`
        -UseSsl `
        -From "sen...@domain.com" `
        -To "reci...@domain.com" `
        -Subject $subject `
        -Body $body

+KimNilsson

unread,
Sep 29, 2019, 10:21:28 AM9/29/19
to GAM for G Suite
Anyone know why I don't see those two at all?
I've run the report in both my GSFE domains and one Business domain, and I don't get them.

/Kim

On Monday, 16 September 2019 09:34:25 UTC+2, Pavel Lyko wrote:
...
accounts:apps_total_licenses
accounts:apps_used_licenses

Graham

unread,
Oct 2, 2019, 5:25:31 AM10/2/19
to GAM for G Suite
Hi Kim
We see the following instead of apps_total_licences etc

accounts:gsuite_enterprise_total_licenses
accounts:gsuite_enterprise_used_licenses
accounts:gsuite_unlimited_total_licenses
accounts:gsuite_unlimited_used_licenses

Our domain is a mix of Enterprise and Business, looks like apps_ is the basic sku, not sure how GSFE would be reported? Run the command gam report domain todrive and see what is reported in the accounts: section

Søren Torp

unread,
Oct 3, 2019, 8:19:36 AM10/3/19
to GAM for G Suite
Same here Kim - I see neither.
Reply all
Reply to author
Forward
0 new messages