The information in this article applies to:
SUMMARYThere are a number of ways to access the interactive desktop using CGI, ISAPI extensions and ISAPI filters. The method you choose is important and requires consideration. This is article is a guide to help you decide what process to use. Three main settings dictate whether accessing the desktop will be successful or not: CreateProcessAsUserThe CreateProcessAsUser metabase setting dictates whether Internet Information Server (IIS) invokes a CGI application under the user context specified in the Internet Service Manager, or executes the CGI application to run in the System context. Keep in mind, when an application is running in the context of the System, it has complete control over the computer and any security holes in your CGI application can compromise your system. It is suggested that you toggle this setting only on the CGI application and not an entire Virtual Directory within IIS. See the "More Information" section for information on how to use this setting.Interact with DesktopThis property, a part of the IIS Admin Service, allows IIS (and all applications spawned by IIS with CreateProcess()) to interact with the default desktop. You may not want to allow all applications running on your Web server to have access because of potential additional message boxes being displayed. There is a way to allow applications running under the System context to programmatically access the default desktop. See the "More Information" section for information on how to configure this checkbox and programmatically access the default desktop.IIS Security SettingsWhether the security set on a CGI Application is "Anonymous" or "NTLM" can have affects on whether the application can access the desktop. See the following table for information specific to ISAPI or CGI.CGI
N/A = Not applicable
MORE INFORMATIONCreateProcessAsUserTo change the CreateProcessAsUser setting in the metabase, you must take a few things into consideration. Only files in the Web root, folders in the Web root, and the Web root itself can be set to have this property. Any attempt to set the properties on a file in a subfolder of the root will fail. If this property is set on an entire folder, then any CGI executables will be launched in the context of the system. This can be a potential security threat. It is recommended that you keep your CGI application in the Web's root, and only allow it to have system privileges.The ADSUTIL administrative script will allow you to change the file. The command syntax is as follows:
Example:ADSUTIL.vbs is typically located on Windows NT 4.0 computers at:
ADSUTIL.vbs is typically located on Windows 2000 computers at:
Interact with DesktopSteps to set the IISADMIN service to interact with the desktop:
How to Programmatically Access the DesktopThe following code demonstrates how to switch to the interactive user's desktop in order to manipulate windows. Note, this only works if the user account that is logged in has permission to access the desktop. By default, the System always has access. The code has no error-handling and is meant merely as a concise example of what functions that are called when attempting to access the desktop.
REFERENCESFor additional information, please see the following article(s) in the
Microsoft Knowledge Base: Q173687 HOWTO: Access the Application Desktop from a Service Additional query words: Service, ISAPI, Internet Information Server, IIS, desktop, interactive, window, ASP, Active Server Pages
Keywords : kbASP kbASP400 kbCGI kbISAPI300 kbISAPI400 kbiis300 kbiis400 kbiis500 |
Last Reviewed: November 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |