I have googled and created two scripts . (1), (2)
(1)First one is to export "Full Access" of a shared email box called "ap.cz"
Get-Mailbox ap.cz | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,@{Name='Access Rights';Expression={[string]::join(', ', $_.AccessRights)}} | Export-Csv \\myserver\c$\fulla.csv –NoTypeInformation
(2)Second one is to export "Send As" of a shared email box called "ap.cz"
Get-Mailbox ap.cz | Get-ADPermission | where { ($_.ExtendedRights -like “*Send-As*”) -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) } | Select Identity, User, Deny | Export-CSV \\myserver\c$\sendass.csv
Both scripts are working fine.
Output for (1) is similar to this
output for (2) is similar to this
But for both occasions I get "User logon name
" in the format (domain\userid
) where userid is a number in my organization.
But I need to get display name/full name
instead of "User logon name
" while exporting to csv..
I'm not an exchange admin or well versed in exchange/powershell, but i am checking/supporting overall IT infrastructure, and when a manager is asking for a list of names, for "send as" or "full access" for a certain mailbox, I have to export it using above scripts and re-convert "user logon name"
to display name
manually.
Can someone please advice how to change both scripts to display "full name/display name"
instead of login name
? I have tried googlin, yet no luck..