Get-mailuser Firstname Lastname
Hello,I need to get only the Firstname and lastname of the users in a list.I need to distinct the Firstname of the lastname (diff column)Any idea?
December 18th, 2009 5:58pm

Not much to go on, but assuming the list is users.txt, and using Exchange 2007 EMSgc list.txt |% {get-user $_ | select firstname,lastname}
Free Windows Admin Tool Kit Click here and download it now
December 18th, 2009 8:01pm

On Fri, 18-Dec-09 14:58:01 GMT, Graiggoriz wrote:>Hello,I need to get only the Firstname and lastname of the users in a list.I need to distinct the Firstname of the lastname (diff column)Any idea? get-mailbox -resultsize unlimited | get-user | selectfirstname,lastnameYou can pipe the results of the select cmdlet to export-csv if youwant the data in that format.---Rich MatheisenMCSE+I, Exchange MVP--- Rich Matheisen MCSE+I, Exchange MVP
December 18th, 2009 8:33pm

And, assuming the "list" is a Distribution Group: Get-DistributionGroupMember <List Name> |Get-User |Select-Object firstname, lastnameKarlhttp://unlockpowershell.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
December 18th, 2009 10:38pm

Thanks you all for your input.That command gave me what I was expected --> get-mailbox -resultsize unlimited | get-user | selectfirstname,lastnameThough, I would like to get only user with the attribute 10 = INDIA when I add that command | Where {$_.CustomAttribute10 -like "INDIA"} It doesn't work.Any idea how I could make it work??Thanks
December 21st, 2009 2:33pm

Sorry I meant to get/add in the below command the PrimarySmtpAddress??I already got the command: get-mailuser -resultsize unlimited | where {$_.CustomAttribute10 -like "INDIA"} | get-user | select firstname, lastname, displaynameThanks in advance for your help
Free Windows Admin Tool Kit Click here and download it now
December 21st, 2009 2:42pm

Try get-recipient instead of get-mailuser, and don't do the pipe through get-user:get-recipient -resultsize unlimited | where {$_.CustomAttribute10 -like "INDIA"} | select firstname,lastname,displayname,primarysmtpaddress
December 21st, 2009 4:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics