Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Get-MailboxPermissions of multiple files

$
0
0

I am trying to set up an audit which requires that I dump all permissions into a CSV.  I have script that reads a file of mailbox names and and am able to extract permissions.  However, all of the permissions are listed in the CSV file and I am not able to distinguish which permission belongs to which file.  Any guidance would be appreciated.

$list = Import-CSV "C:\powershell\MailPermissions.csv"

Foreach ($entry in $list) {
$user = $entry.comit
$tmp = get-mailbox -identity $user | Get-MailboxPermission | ?{-not ($_.User -match “NT AUTHORITY”) -and ($_.User -match “AMS\\X”) -or ($_.User -match “EUR\\X”)}

    $Content+=  $tmp

  }
$Content | Export-CSV -path 'c:\powershell\MailPermissions_output.csv'

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles