Get-Mailboxpermission for list of Mailboxes

こ雲淡風輕ζ 提交于 2019-12-06 07:38:38

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
Brian T Grant

You should first pull a list of the mailboxes needed and pipe into a variable or paste into a .CSV file (I prefer CSV files). Example:

Get-Mailbox -resultsize unlimited   | Where-Object {$_.RecipientType -like "UserMailbox"} | select userprincipalname, ForwardingAddress |out-gridview

$CSV = import-csv "c:\CSV.csv"

$CSV |out-gridview 

$CSV | foreach {get-MailboxPermission -identity $_.userprincipalname} |out-gridview

with the Gridview you can then further sort on multiple values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!