Get-Mailboxpermission for list of Mailboxes

Kjensen picture Kjensen · Aug 13, 2013 · Viewed 36.3k times · Source

I want to get a list of all permissions for a specified list of mailboxes.

To get all permissions for just one, I can do this:

Get-MailboxPermission -Identity "Mailbox01"

What if I wanted to get a list of permissions for more than one mailbox at a time?

Something like:

Get-MailboxPermission -Identity "Mailbox01","Mailbox02","Mailbox03"

How could I do something like that - in one list?

Answer

CB. picture CB. · Aug 13, 2013

something like this should work:

"Mailbox01","Mailbox02","Mailbox03" | % { Get-MailboxPermission -Identity $_ }

Have to use a foreach because Get-MailboxPermission doesn't accept [string[]] as pipeline input or you can do:

"Mailbox01","Mailbox02","Mailbox03" | get-mailbox | Get-MailboxPermission