Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  Extracting Licenses for Users using PowerShell Scripts

    Posted 01-03-2024 07:56

    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.
    ------------------------------


  • 2.  RE: Extracting Licenses for Users using PowerShell Scripts

    Posted 01-14-2024 22:01

    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
    ------------------------------



  • 3.  RE: Extracting Licenses for Users using PowerShell Scripts

    Posted 01-22-2024 07:43

    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.
    ------------------------------



  • 4.  RE: Extracting Licenses for Users using PowerShell Scripts

    Posted 02-25-2024 23:09

    Hi @Jason Lorden

    Did you get your working to capture the license info? 



    ------------------------------
    Vincent Sabolboro
    ATB Financial
    ------------------------------



  • 5.  RE: Extracting Licenses for Users using PowerShell Scripts

    Posted 02-26-2024 07:16

    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.
    ------------------------------



  • 6.  RE: Extracting Licenses for Users using PowerShell Scripts

    Posted 02-28-2024 10:03

    Thank you for letting me know. 



    ------------------------------
    Vincent Sabolboro
    ATB Financial
    ------------------------------



  • 7.  RE: Extracting Licenses for Users using PowerShell Scripts

    Posted 10 days ago

    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.
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources