I was able to work with someone on my side and get this query to work without installing jq. Here is the script I am running in PowerShell if anyone else needs it:
gc.exe license users list -a |
ConvertFrom-Json | Write-Output |
Select-Object id, @{Name='Licenses'; Expression={$_.licenses -join ', '}}|
export-csv C:\Genesys\Licenses.csv
------------------------------
Jason Lorden
Independent Health Association, Inc.
------------------------------
Original Message:
Sent: 02-28-2024 10:02
From: Vincent Sabolboro
Subject: Extracting Licenses for Users using PowerShell Scripts
Thank you for letting me know.
------------------------------
Vincent Sabolboro
ATB Financial
Original Message:
Sent: 02-26-2024 07:16
From: Jason Lorden
Subject: Extracting Licenses for Users using PowerShell Scripts
I have not successfully captured the license information yet as I have not been able to get approval to install jq on my machine.
------------------------------
Jason Lorden
Independent Health Association, Inc.
Original Message:
Sent: 02-25-2024 23:08
From: Vincent Sabolboro
Subject: Extracting Licenses for Users using PowerShell Scripts
Hi @Jason Lorden
Did you get your working to capture the license info?
------------------------------
Vincent Sabolboro
ATB Financial
Original Message:
Sent: 01-22-2024 07:43
From: Jason Lorden
Subject: Extracting Licenses for Users using PowerShell Scripts
Thanks Robert...unfortunately I don't have jq installed so the query is failing...I will see if I can get permission to install it and try again.
------------------------------
Jason Lorden
Independent Health Association, Inc.
Original Message:
Sent: 01-14-2024 22:01
From: Robert Wakefield-Carl
Subject: Extracting Licenses for Users using PowerShell Scripts
Try this:
gc -p {{profileName}} license users list -a | jq -r ".[] | [.name, .email, .addresses[].address] | @csv" > output.csv
Should get you users with their licenses.
------------------------------
Robert Wakefield-Carl
ttec Digital
Sr. Director - Innovation Architects
Robert.WC@ttecdigital.com
https://www.ttecDigital.com
https://RobertWC.Blogspot.com
Original Message:
Sent: 01-03-2024 07:56
From: Jason Lorden
Subject: Extracting Licenses for Users using PowerShell Scripts
Hi Everyone,
I posted this in the Developers Forum and didn't get a response so I am hoping someone here might be able to help. I am trying to get a list of licenses by users using a PowerShell script.
This is my code:
gc.exe license users list -a |
ConvertFrom-Json | Write-Output |
Select-Object id, licenses |
export-csv C:\Genesys\Licenses.csv
When I run the code I get all the ID's, but the licenses come back as System.Object[]
Can anyone tell me how to update my script to be able to pull back all the licenses by ID?
Thanks in advance!
#Reporting/Analytics
#SystemAdministration
#Unsure/Other
------------------------------
Jason Lorden
Independent Health Association, Inc.
------------------------------