get-aduser jdoe -Properties mail|select mail
From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of James Rankin Sent: Monday, June 27, 2016 10:40 AM To: ntsysadm@lists.myitforum.com Subject: [NTSysADM] PowerShell weaknesses How can I used Get-ADUser to query a single attribute for a specific user? If I use something like Get-ADUser -filter jrankin -Properties mail To query the email address in AD, I don't just get that attribute returned, I get a bunch of default stuff too... DistinguishedName : CN=James Rankin,OU=Desktop1,OU=Standard Users,OU=User Accounts,DC=JRR,DC=test,DC=local Enabled : True GivenName : James mail : ja...@htguk.com<mailto:ja...@htguk.com> Name : James Rankin ObjectClass : user ObjectGUID : 694d15e1-d550-483a-8f21-cb7415f05342 SamAccountName : jrankin SID : S-1-5-21-2950944927-1203068717-1704750700-1114 Surname : Rankin UserPrincipalName : jran...@jrr.test.local<mailto:jran...@jrr.test.local> Am I missing something blatantly obvious here? Cheers, James Rankin EUC Solutions Architect | 07809 668579 | ja...@htguk.com<mailto:ja...@htguk.com> One Trinity Green, Eldon Street, South Shields, Tyne & Wear, NE33 1SA Tel: 0191 481 3446 ----------------------------------------- This message, and any attachments to it, may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are notified that any use, dissemination, distribution, copying, or communication of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately by return e-mail and delete the message and any attachments. Thank you.