Node Exchange Autodiscover
Retrieve the URL of your EWS by accessing Microsoft's SOAP Autodiscover Service.
Differs from other similar packages in that it queries the DNS. It also tries out all the potential
autodiscover urls in parallel, sacrificing a bit more bandwidth for speed.
Usage
const autodiscover = require('exchange-autodiscover');
autodiscover({ emailAddress: "foo@bar.onmicrosoft.com", password: "pass" })
.then(console.log.bind(console))
.catch(console.error.bind(console));
autodiscover({
emailAddress: "foobar@yourdomain.com",
password: "pass",
username: "ad\\foobar77"
}, function(err, ewsUrl) {
if (err) {
console.error(err);
} else {
console.log(ewsUrl);
}
});
You can optionally request any of the extra settings found here.
This will return an object with matched settings (EWS address will always be included by default).
autodiscover({
emailAddress: "foo@bar.onmicrosoft.com",
password: "pass",
settings: [
'EwsSupportedSchemas',
'ExternalEwsVersion'
]
}).then(function (settings) {
console.log(settings);
});
API
autodiscover(params, callback);