# Get a list of all first names, last names, and emails out of the active directory using system.user.getUsers()

**URL:** <https://forum.inductiveautomation.com/t/get-a-list-of-all-first-names-last-names-and-emails-out-of-the-active-directory-using-system-user-getusers/79484>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [September 21, 2023, 9:40pm UTC](https://forum.inductiveautomation.com/t/get-a-list-of-all-first-names-last-names-and-emails-out-of-the-active-directory-using-system-user-getusers/79484 "2023-09-21T21:40:26Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Bushmatic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bushmatic/32/87014_2.png) [@Bushmatic](https://forum.inductiveautomation.com/u/Bushmatic)\
**Post date:** [September 22, 2023, 12:33pm UTC](https://forum.inductiveautomation.com/t/get-a-list-of-all-first-names-last-names-and-emails-out-of-the-active-directory-using-system-user-getusers/79484/7 "2023-09-22T12:33:26Z")

</div>

Oh yes you're right! It is working perfectly now, I really appreciate it. The final form is:

```auto
list = []
users = system.user.getUsers("")
for user in users:
	contacts = user.getContactInfo()
	for contact in contacts:
		if contact.contactType == "email":
			email = contact.value
			first = user.get(user.FirstName)
			last = user.get(user.LastName)

			if email is not None and first is not None and last is not None:
				list.append((first, last, email))
print list

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/get-a-list-of-all-first-names-last-names-and-emails-out-of-the-active-directory-using-system-user-getusers/79484)._
