Help With EMS Command
Hi all, we are running exchange 2007, I used the following command to display are users DisplayName,LastLogonTime,EmailAddress: get-mailboxstatistics | select-object DisplayName,LastLogonTime,@{Name="EmailAddress";expression={{Get-Mailbox $_).PrimarySMTPAddress}} | sort-object LastLogonTime I have been asked to change it so that instead of showing their display name it shows their FirstName, then their LastName. I would just split up the DisplayName column in excel, but their display names shows their middle initials and we have a lot of people with two word first names, so it's a pain. I think the easiest way would be to just get the command to show their first and last names. Any help is appreciated, thanks.
July 14th, 2009 7:20pm

ugh...it gets ugly...maybe someone will have a better solution but to keep it on one line here goes:Get-Mailbox | Select-Object @{Name="FirstName";expression={(get-user $_).FirstName}},@{Name="LastName";expression={(get-user $_).LastName}},@{Name="LastLogonTime";expression={(get-mailboxstatistics $_).LastLogonTime}},PrimarySMTPAddress-alex
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2009 8:04pm

You da man! Thanks.
July 14th, 2009 8:19pm

One more question, It truncates the LastLogonTime and email address columns, is there anyway to make the columns wider?
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2009 9:38pm

add below parameters at last... | FT -autoAmit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 14th, 2009 9:46pm

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

Other recent topics Other recent topics