Advertisement
Guest User

Untitled

a guest
Sep 24th, 2023
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://ExServer123.com/PowerShell/ -Authentication Kerberos;
  2. Import-PSSession $Session -AllowClobber;
  3.  
  4.  
  5. Get-MailPublicFolder -ResultSize Unlimited | Get-ADPermission | Where-Object {
  6. ($_.ExtendedRights -Like "Send-As") -and ($_.IsInherited -eq $False) -and -not ($_.User -like "*S-1-5-21-*")} |
  7. Select Identity,User;
  8.  
  9. Get-MailPublicFolder |
  10. Select Alias,PrimarySmtpAddress,@{N="GrantSendOnBehalfTo";E={$_.GrantSendOnBehalfTo -join "|"}
  11. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement