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.
Technology Tips and News
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.
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
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