Hybrid : Full access permissions and automapping

I am trying to give Exchange Online user John@contoso.com Full access permissions and automapping to On-Prem mailbox Sales@contoso.com but am getting the error below:


Following: https://practical365.com/exchange-online/configuring-exchange-hybrid-cross-forest-permissions/


Set-ADUser -Identity John@contoso.com -Add @{msExchDelegateListLink/BL=Sales@contoso.com}
At line:1 char:79
+ Set-ADUser -Identity John@contoso.com -Add @{msExchDelegateListLink/B ...
+                                                                               ~
Missing '=' operator after key in hash literal.
At line:1 char:79
+ Set-ADUser -Identity John@contoso.com -Add @{msExchDelegateListLink/B ...
+                                                                               ~
The hash literal was incomplete.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEqualsInHashLiteral


Any ideas folks?
Christian HansUndecided... Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vasil Michev (MVP)Commented:
Automapping is not supported cross-premises. Even if it was, the formatting is off, those are two separate attributes: msExchDelegateListBL and msExchDelegateListLink. The first one is a 'backlink', this it's set on the delegate object and refers to the mailbox on which permissions are granted, the second one host the delegate DN.
Jose Gabriel Ortega CastroEE Solution Guide/Topic Advisor and CEO Faru Bonon ITCommented:
I think you're using the wrong cmdlet.

https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/add-mailboxpermission?view=exchange-ps

connect to exchange online
https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps
and run

Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Add-MailboxPermission -Identity "Sales@contoso.com" -User "John@contoso.com" -AccessRights FullAccess -InheritanceType All

Open in new window


The other solution would be from the on-premises itself, same cmdlet but on the Exchange Server PS console:
Add-MailboxPermission -Identity "Sales@contoso.com" -User "John@contoso.com" -AccessRights FullAccess -InheritanceType All

Open in new window


Give it a try

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.