Page 1 of 1
[Solved] OWA : Test availability of a user's mailbox
Posted: Wed Aug 08, 2012 8:06 am
by philippe
Hi,
I would like to perform, with a script :
- a logon to an address like this : https//<my_server>/owa with an existing user
- a check for a specific string on the displayed page
- a logout.
The exchange server is IIS 7.5 and it creates cookies marked 'HttpOnly'.
I've tested scripts with webinject, put the logon fails everytime.
Does anyone knows a script which does that ?
I've searched online but I've found nothing to do that ;-(
Thanks by advance !
Re: OWA : Test availability of a user's mailbox
Posted: Wed Aug 08, 2012 10:06 am
by scottwilkerson
You may be able to do this with check_http. There is some details on getting something similar running at
http://www.mail-archive.com/nagios-user ... 27318.html
Re: OWA : Test availability of a user's mailbox
Posted: Fri Aug 10, 2012 7:55 am
by philippe
thank you for your reply

I've tried your solution, but it doesn't work : I'm always redirecting to the login page.
I've also tried : check_basicauth2.pl, check_basicauth.pl, check_http_ntlm.pl, check_owa.php, owa.py, owa.sh unsuccesfully.
I'm always redirected to the login page.
Found on the net, this code is doing what I want (it displays the inbox of the user)
Code: Select all
<script>
function LoginToOWA (server,domain,username,password) {
var url = "https://" + server + "/owa/auth/owaauth.dll";
var p = {destination:'https://' + server + '/owa',flags:'0',forcedownlevel:'0',trusted:'0',isutf8:'1',username:domain + '\\' + username,password:password};
var myForm = document.createElement("form");
myForm.method="post" ;
myForm.action = url ;
for (var k in p) {
var myInput = document.createElement("input") ;
myInput.setAttribute("name", k) ;
myInput.setAttribute("value", p[k]);
myForm.appendChild(myInput) ;
}
document.body.appendChild(myForm) ;
myForm.submit() ;
document.body.removeChild(myForm) ;
}
</script>
<body onload="javascript:LoginToOWA('MY_SERVER','DOMAIN\USERNAME','PASSWORD');">
<h3>Please wait while redirecting to OWA...</h3>
</Body>
But my server has no graphical interface and I don't know how to transform it to a webinject script or how to use it with check_http or curl (I'm a newbee !)
Re: OWA : Test availability of a user's mailbox
Posted: Fri Aug 10, 2012 9:30 am
by yancy
philippe,
Do you know if your IIS configuration is using NTLM authentication?
-Yancy
Re: OWA : Test availability of a user's mailbox
Posted: Tue Aug 14, 2012 4:37 am
by philippe
yancy,
the server doesn't use the ntlm authentication
philippe
Re: OWA : Test availability of a user's mailbox
Posted: Tue Aug 14, 2012 9:47 am
by yancy
Re: OWA : Test availability of a user's mailbox
Posted: Mon Aug 20, 2012 2:55 am
by philippe
yancy,
I've tested the script check_owa by Chris Funderburg but it always returns OK even if I wrote a wrong password.
Finally I've used a curl command and I've written a shell script to detect strings when the user is connected to his mailbox.
Now all is OK !
Code: Select all
curl -q -k -d "destination=https://${SERVER}/owa&flags=0&username=${USERNAME}&password=${PASSWORD}&isutf8=1" \
https://${SERVER}/owa/auth/owaauth.dll -L -b cookies.txt
Thank you for your help

Re: [Solved] OWA : Test availability of a user's mailbox
Posted: Mon Aug 20, 2012 9:21 am
by yancy
philippe,
Great news!! Feel free to post your shell script on Nagios Exchange
http://exchange.nagios.org/ for others to use
Regards,
-Yancy