Script for Exporting Shared Mailboxes Send-As users as a Primary SMTP Address for Exchange Server 2016

Script for Exporting Shared Mailboxes Send-As users as a Primary SMTP Address for Exchange Server 2016

You can use the following Script for printing shared mailboxes and the mailboxes which could send as it is :

$Mailboxes = Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited

ForEach ($Mailbox in $Mailboxes){

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

    foreach($user in $users){

        $SendAs = Get-Mailbox $user.tostring() | % {$_.PrimarySmtpAddress}

        Write-Host($Mailbox,$SendAs)

    }

}

Now output would be like given in the screenshot: 

No alt text provided for this image

Thanks for reading my article!! Stay tuned for more

要查看或添加评论,请登录

Syed Sabih Haider的更多文章

社区洞察

其他会员也浏览了