PeterHing
asked on
Exchange Powershell Query
Hi All,
I'm just trying to run a basic query in Exchange Powershell to obtain and export all SAMAccountName and DisplayName. I have been trying to use the code below, but I just get a file with what appears to be SIDs.
Can someone let me know what I should be running?
Many thanks,
Pete
I'm just trying to run a basic query in Exchange Powershell to obtain and export all SAMAccountName and DisplayName. I have been trying to use the code below, but I just get a file with what appears to be SIDs.
Get-Mailbox | Sort SAMAccountName,DisplayName | Format-Table SAMAccountName,DisplayName | Export-Csv C:\List.csv
Can someone let me know what I should be running?
Many thanks,
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Get-Mailbox | Sort-Object -Property Name | Format-Table SAMAccountName, Name | Export-Csv C:\List.csv
Instead of using Format-Table use select-item, it should be fine.
Get-Mailbox | Sort SAMAccountName| select SAMAccountName,DisplayName | Export-Csv C:\List.csv