you can try with table api and use the table v_plugin to get the list of active,inactive and plugins details. 

 

 

Sample Script:

 

 

 

var request = new sn_ws.RESTMessageV2();
var headers = request .getRequestHeaders();
request.setEndpoint('https://dev34768.service-now.com/api/now/table/v_plugin?sysparm_query=active%3Dactive');
request.setHttpMethod('GET');


//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';


request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");


var response = request.execute();
gs.print(response.getBody());


gs.print(response.getHeader("X-Total-Count"));

we have tried with v_plugin that show 394 active plugins but sys_plugins shows 623 activate plugins.

why these records are differ from each other. They are not showing equal active plugins.

status of the plugins can only be fetched from v_plugin tables. from sys_plugins you will only get the plugin component details. 

i am assuming here you are using your org instance so i would suggest here to connect with HI Team , because they can give you the exact details. 

Thanks harshvardhan, for giving such a precious time. 

Dubz
Mega Sage

Any table prefixed with a v_ is a virtual table, it doesn't really exist. It's session based and picks up the values based on the node on which your current session is running. I don't know why this exists for plugins, i've only ever come across it when looking at logged in users but it explains the disparity between the number of active plugins in the v_plugins table and the sys_plugins table.