I am having an problem I can't figure out using Classic ASP to set an appointment using an Exchange EWS post via SOAP.
The code works about 50% of the time; it depends on the exchange user that I am trying to set the appointment for.
Using the exact code below, I specify some users & the appointment is created perfectly. When I specify others users it just returns 401 unauthorized errors.
I don't have access to the Exchange Server so I can't check the user setups myself but I am being told their is no difference. One of our python developers was able to get it to work using NTLM authentication. I don't know how to implement that into the code below, nor can I find any examples.
TARGETURL="https://mail.foo.com/ews/exchange.asmx"
USERNAME="testuser1@foo.com"
PASSWORD="abc123"
reqStr = ""
reqStr = reqStr & "<?xml version='1.0' encoding='utf-8'?>"
reqStr = reqStr & "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
reqStr = reqStr & " xmlns:m='http://schemas.microsoft.com/exchange/services/2006/messages'"
reqStr = reqStr & " xmlns:t='http://schemas.microsoft.com/exchange/services/2006/types'"
reqStr = reqStr & " xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
reqStr = reqStr & " <soap:Header>"
reqStr = reqStr & " <t:RequestServerVersion Version='Exchange2007_SP1' />"
reqStr = reqStr & " <t:TimeZoneContext>"
reqStr = reqStr & " <t:TimeZoneDefinition Id='Eastern Standard Time' />"
reqStr = reqStr & " </t:TimeZoneContext>"
reqStr = reqStr & " </soap:Header>"
reqStr = reqStr & " <soap:Body>"
reqStr = reqStr & " <m:CreateItem SendMeetingInvitations='SendToNone'>"
reqStr = reqStr & " <m:Items>"
reqStr = reqStr & " <t:CalendarItem>"
reqStr = reqStr & " <t:Subject>ABC Company Appointment</t:Subject>"
reqStr = reqStr & " <t:Body BodyType='HTML'>Speak to discuss pricing</t:Body>"
reqStr = reqStr & " <t:Start>2017-04-05T15:20:00.000Z</t:Start>"
reqStr = reqStr & " <t:End>2017-04-05T16:20:00.000Z</t:End>"
reqStr = reqStr & " <t:Location>Conference Room 1</t:Location>"
reqStr = reqStr & " <t:MeetingTimeZone TimeZoneName='Eastern Standard Time' />"
reqStr = reqStr & " </t:CalendarItem>"
reqStr = reqStr & " </m:Items>"
reqStr = reqStr & " </m:CreateItem>"
reqStr = reqStr & " </soap:Body>"
reqStr = reqStr & "</soap:Envelope>"
'Perform the actual post
set oXMLHTTP=CreateObject("MSXML2.XMLHTTP")
set oXML=CreateObject("MSXML2.DOMDocument")
' Send the request
oXMLHTTP.Open "POST", TARGETURL, false, USERNAME, PASSWORD
oXMLHTTP.SetRequestHeader "Content-Type", "text/xml"
oXMLHTTP.Send reqStr