Script to monitor Email Account Connection Status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Has anyone created a script that basically monitors the connection status of an email account? Recently, the token for an email account that we have set up in ServiceNow was expired on the exchange side by an Admin which broke our connection between our instance and the exchange server and no emails were coming into our instance. I was checking to see which logs / tables I need to check that would tell me that the email account connection is broken; similar to what you see on the Email Diagnostics dashboard. Unfortunately, the connection status is not written anywhere that I see. Looking to see if anyone solved this issue.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday - last edited Thursday
Hi, @Ross Drew
You’re right — there’s no OOTB way to persist or query the email account connection status in ServiceNow.
The “status” you see in Email Diagnostics is calculated at runtime and not stored anywhere.
Because of that, the only real option is to infer the connection health indirectly.
In practice, what people do is monitor a combination of:
email activity (e.g., emails suddenly stop flowing)
system/email logs for errors (auth failures, OAuth issues, connection errors)
recent behavior instead of a static status
This is actually aligned with how ServiceNow itself works — the diagnostics dashboard is based on aggregated metrics and recent activity, not a persisted connection state.
So even though there’s no single field telling you “connection is broken”, you can still detect it reliably by correlating logs and email flow.
- How to resolve OAuth token expired error for email accounts after a password reset - Support and Tro...
- System logs overview and table rotation schedules - Support and Troubleshooting
- Troubleshooting email issues in ServiceNow | Pathways Consulting Group
- https://hi.service-now.com/kb?id=kb_article_view&sysparm_article=KB0721331
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Thank you! I will give this a try and let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Perfect @Ross Drew ,
if possible, mark my suggestion as valid, I thank you!!! Good luck and I look forward to your reply!!