Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the IIS management script adsutil.vbs

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to use the IIS management script adsutil.vbs, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

What is Adsutil.vbs? It is an IIS management script based on the command line included with the IIS service of Windows 2003, located in the% SystemDrive%\ Inetpub\ AdminScripts directory, 95426 bytes. It is clear at a glance that such a large script must be very powerful, and it is true. I feel like a "Internet Information Services Manager" under the command line (in fact, Windows 2000 is managed by more than 20 VBS under% SystemDrive%\ Inetpub\ AdminScripts, but by 2003 only Adsutil.vbs is left, which shows how powerful it is).

When it comes to Adsutil.vbs, you have to mention MetaBase.bin, which is the most important configuration file for IIS. All IIS settings will eventually be stored in this file, and IIS Manager and Adsutil.vbs display it to the user by reading configuration information from this file. Its storage structure is very similar to the registry, is a tree storage structure. The IIS manager and Adsutil.vbs access the MetaBase.bin through a path of Adspath, starting with IIS:\\, where LocalHost represents the local server and W3svc represents the IIS service, such as IIS:\\ LocalHost/w3svc/1 represents the first WEB site on the local server, and IIS:\\ LocalHost/w3svc/1/root/Vdir represents the Vdir virtual directory under the root directory of the first WEB site.

Basic usage of Adsutil.vbs

With this preknowledge, let's go back to Adsutil.vbs and take a look at its usage:

C:\ Inetpub\ AdminScripts > cscript Adsutil.vbs

Microsoft (R) Windows Script Host Version 5.6

Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Usage:

ADSUTIL.VBS [[]]

Description:

IIS administration utility that enables the configuration of metabase properties

Supported Commands: / / supported command, which is the most important

GET,SET,ENUM,DELETE,CREATE,COPY,APPCREATEINPROC,APPCREATEOUTPROC,APPCREATEPOOLPROC,APPDELETE,APPUNLOAD, APPGETSTATUS

Configure access to the directory

C:\ Inetpub\ Admins cripts > chaccess.vbs-a w3svc/1/ROOT-verbose

Usage: chaccess controls the configuration path

[--computer |-c COMPUTER1 [, COMPUTER2...]] Specify the machine name, or IP.

[+ read |-read] read permissions under the home directory

[+ write |-write] write permissions under the home directory

[+ script |-script] the execution permission under the home directory is pure script

[+ execute |-execute] the execution permissions under the home directory are scripts and executable programs

[+ browse |-browse] directory browsing permissions under the home directory

[--verbose |-v] current version

[--help | -?]

Displays the properties and status information of the specified path

C:\ Inetpub\ Admins cripts > dispnode help

Usage: dispnode [--help |-h]

ADS PATH-The Path of the node to be displayed

Example 1: dispnode-an IIS://LocalHost/w3svc displays the main properties of the current IIS

Example 2: dispnode-- adspath IIS://MachineName/w3svc/1 displays the status information of the current site

Look for a named Web and display the node number, description, hostname, port, and IP address

C:\ Inetpub\ Admins cripts > findweb

Web Site Number = 1

Web Site Des cription = default Web site

Hostname =

Port = 80

IP Address =

C:\ Inetpub\ Admins cripts > findweb m7.net

Web Site Number = 2

Web Site Des cription = m7.net

Hostname = www.m7.net

Port = 80

IP Address = www.m7.net

Displays the specified site path management tree

C:\ Inetpub\ Admins cripts > disptree.vbs help

Usage: disptree [--ADSPath |-a ROOT NODE] specifies the path to display the management tree

[--NoRecurse |-n]

[--Help | -?]

Create a WEB virtual site

C:\ Inetpub\ Admins cripts > mkw3site help

Unknown argument help

Usage: mkw3site site pathname

WEB website logo

[--computer |-c COMPUTER1 [, COMPUTER2...]]

[--port |-o PORT NUM] port

[--IPAddress |-i IP ADDRESS] IP address

[--HostName |-h HOST NAME] hostname

[--SiteNumber |-n SITENUMBER]

[--DontStart] does not start

[--verbose |-v]

[--help | -?]

Create a virtual directory for the specified site

C:\ Inetpub\ Admins cripts > mkwebdir.vbs help

Usage: mkwebdir [--computer |-c COMPUTER1,COMPUTER2] specifies the server name

Specify virtual station roll call

Specify the virtual directory name and directory file address

[--help | -?]

Example: mkwebdir-c MyComputer-w "Default Web Site"

-v "dir1", "c:\ inetpub\ wwwroot\ dir1", "dir2", "c:\ inetpub\ wwwroot\ dir2"

Pause the IIS service for a specified site

C:\ Inetpub\ Admins cripts > pausesrv help

Usage: pausesrv

[--computer |-c COMPUTER1 [, COMPUTER2...]]

[--verbose |-v]

[--help | -?]

Example 1: pausesrv-a w3svcplink 1 Legend msftpsvcand2

Example 2: pauseftp-c MACHINE1,MACHINE2,MACHINE3-a w3svcUnip 1reel msftpsvcplic2

Resume IIS services for paused sites

C:\ Inetpub\ Admins cripts > contsrv.vbs help

Usage: contsrv

[--computer |-c COMPUTER1 [, COMPUTER2...]]

[--verbose |-v]

[--help | -?]

Example 1: contsrv-a w3svcplink 1 Legend msftpsvcand2

Example 2: contsrv-c MACHINE1,MACHINE2,MACHINE3-a w3svcUnip 1reel msftpsvcplic2

Usage is the same as above

Pauseftp.vbs suspends FTP server service

Contftp.vbs resumes paused FTP service

Pauseweb.vbs suspends Web server service

Contweb.vbs resumes paused WWW service

Stop the IIS server service for the specified site

C:\ Inetpub\ Admins cripts > stopsrv.vbs-a w3svc/2

Start the IIS server service for the specified site

C:\ Inetpub\ Admins cripts > startsrv.vbs-a w3svc/2

Stop the WEB server service for the specified site

C:\ Inetpub\ Admins cripts > startweb.vbs-a w3svc/2

Start the Web server service for the specified site

C:\ Inetpub\ Admins cripts > stopweb.vbs-a 2

Usage is the same as above

Stopftp.vbs stops the FTP server service

Startftp.vbs starts the FTP server service

Track the execution of scripts

C:\ Inetpub\ Admins cripts > synciwam.vbs-h

Usage: cscript synciwam.vbs [- v |-h]

-v verbose: trace execution of the script

-h help: print this message

Practical examples:

REM creates a virtual directory

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 300 create W3SVC/1/Root/%1 "IIsWebVirtualDir"

REM sets properties of a virtual directory

REM creates an in-process application (there is no difference between inproc and outproc in .net, but old scripts can still be used)

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 60 appcreateinproc W3SVC/1/Root/%1

REM sets the root directory of the application

Cscript scripts\ adsutil.vbs / / Nologo / / 60 set W3SVC/1/Root/%1/AppRoot / LM/W3SVC/1/Root/%1

REM sets the display name of the application

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 60 set W3SVC/1/Root/%1/AppFriendlyName 1

The isolation level of the application (not set in .net)

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 60 set W3SVC/1/Root/%1/AppIsolated 2

REM sets the path to the virtual directory

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 60 set W3SVC/1/Root/%1/Path 2

REM sets the execution permission of virtual directory. 513 is purely scripted.

Cscript scripts\ adsutil.vbs / / Nologo / / cscript scripts 60 set W3SVC/1/Root/%1/AccessFlags 513

REM sets the value of AuthFlags. 5 means to allow anonymous access and integrate Windows authentication.

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 60 set W3SVC/1/Root/%1/AuthFlags 5

REM sets the value of DirbrowseFlags. DirbrowseFlags is the switch parameter that controls directory browsing. It is more complicated, so just fill in it.

Cscript scripts\ adsutil.vbs / / Nologo / / TRV 60 set W3SVC/1/Root/%1/DirbrowseFlags 1073741886

REM sets the default document

Cscript scripts\ adsutil.vbs / / Nologo / / T set W3SVC/1/Root/%1/DefaultDoc 60 set W3SVC/1/Root/%1/DefaultDoc "Default.aspx"

REM sets directory permissions (readable, unwritable, browsable script resources, unviewable directories)

Cscript scripts\ chaccess.vbs / / Nologo / / cscript scripts 60-a W3SVC/1/Root/%1 + read-write + script-browse

The above is all the contents of the article "how to use the IIS Management script adsutil.vbs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report