How to find if user exists in LDAP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 04:40 AM
Hello guys,
I have designed a catalog item with two variables. User Name (type: string) and Password (type: password)
I have attached a workflow and using custom activity to reset a password for the user selected. If i enter a user which is not existing in LDAP then Output should be thrown error. How to know whether the user exists in ldap or not in service now?
Regards,
Indup

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 05:14 AM
Hi,
If you are importing user information via LDAP sync you can find "Source" field populated on the sys_user table. You can utilize this source field to check if user exists in LDAP or not. Source field on user table looks like "ldap:uid=userid,ou=users,dc=companyname,dc=com"
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 05:24 AM
you should use Query AD activity in workflow before updating the user password
pass proper variables to this activity and based on success or failure use next activity of Update
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2020 03:06 AM
Hello Ankur,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 07:44 AM
HI,
We have to use powershell activity for that and we need to know the domain controller for this. Permissions required are read atleast so you know if the user exist or not.
We implemented this by using new or custom PS script and with new activity same like query AD>
Thanks,
Ashutosh