petercawdron
Kilo Guru

There's been a few of these scripts floating around, but this one is nice and fast... simply pop in the sys_id you need to track down and run this in a background script.

var findSysID = 'f12ca184735123002728660c4cf6a7ef';

var tables = new GlideRecord('sys_db_object');
tables.query();

while(tables.next()){
	try{
         //ignore a bunch of system tables (including indexes, perf analytics, etc)
		if(tables.name.indexOf('ts_')!=0 && tables.name.indexOf('sys_')!=0  && tables.name.indexOf('v_')!=0  && tables.name.indexOf('pa_')!=0   && tables.name.indexOf('sn_')!=0){
			var lookUpID = new GlideRecord(tables.name);
			if(lookUpID.get(findSysID)){gs.info ('FOUND IN ' + tables.name);}
		}
	}catch(e){gs.info('===>Error/n'+e );}
}

As you can see, it ran in just under 20 seconds

find_real_file.png

 

Comments
Lukasz Krzaczk2
Kilo Explorer

This is good. Please check out how to make the script more usable with SwissNow:

https://community.servicenow.com/community?id=community_article&sys_id=677afaabdbee3700feb1a851ca961...

Version history
Last update:
‎03-09-2020 12:01 AM
Updated by: