Harshal Aditya
Mega Sage

Hi @Meloper ,

 

Hope you are doing good.

You can find out if a device is a server or not by looking at class field on the cmdb_ci table.

 

HarshalAditya_0-1677492038367.png

 

 

Please find the script below -

 

var server = "your CI's sys_id";
var getServer = new GlideRecord("cmdb_ci_server");
getServer.addQuery("sys_id",server);
getServer.query();
if(getServer.next()){
gs.log("Device is a Server");
}
else
gs.log("Device is not a server");

 

In the above script we are checking if the device is in cmdb_ci_server table or not. If yes it's a server else not. 

 

Please Mark My Response as Correct/Helpful based on Impact

Regards,
Harshal