I referred the above tutorial to setup email forwarding in exchange. It was working fine when I configured email forwarding from EAC. But it was to another user in the same domain.
But when I tried to forward the mails to a gmail account using powershell, even though the code executed successfully mails are not forwarded to the target gmail account and whenever i send mails to the configured outlook mail I receive the following error : "Delivery has failed to these recipients or groups:". But the mail gets delivered.
The powershell code i used is this :
Set-Mailbox -Identity "cliff" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "<recipient>@gmail.com"