Best way to get an overview for license utilizations

NicolasArr
Giga Contributor

Hi Everyone,

 

I am looking for the best way to get an overview of license utilization for ITIL users.  Specifically, I want to track when a user last accessed the system or work on a ticket so we can identify and remove unused ITIL licenses.  Any advice or best practices on how to achieve this?

 

Thank you!

3 REPLIES 3

Community Alums
Not applicable

AndersBGS
Tera Patron
Tera Patron

Hi @NicolasArr ,

 

The subscription management would be the place to look. You off course need to set it up, but afterwards you will be able to see subscription utilization.

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Runjay Patel
Giga Sage

Hi @NicolasArr ,

 

You can do below activities to track the license.

1. Create a scheduled job report to identify ITIL users who haven’t logged in or performed any activity within a specific time frame. like Last Login is before a specific date (e.g., 90 days ago).

 

2. Track Ticket Activity:

Create a schedule job and use below script.

 

var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('role.name', 'itil');
gr.query();
while (gr.next()) {
    var user = gr.user;
    var taskGr = new GlideRecord('task');
    taskGr.addQuery('sys_updated_by', user.getValue('user_name'));
    taskGr.addQuery('sys_updated_on', '>=', gs.daysAgo(90));
    taskGr.query();

    if (!taskGr.hasNext()) {
        gs.print('Inactive ITIL User: ' + user.getDisplayValue());
    }
}

 

 

3. Scheduled Script to Deactivate Unused ITIL Licenses:

 

var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('role.name', 'itil');
gr.query();
while (gr.next()) {
    var user = gr.user;
    if (user.last_login == null || gs.dateDiff(user.last_login, gs.nowDateTime(), true) > 90) {
        gs.print('Deactivating user: ' + user.getDisplayValue());
        user.active = false;
        user.update();
    }
}

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

4.