0 votes

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?

by (510 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello,

Currently, Adaxes ADSI API does not support setting an external forwarding address. We have such a request in our product backlog, but currently this functionality is not available in the API. By the way, if your policy applies to connections via remote PowerShell or something of that kind, using Adaxes Exchange API does not comply with such a policy either. When performing Exchange Tasks, the ADSI API also uses remote PowerShell. That is, in other words, when we add the possibility to set an external forwarding address, the API will be executing approximately the same PowerShell commands as in your initial post.

Related questions

0 votes
1 answer

I am trying to use a property pattern to prevent email forwarding to accounts in other domains managed by Adaxes. Here is my regex: ^([^,]+,)+(DC=domain,DC=local) ... 't working? Is Adaxes using some other value before resolving the DN? Thanks in advance! Leah

asked May 9, 2019 by loliver (120 points)
0 votes
1 answer

I would like to add a parameter for country to a custom command. Since the country has to be entered correctly in order for Active Directory to accept it, I would like to ... ? I didn't find it in the documentation and the sample scripts didn't use parameters.

asked Jun 4, 2020 by mark.it.admin (2.3k points)
0 votes
1 answer

Hi, For our students we use the ForwardingSMTPAddress property to forward their email to an external address like this: Set-Mailbox -Identity mailboxalias - ... virtual property an have a business rule for user change perhaps? /Jonas

asked Sep 5, 2014 by JonasP (50 points)
0 votes
1 answer

Hi, based on this article How to create Resource Mailboxes a few slide modifications aside we are currently creating resource and equipment mailboxes in our on-premise environment. ... to O365. Does this work at all? Appreciate your input. Kind Regards Ingemar

asked Oct 26, 2016 by ijacob (960 points)
0 votes
1 answer

Pretty easy to replicate. On the Adaxes server, you can use Powershell to send to that SMTP server so we know it's not a firewall issue: $myCredential = Get- ... packet capture shows the Adaxes server doesn't issue either an EHLO or a STARTTLS command.

asked Jun 28 by ngb (290 points)
3,544 questions
3,235 answers
8,229 comments
547,809 users