Get-Mailbox -> results (Identity contents <> for same command but <> out statement .

I want to return all mailboxes where a specific user has fullAccess rights  (btw this is taking minutes to get results :()

Strange enough the 2 commands do not return same identity values.... (but for sure the same mailboxes)

(Param $strUser)
Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -user $strUser | ? {($_.AccessRights -match "FullAccess") -and -not ($_.User -like "NT AUTHORITY\SELF")} | ft Identity | ConvertTo-HTML  | Out-File C:\users\ADExc_FullAccess.html
-> this return an identity on hexa

Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -user $strUser | ? {($_.AccessRights -match "FullAccess") -and -not ($_.User -like "NT AUTHORITY\SELF")} | ft Identity
->This return an identity which is readable.

Q2 : How to return the display name rather than Identity ?
François VDCIcT service DeskAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom CieslikIT EngineerCommented:
Strange, I have same output.
On the screen is OK but in file is only ClassID instead of Identity

I've try to put output to TXT file and is working.

Check if this will be OK for you (I've removed converter and forwarded stream to txt)

Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -user $strUser | ? {($_.AccessRights -match "FullAccess") -and -not ($_.User -like "NT AUTHORITY\SELF")} | ft Identity | Out-File C:\users\ADExc_FullAccess.txt
François VDCIcT service DeskAuthor Commented:
PS I have found. Do not use FT but Select and you have the expected result for Identity....

I fact I would prefer to have Display Name (that's the reason for Q2...)
any idea how to get other information like Display Name instead of Identity  is welcome....

and/or any other command which is quicker to get same result....

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
General note: Never use format-* for anything else than output to the console screen. It applies a lot of formatting, adds formatting objects, and applies some magic, all working only on displays.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Regarding speed, there is not a lot you can do. You can try to avoid conversions and pattern matching:
get-mailbox | Get-MailboxPermission -user $strUser | ? { $_.AccessRights -contains [Microsoft.Exchange.Management.RecipientTasks.MailboxRights]::FullAccess -and $_.User -ne 'NT AUTHORITY\SELF'} | select Identity

Open in new window

To get the display name, you have to ask Active Directory:
get-mailbox | Get-MailboxPermission -user $strUser | ? { $_.AccessRights -contains [Microsoft.Exchange.Management.RecipientTasks.MailboxRights]::FullAccess -and $_.User -ne 'NT AUTHORITY\SELF'} | Get-user | Select DisplayName | ConvertTo-HTML | Out-File "C:\users\ADExc_FullAccess-$strUser.html"

Open in new window

I've also integrated the user name into the file name.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
I don't see how your own comment was helpful at all here, Tom?
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
What the Asker found is correct, but only the first step, as it only shows the ID. My explanation of why it makes a difference is immediately following their comment (and is an assist candidate for that reason).

My next comment addresses the real request - display names, and adds info about performance.

The question is complete if accepting
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.