Software Counters can sometimes show incorrect values due to corruption in the SAM cache. 


There is a manual fix where you can go to an affected Software Counter, and on that page, there is a UI Action called 'Count licenses':
If you click that, a script include will be triggered which will force a recount of the licenses. 
If 'Count licenses' fails to fix the issue, there is also a second option which will completely rebuild the SAM cache for the chosen Software Counter (also see screenshot), if the suggestion above does not fix it, rebuild the SAM cache and do a recount to see if the numbers now match up:
In instances with many hundreds or thousands of Software counters, it may preferable to run a script to trigger a rebuild of the SAM cache for each software counter. Run the below background script out of hours to minimize any performance impact. To run a background script, navigate to "Scripts - Background" into the left hand application search field, then paste in the below script, and choose run. 
var gr = new GlideRecord('sam_sw_counter'); 
while ( { 
gr.cached = false; 
var script = 'var SAMCounter = new SncSAMCounter();SAMCounter.doSingleCounter("'+gr.sys_id.toString()+'");'; 
var sched = new ScheduleOnce(); 
sched.script = script; 
sched.setLabel('SAM:' +; 
You can then go and check all Scheduled Jobs running beginning with the name "SAM:": https://<INSTANCE_NAME>
At first you'll see many jobs created, but they will be processed quickly and will disappear from your view upon subsequent page refreshes.
You will also notice that each software counter will have a count in progress message at the top of the page. 
After this, all software counters should be updated. 

Article Information

Last Updated:2019-08-02 21:18:07