Doh!

Put it in brackets would be the thing I'm missing

(Get-ADUser -filter jrankin -Properties mail).mail

Never mind.... :)


From: James Rankin
Sent: 27 June 2016 15:39
To: '[email protected]' <[email protected]>
Subject: 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              : [email protected]
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 : [email protected]<mailto:[email protected]>

Am I missing something blatantly obvious here?

Cheers,


James Rankin
EUC Solutions Architect | 07809 668579 | [email protected]<mailto:[email protected]>
One Trinity Green, Eldon Street, South Shields, Tyne & Wear, NE33 1SA
Tel: 0191 481 3446


Reply via email to