ADSI Calls From ASP Fail With (0x800401e4) or Invalid Syntax

ID: Q184665


The information in this article applies to:


SYMPTOMS

Calling ADSI from Active Server Pages fails with one of the following error messages:

MK_E_SYNTAX (0x800401e4)
Invalid Syntax


CAUSE

The error is invalid. This is a known issue in Windows NT.

Microsoft Internet Information Server is enforcing security by design. The code listed below can cause an unscrupulous user to stop all servers on a computer if they are permitted to call ADSI functions.

There is however, one valid case where the user is a Windows NT administrator and still gets this error message. If the Web server is configured to use Anonymous Authentication then the code will always fail. This is because the anonymous user is, by default, a guest on the computer and therefore does not have access to the ADSI interfaces.


RESOLUTION

To resolve this problem, obtain the latest service pack for Windows NT 4.0 or Windows NT Server 4.0, Terminal Server Edition. For additional information, please see the following article in the Microsoft Knowledge Base:

Q152734 How to Obtain the Latest Windows NT 4.0 Service Pack


WORKAROUND

Disable Anonymous Authentication and use Windows NT Challenge/Response authentication. Make sure that the authenticated user is in the Administrator group or is a site operator on that Web site.


STATUS

Microsoft has confirmed this to be a problem in Internet Information Server version 4.0. This problem was first corrected in Windows NT 4.0 Service Pack 4.0 and Windows NT Server 4.0, Terminal Server Edition Service Pack 4.


MORE INFORMATION

Active Server Pages can contain script which in turn calls ADSI settings. For example the following code will stop the first Web site:


   <%

      Dim vServer
      Set vServer = GetObject("IIS://MyComputer/W3SVC/1")
      vServer.Stop

   %> 
As you can see, ADSI is a very powerful way to administer your Web servers. However, you may get the error noted in the title if a user calls a page containing this code.


Keywords          : NT4SP4Fix 
Version           : winnt:4.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: April 27, 1999