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
Erwin PombettAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Jian An LimSolutions ArchitectCommented:
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
Erwin PombettAuthor Commented:
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.

Jian An LimSolutions ArchitectCommented:
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Erwin PombettAuthor Commented:
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.
Jian An LimSolutions ArchitectCommented:
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
Erwin PombettAuthor Commented:
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.
Jian An LimSolutions ArchitectCommented:
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)
Erwin PombettAuthor Commented:
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.
Jian An LimSolutions ArchitectCommented:
you cannot simply add a webservice on OWA.
webservice is a programming function (using EWS API)

You can use powershell 2.0 (or above) on any workstation and fire up exchange powershell

doing the inbox rule using OWA (via the GUI interface), run a powershell command (via command line) achieve the same result.
WRiting a webservice (EWS) achieve the same result but you need to know programming (which i am definitely not one)

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
Erwin PombettAuthor Commented:
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 ;)

Jian An LimSolutions ArchitectCommented:
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?
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

From novice to tech pro — start learning today.