How to blank out manager in sys_user table for a user if blank in AD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 08:11 AM
We have a process when someone's account is disabled to blank out the manager attribute in AD.
How do we blank this field out from the sys_user table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 09:11 AM
I assume you are using an integration to create/update records in sys_user from AD? If so, can you update the transform to consider if deactivated when setting the manager attribute? Otherwise, when you deactivate, you should be doing an action on the user record to indicate they are no longer active, so you could clear the manager there (either during that process or with a business rule). Or if the deactivated don't sync back to ServiceNow to indicate they are deactivated, then I would probably have a scheduled job that checks for user records that haven't been synced in X amount of time and call to AD to see if they are deactivated. If they are, then clear manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 09:53 AM
There a couple of scripts to update the sys_usr table with AD manager record.
The first is