Link to home
Start Free TrialLog in
Avatar of robrandon
robrandon

asked on

Query AD for users Email Address

Is there a way to query AD for a single users email address if I know their Logon Name?

I use something like this in a script, but I'd like to know if I can just get the info for a single user:

Set objDomain = GetObject("WinNT://mydomainname.com,domain")
objDomain.Filter = Array("User")
For Each objUser In objDomain
......




ASKER CERTIFIED SOLUTION
Avatar of Martone
Martone

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of robrandon
robrandon

ASKER

I changed the User.Fullname to get the email address, but it works.  Thanks!