- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 06:21 AM
Hi
I have a requirement.
As a System Administrator, I need an email notification set up to send an alert when a local admin login occurs in the production environment to ensure that this account is not used unless absolutely necessary for security purposes. Kindly help.
Regards
Suman P.
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 04:47 AM
What is local admin , if that a role like 'local_admin' if yes then below will work, Mark my answer as correct if that helps.
var answer = false;
var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('user', current.sys_id);
gs.log("Current log in "+current.sys_id);
gr.addQuery('role', '9b947bfc1b97811039cdc843604bcb3b');
gr.query();
if(gr.next())
{
gs.log("Going inside");
answer = true;
}
else
{
gs.log("Not going inside");
answer = false;
}
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 06:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 07:09 AM
Hi
There are asking for production environment, how can i implement it?
Regards
Suman P.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 07:17 AM
You implement this in lower environment, get it tested and give update set to someone who has production access and they can deploy.? I hope that's what you are asking.?
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:16 PM
Hi
Where are we saying that 'when an admin is logged in'?
Regards
Suman P.