Mailbox Permission Question


  • I am not a pro at PS, but I need a list of permissions on some Exchange 2007 mailboxes that are permissions that are NOT inherited on a specific set of mailboxes.  I have a text file with SAM account names that I want to use to pull into a script.  I also want the script to output the data to a CSV file, in the following format:

    Display NameUser Access Rights


    Joe User LoginName Full Access, Read Access etc

    So far, I have this.  But the Access Rights field returns the following on the output: Microsoft.Exchange.Management.RecipientTasks.MailboxRights[].  Any help appreciated!


    [Array] $mbpermCollection = @() 
    $InputFile = @(Get-Content C:\Scripts\users.txt)

    # Get All Mailboxes Contained on Input Text File 
    $InputFile | Get-Mailbox | Select DistinguishedName, Displayname | ForEach {

    # Get Access Rights for User Mailbox
    $MBPerms = Get-MailboxPermission $_.DistinguishedName | where { ($_.IsInherited -eq $false)} | Select Identity, User, AccessRights

    $mboutput = "" | Select "Display Name", User, "Access Rights" 
    $mboutput."Display Name" = $_.DisplayName
       $mboutput.User = $mbperms.User
    $mboutput."Access Rights" = $mbperms.AccessRights

    $mbpermCollection += $mboutput

    $mbpermCollection | Export-Csv C:\Scripts\"MailboxPerms $(Get-Date -f 'yyyyMMdd').csv" -NoType

    Wednesday, November 21, 2012 8:03 PM


All replies