# Checking if a user is in an AD Hybrid user source

**URL:** <https://forum.inductiveautomation.com/t/checking-if-a-user-is-in-an-ad-hybrid-user-source/9635>\
**Category:** Ignition\
**Created:** [February 2, 2015, 6:30am UTC](https://forum.inductiveautomation.com/t/checking-if-a-user-is-in-an-ad-hybrid-user-source/9635 "2015-02-02T06:30:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![0sm0](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/0sm0/32/15228_2.png) [@0sm0](https://forum.inductiveautomation.com/u/0sm0)\
**Post date:** [February 2, 2015, 6:30am UTC](https://forum.inductiveautomation.com/t/checking-if-a-user-is-in-an-ad-hybrid-user-source/9635/1 "2015-02-02T06:30:07Z")

</div>

Hi Guys,

I have 2 user sources, 1 is a local and 1 is an AD Hybrid

I would like to be able to open a different window on a clients startup depending on if the user (windows login) is in the AD Hybrid or not.

can you use the system.security.validateUser() with an AD user source without having to re-enter the password?

Any guidance appreciated.

cheers

Tim…

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 2, 2015, 10:42am UTC](https://forum.inductiveautomation.com/t/checking-if-a-user-is-in-an-ad-hybrid-user-source/9635/2 "2015-02-02T10:42:02Z")

</div>

system.user.getUser shoud do the trick:

`if system.user.getUser("UserSource","UserName") != None:
  print "User exists"
else:
  print "User does not exist."`

---

<div class="post-metadata">

**Author:** ![0sm0](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/0sm0/32/15228_2.png) [@0sm0](https://forum.inductiveautomation.com/u/0sm0)\
**Post date:** [February 3, 2015, 10:40pm UTC](https://forum.inductiveautomation.com/t/checking-if-a-user-is-in-an-ad-hybrid-user-source/9635/3 "2015-02-03T22:40:49Z")

</div>

Thanks for that,

What you have shown does the job nicely but I was hoping to validate the Username and Password as it might be the case that the same username is in both User sources?

Many thanks

cheers
