Skip navigation

IIS Informant: Managing IIS 5.0 from NT

I'm using Microsoft Active Directory Service Interfaces (ADSI) to run administrative scripts on IIS 4.0. However, when I attempt to use those scripts to manage an IIS 5.0 server remotely, the script fails. Do compatibility problems exist with ADSI, IIS 5.0, and IIS 4.0?

ADSI is the means by which you can use a script to modify metabase settings. You can write your code in VBScript or JScript (Microsoft's implementation of JavaScript), then place this code in Active Server Pages (ASP) or Windows Script Host (WSH) files. Using ASP and ADSI, you can access and modify the IIS metabase as well as other databases, such as Windows 2000 Active Directory (AD) or the Windows NT 4.0 user database.

Many IIS administrators haven't fully embraced scripting as a means of IIS administration. So, I'd like to give you some reasons why you need to get started with scripting (if you haven't already):

  • You can perform many tasks with scripting that you simply can't accomplish in the UI. For example, you can set many tuning adjustments and security and authentication settings only by modifying the metabase.
  • You can remotely create, modify, or troubleshoot IIS.
  • You can automate the task of creating Web sites and virtual directories. This ability can be quite useful for ISPs, for example, who might create tens or hundreds of Web sites daily and need each of them to be identical. A script can be made available to administrators to query for relevant information such as a username and password, create a user account, create a Web site, assign a default page, install FrontPage Server Extensions, and perform other tasks. Such a script could be connected to an order entry system so that Web sites are created immediately upon placing an order.
  • You can iterate through your sites and servers and apply uniform updates and changes or automatically create backups of the metabase.
  • In IIS 5.0, you can extend the metabase with custom properties and values to create globally accessible variables and settings.

Microsoft has installed on your Win2K/IIS 5.0 and NT/IIS 4.0 servers a set of sample administrative scripts for you to use. One of the most frequently asked questions I receive is, How can I use a script to stop and start a Web site? Scripts for that and other purposes are provided in \inetpub\adminscripts (in IIS 5.0) and \winnt\system32\inetsrv\adminsamples (in IIS 4.0). Microsoft provides many more scripts in the Microsoft Internet Information Server 4.0 Resource Kit.

In addition to having access to details about IIS, ADSI lets you inquire about server status, user and group account information, and other information related to server services. Using ADSI, you can route the user to a Web page based on group membership. If you want to take a quantum leap in your IIS administrative skills, you've got to learn something about ADSI scripting.

To answer the question, ADSI lets you use a script to modify the metabase, but IIS 5.0 and IIS 4.0 have different metabase schemas (i.e., structures). Consequently, if you try to use ADSI on an NT 4.0 server to modify the metabase on an IIS 5.0 server, the script fails. The reverse is also true. Fortunately, Microsoft has a fix for this bug, but you have to ask for it. See the Microsoft article "Can't Administer IIS by Using ADSI on Windows NT 4.0 IIS 4.0 from Windows 2000 IIS 5.0 and Vice Versa" (http://support.microsoft.com/support/kb/articles/q262/7/39.asp) for details. NT 4.0 isn't installed with a full feature set for ADSI, so you need to download the latest version of ADSI from http://www.microsoft.com/ntserver/nts/downloads/other/adsi25/default.asp.

To learn about ADSI scripting, go to http://www.microsoft.com/technet, then search on ADSI. You'll find many articles, examples, and white papers about the topic. In addition, you can find books about ADSI at http://www.wrox.com and online articles at http://www.15seconds.com.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish