question

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 asked emilyhua-msft edited

Export Send As Permissions

Hi All

i want to export sendas permissions for a shared mailbox. i am getting the error when using the below syntax in exchange online powershell

 Get-RecipientPermission -Identity sharedmailbox@contoso.com | Get-ADPermission | Where-Object {$_.extendedrights -like "*Send*"} | Select-Object Identity,User,@{Name="extendedrights";Expression={$_.extendedrights}}  | Export-Csv C:\temp\output.csv -NoTypeInformation

Get-ADPermission : The term 'Get-ADPermission' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:71
+ Get-RecipientPermission -Identity sharedmailbox@contoso.com | Get-ADPerm ...
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-ADPermission:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

office-exchange-server-administrationoffice-exchange-online-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

michev avatar image
0 Votes"
michev answered

There is no such cmdlet in Exchange Online. Use this instead:

 Get-RecipientPermission shared@domain.com | ? {$_.Trustee -ne "NT AUTHORITY\SELF" -and $_.Trustee -ne "NULL SID"} | select Identity, Trustee, AccessRights | Export-Csv -nti blabla.csv
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.