IIS management automation tutorial (1)

Source: Internet
Author: User

Understanding scripts
Windows Script Host has two versions: Windows-based javaswscript.exe), which provides the property sheet used to set the script attributes. The command line is used to set the script attributes. Run the following command at the command prompt:
Cscript // H: cscript
Register cscript.exe as the default Script Host for running the script. use notepad or another text editor to write the following code as a line:
WScript. Echo "Path of the current default site:" + GetObject "IIS: // localhost/W3SVC/1/ROOT"). Path );
Save this document as rootpath. js, and then type the following command at the command line prompt:
Rootpath. js
If everything on the server is normal, you can see the output shown in 1, which shows the path of the current default site. This is just a very simple little script.

 
Figure 1 path of the current default site

IIS configuration database
Before using scripts to manage IIS, you must have knowledge about the configuration database for storing IIS configuration settings.
The configuration database is used to store the level of IIS configuration settings. It performs the same functions as the Windows registry, but is only used for IIS. The configuration database configuration and architecture of Microsoft IIS 4.0 and Microsoft IIS 5.0 are stored in binary files and are not easy to read or edit. IIS 6.0 replaces a single binary file with a plain text file, an xml file named MetaBase. xml, and MSSchema. XML. These files are stored in the % SystemRoot % \ System32 \ Inetsrv folder of the computer. Note that C: \ Windows is usually the system root folder ). Only users in the Administrators group can view and modify these files. Because the IIS 6.0 configuration database is in XML format, use Microsoft Internet assumerie). Open Metabase. xml in the % SystemRoot % \ System32 \ Inetsrv folder to view the database, as shown in figure 2 ).


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.