The same approach is possible with a small javascript.
1 var strCookies;
2 var strRequest;
3 var objXmlResult;
4
5 try
6 {
7 strCookies = doFBALogin("https://exchangeserver/public", "exchangeserver", "domain\\username ", "password");
8
9 strRequest = "<D:searchrequest xmlns:D = \"DAV:\" ><D:sql>SELECT \"DAV:displayname\" FROM \"https://exchangeserver/public\" WHERE \"DAV:ishidden\" = false</D:sql></D:searchrequest>";
10
11 objXmlResult = Search("https://exchangeserver/public", strRequest, strCookies);
12
13 // Do something with the XML object
14 }
15 catch (e)
16 {
17 // Handle the error!
18 }
1 function Search(strUrl, strQuery, strCookies)
2 {
3 // Send the request to the server
4 var xmlHTTP = new ActiveXObject("Microsoft.xmlhttp");
5 var i;
6
7 xmlHTTP.open("SEARCH", strUrl, false);
8 xmlHTTP.setRequestHeader("Content-type:", "text/xml");
9
10 // Add the cookies to the request. According to Microsoft article Q234486, the cookie has to be set two times.
11 xmlHTTP.setRequestHeader("Cookies", "Necessary according to Q234486");
12 xmlHTTP.setRequestHeader("Cookies", strCookies);
13 xmlHTTP.send(strQuery);
14
15 return xmlHTTP.responseXML;
16 }
17
18
19 function doFBALogin(strDestination, strServer, strUsername, strPassword)
20 {
21 var xmlHTTP = new ActiveXObject("Microsoft.xmlhttp");
22 var strUrl
23 var strContent;
24 var arrHeader;
25 var strCookies;
26 var intCookies;
27 var i;
28
29 // Prepare the URL for FBA login
30 strUrl = "https://" + strServer + "/exchweb/bin/auth/owaauth.dll";
31
32 xmlHTTP.open("POST", strUrl, false);
33
34 xmlHTTP.setRequestHeader("Content-type:", "application/x-www-form-urlencoded");
35
36 // Generate the body for FBA login
37 strContent = "destination=" + strDestination + "&username=" + strUsername + "&password=" + strPassword;
38 xmlHTTP.send(strContent);
39
40 // Get all response headers
41 arrHeader = xmlHTTP.getAllResponseHeaders().split("
42 strCookies = "";
43
44 intCookies = 0;
45
46 // Iterate through the collection of returned headers
47 for (i = 0; i<arrHeader.length; i++)
48 {
49 // If the entry is a cookies, extract the name/value
50 if (arrHeader[i].indexOf("Set-Cookie") != -1)
51 {
52 strCookies += arrHeader[i].substr(12) + "; ";
53 intCookies++;
54 }
55 }
56
57 // Check if two cookies have been returned. Otherwise throw an exception
58 if (intCookies < 2) throw"Could not log in to OWA!";
59 return strCookies;
60 }