However, when you use the ServerXMLHTTP object, the error can also occur when the NT User ID (under whose credentials the ServerXMLHTTP object code is executing) has the rights that are required to execute the HTTP operation that is specified as the first parameter of the object's Open method.
- Proxycfg.exe was not executed to correctly set the proxy settings that are required by ServerXMLHTTP.
- Microsoft Internet Information Server (IIS) was not restarted after Proxycfg.exe was run to specify the proxy settings required by ServerXMLHTTP.
The 401-Access Denied HTTP error may also occur under the following conditions:
- There is no proxy server.
- You are trying to access a site that is configured to use Integrated Windows authentication.
- A Valid NT User ID and password are not supplied in the call to the Open method of the ServerXMLHTTP Object.
- The logged on user (that is, the user under whose credentials the ServerXMLHTTP object code is executing) does not have the required access permissions to execute the requested HTTP operation.
- Is a proxy server set?
- Can the proxy server be bypassed for the particular Web server to which the request is sent?
The following Knowledge Base article describes settings that can correct the problem if the environment uses a proxy server:
If you want to use the ServerXMLHTTP auto logon feature in an environment that does not use a proxy server (to access a site that is configured to use Integrated Windows authentication), you should set the Proxycfg.exe settings using a command identical to the following. Include the name(s) of the Intranet IIS Servers against which you wish to execute HTTP operations using the ServerXMLHTTP object in the semicolon (;) separated proxy bypass list:
proxycfg -d -p "<local>" "< ; separated list of servers to bypass using a proxy>"
Alternatively, explicitly supplying the NT username and password in the call to the Open method of the ServerXMLHTTP object as shown in the following example also fixes the problem:
SXH.Open "GET", MyUrl, false, "Valid NT UserName", "NT UserPassword"
Article ID: 291008 - Last Review: Nov 9, 2009 - Revision: 1