User Tools

Site Tools


start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
start [2024/02/19 10:43] johnsonjohnstart [2024/02/26 08:26] (current) – [My Favorites] johnsonjohn
Line 2: Line 2:
  
 ----- -----
 +======My Code======
 +=====NON UTIL USER=====
 +<code>
 +// Run DEBUG NOW only. Do not run EXECUTE NOW.  This will give you a list of users that are NOT ITIL USERS.
 +//  This list of NON ITIL users will show up in the User Logs.     JWJ0215 02.19.24
 +ClearUserLog();
 +var gr = new GlideRecord('sys_user_has_role');
 +gr.addEncodedQuery('role.name=certification');
 +gr.query();
 +while (gr.next()) {
 +    var gr2 = new GlideRecord('sys_user_has_role');
 +    gr2.addEncodedQuery('user=' + gr.user.sys_id + '^role.name=itil');
 +    gr2.query();
 +    if (!gr2.hasNext()) {
 +        //gs.print(gr.user.getDisplayValue() + ' ' + gr.role.getDisplayValue());
 +                                UserLog(gr.user.getDisplayValue() + ' ' + gr.role.getDisplayValue());
 +    }
 +}
 +
 +</code>
 +-----
 +=====My Favorites=====
 +[[https://servicenow.onl/xml_files/sys_ui_bookmark_jj.zip|Download]]
 +
 +------
 ======JavaScript Snippets====== ======JavaScript Snippets======
  
start.1708368188.txt.gz · Last modified: 2024/02/19 10:43 by johnsonjohn