OK. I'm just drawing a blank here or I'm missing something obvious. In a Powershell (V3) script, I'm calling
Get-ADUser -Filter 'SAMAccoutnName -like $ADUserName' -Properties Name,SamAccountName,EmailAddress | Select-Object Name, SamAccountName, EmailAddress
It lists the data in the column format I would expect
Name SamAccountName EmailAddress
------ --------------- ------------
User Name username [email protected]
That's not the problem. When I call a different command after that in the script (Exchange 2013 actually)
Get-Mailbox -Identity username | Select-Object Name, SAMAccountName, PrimarySMTPAddress
I only get the corresponding columns from the earlier Select-Object with no headers:
User Name username
Even if I specifically ask for a different set such as that "PrimarySMTPAddress" from above.
What am I missing here? This is driving me crazy.
Thanks in advance.
Get-Mailbox -Identity username | select *
actually return? Does the return object actually contain the properties that you're trying to select?