Link to home
Start Free TrialLog in
Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland

asked on

how to simplify forwarding mail on Outlook Web App ?

Hello !

i'm interested in simplifing the mail forwarding for our OWA.

Instead of creating rules in the owa front end i'd like to do this with a powershell script.

I'd like to add a simple form - single input text - that would accept an email address to forward mails to.

What would be the road for this ?
- should i need a web service in order to recover the address from the form and launch the Powershell script against exchange ?
- is there a simple possibility that OWA already has ?

any help and information would be appreciated.

Thank you in advance
Avatar of Jian An Lim
Jian An Lim
Flag of Australia image

you can explain how you want your powershell to work?

what is your single input text going to do?



There are definitely powershell able to do so but i can't map out what you really want.


powershell to manage inbox
https://msdn.microsoft.com/en-us/magazine/dn189202.aspx
Avatar of Erwin Pombett

ASKER

Hello Limjianan,

what i need to is
- display a simple page with one textbox. I need to be inside OWA in order to get the credentials.
- move the received data from customer to server side (adress to redirect to).
- launch from the webservice a powershell script that will set this forward against exchange.

thank you in advance for your help. actually i'm lost with this webservice, what do i have to do in order to be able to get the credentials.

toshi
To Toshi,

can you explain further.

1. why you need a simple page with a text box? what is the purpose of the text box?

2. for received data from customer to server side<-- can you explain what do you means?
how do you receive the data? in email ?

I am still unclear and I am trying to put my head together
Hello limjianan,

thank you for the interest in my problem.

1. this text box will be to enter the address  we want mail forwarded to.
2. from the front end - text box - i need to call something that can launch the powershell in order to pass the command of forwarding to exchange.  I was thinking about a webservice.

thank you in advance for further help.
toshi.
Okay. I reread your question again and trying to come out what i think you want.

there are certain information is not there.
in order to create a rules you need a condition and an action (and exception if required)

so you only have the action you want (forward to address)
so what is your condition?


also, what is your backend Exchange version? 2013?

EWS (webservice) is very particular and i am definitely not a programmer in that context.
I know exchange 2013 has the command of New-InboxRule that can fireup using powershell


https://technet.microsoft.com/en-us/library/dd335170%28v=exchg.150%29.aspx
Hello limjianan,

thank you so much for your comment.

Indeed, the rule would be to forward the mail,  the condition would be "all emails"

as for the version of exchange :
Exchange Server 2010
Microsoft Corporation
Version: 14.03.0169.001

do you mean that OWA for 2013 expose webservices ?

is there an example on how to work with webservices with OWA ?

thank you in advance.
Let's step all the way back to your requirement.
you want to forward ALL emails that arrive in a inbox to another email address

do you know there are simplier way to write a webservice? i always think webservice is for programmer. Powershell is for Administrator.


Anyway, you have 2 variable
# the user you want the rules to
$user=<samaccountname of the user>
# target address
$targetaddress= <email address>

get-mailbox $user | New-InboxRule "ForwardtoTargetaddress"  -ForwardTo $targetaddress


There are other method to do so like modify the targetaddress attribute (or forwarding address)
 
http://blogs.technet.com/b/timmcmic/archive/2014/07/28/exchange-and-office-365-mail-forwarding.aspx
i dont understand when you say "there are simplier way to write a webservice" ?

the powershell is not for me the enigmatic part.
I can not figure out how to add a webservice to the current OWA instance.

is there a simple way to add a webservice to the OWA ? or do you mean i can call powershell from the front end ?

thank you in advance for further reply.
Toshi
ASKER CERTIFIED SOLUTION
Avatar of Jian An Lim
Jian An Lim
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the thing is that i need  to move the information from the web client to the exchange server.

i never thought about looking for exchange web services, as you sais : EWS

do you have any link with code samples for EWS ?  otherwise i 'll close my question and open a new one ;)


toshi
sorry, i am not sure what do you mean move the information from the web client to exchange server?

any change you make via web client (OWA) will get to exchange server.

all of the activities like changing inbox rules via OWA (GUI driven),  run a powershell (command line driven) , or writing a webservice (programming driven) achieve the same result.

what type of simplification you are looking for?