Powershell script

Hi Scripting guys 

I've been given a task to export all users with full mailbox access on shared mailboxes, and there's about 90+ shared mailboxes . Any help would be appreciated.  and i'm using exchange 2010 SP2.

March 25th, 2013 1:38pm

Hope the following script is useful for you

Get-mailbox -Filter:"RecipientTypeDetails -eq 'SharedMailbox'" -Server "<servername>"  -resultsize "Unlimited" | Get-MailboxPermission | where { ($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like "NT AUTHORITY\SELF") } | ft @{Name="Identity";expression={($_.Identity -split "/")[-1]}}, User -AutoSize

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2013 6:32am

Hey Estono

I searched for the quickest solution to export all users with full mailbox access on shared mailboxes and found this powershell script 

$OutputFile = "C:\Temp\PermissionExport.txt"
"DisplayName" + "^" + "Alias" + "^" + "Full Access" + "^" + "Send As" | Out-File $OutFile -

 $Mailboxes = Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Select Identity, Alias, DisplayName, DistinguishedName

ForEach ($Mailbox in $Mailboxes) {

        $SendAs = Get-ADPermission $Mailbox.DistinguishedName | ? {$_.ExtendedRights -like "Send-As" -and $_.User -notlike "NT AUTHORITY\SELF" -and !$_.IsInherited} | % {$_.User}

        $FullAccess = Get-MailboxPermission $Mailbox.Identity | ? {$_.AccessRights -eq "FullAccess" -and !$_.IsInherited} | % {$_.User}

 

        $Mailbox.DisplayName + "^" + $Mailbox.Alias + "^" + $FullAccess + "^" + $SendAs | Out-File $OutputFile -Append

}

I hope this code helps you

Thanks

~Dex

March 25th, 2014 2:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics