Hallo,
As a part of my custom command I'd like to create forward from a mailbox to an external SMTP. Unfortunately I cann't use below script because of security policy:
$exchangeServer = "ExchangeServer.domain.com" # TODO: modify me
$smtpAddress = "%adm-CustomAttributeText1%" # TODO: modify me
# Create a remote PowerShell session to Exchange Server
$session = New-PSSession -configurationname Microsoft.Exchange -connectionURI http://$exchangeServer/PowerShell
Import-PSSession $session -DisableNameChecking -AllowClobber
# Enable forwarding
Set-Mailbox -Identity "%distinguishedName%" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress $smtpAddress
# Close the remote session and free up resources
Remove-PSSession $session
Is it possible to create such forward to the external smtp by using SDK?
My external address will be always %firstname%.%lastname%@domain.gmail.com
of course firstname and lastname shoud have only small letters ;)
I try to do it by myself but I stuck on bing contact for forward. Could you please help me?