The IIS Resource Kit CD includes several sample scripts that can give you a starting point for scripting many administrative tasks.
Note: These scripts are provided for educational purposes only. They have not been tested in a production environment, and Microsoft will not provide technical support for them.
To view the source files for the scripts, and to run them, see the CD that accompanies the Resource Kit.
The list provided here is intended for reference. There are over 40 sample scripts written in VBScript.
They are divided into the following categories:
- display
- group/user administration
- server creation
- server state operation
- communication
- file and directory administration
- logging services
- virtual directory administration
- metabase backups and restore
There are also several sample scripts written in JScript.
Display Scripts - These scripts display locations and file names in nodes and directory trees.
DisplayNode - Displays the relevant fields for a particular administrative node in the tree.
DisplayProperty - Displays any property of an arbitrary administration object.
DisplayTree - Displays the tree of administration objects starting from the specified root node ROOT or at IIS://LocalHost/ if no root node is specified. For each node, it displays the node’s name, class, and if it is a virtual server, the ServerComment. By default, the script recurses through the tree, displaying all the deeper nodes as well. This behavior is disabled by the NoRecurse argument.
Find - Walks the tree of administration nodes searching for a node that matches the parameters specified at the command line. Displays the full ADSI path of all matching nodes.
Group/User Administration Scripts - These scripts perform user administration tasks—adding or deleting users, assigning users to groups, changing passwords and properties, and the like.
AddUserToGroup - Adds the specified user to the specified group.
ChangeUserPassword - Changes the password for the specified user
ChangeUserProperty - Changes the specified properties to their new specified values for each user passed in
CreateUser - Creates a new user in the specified domain. It adds the user to all the specified groups (if they exist) and inserts the full name and description into the NT user database.
DeleteUser - Deletes one or more users from the specified domain.
DeleteUserFromGroup - Deletes the specified user to the specified group.
UserGroups - Adds and removes the specified users to and from the specified NT user groups
Server Creation Scripts - These scripts create virtual FTP servers and Web servers. As noted, some are full-featured scripts that enable an ISP to set up a Web or FTP site for a new customer.
CreateVirtualFTPServer - Creates a new virtual FTP server (FTP site) for an ISP’s new customer. A full-featured script.
CreateVirtualWebServer - Creates a new virtual Web server (Web site) for an ISP’s new customer. A full-featured script
CreateVirtualWebServerPool - Creates a “pool” or group of virtual Web servers.
CreateWebSite - Creates a new virtual Web server (Web site).for an ISP’s new customer
MkWebSrv - Creates a Web site.
Server State Operation Scripts - These scripts start, stop, pause, and resume Web servers and FTP servers.
PauseServers - Pauses a group of servers specified on a list
PauseWebServers - Pauses the specified Web servers
StartServers - Starts a group of servers specified on a list
StartWebServers - Starts the specified Web servers
StopServers - Stops a group of servers specified on a list
StopWebServers - Stops the servers specified
StopFtpServers - Stops the specified FTP servers
StartFtpServers - Starts the specified FTP servers
PauseFtpServers - Pauses the specified FTP servers
UnPauseWebServers - Causes the specified paused Web servers to resume operation
UnPauseServers - Causes a group of servers specified by a list to resume operation
UnPauseFtpServers - Causes the specified paused FTP servers to resume operation
Communication Scripts - These scripts send e-mail messages enabling you to automate notification services for creation or servicing of Web sites, users, and groups.
SendMail - Sends an e-mail message written at the time of command creation to the specified user. Better for short, spontaneous messages.
SendText - Packages and sends a text file in an e-mail message to the specified user. Better for longer messages or for sending copies to multiple recipients.
File and Directory Administration Scripts - These scripts enable you to set root directories, perform searches, perform file copies, and the like.
AppCreate - Designates a Web directory or virtual directory as an application root.
ChangeProperty - Modifies the access restrictions on a site or virtual directory (ModifyAccessRestrictions)
Clone - Copies an object including its parent object.
DeleteNode - Delete an arbitrary node in the administrative tree.
DFoot - Configures document footers.
MatchProperty - Searches the administration tree from a given node for an object property value.
SearchTree - Searches the administration tree from a given node for an object name.
Logging Services Script - This script configures logging services.
LogEnum Configures logging services for IIS.
Virtual Directory Administration Scripts - These scripts create or delete virtual directories for FTP or Web servers. In the case of near-identical scripts such as CreateFtpVirtualDir and CreateVirtualFTPDir, the size, complexity, and available options vary from one to the next.
CreateFTPVirtualDir - Creates a new virtual directory for an FTP server.
CreateVirtualFTPDir - Creates a new virtual directory for an FTP server.
CreateWebVirtualdir - Creates a new virtual directory for a Web server.
CreateVirtualWebdir - Creates a virtual Web directory on the specified web server and with the specified path.
DeleteFTPVirtualDir - Deletes an FTP virtual directory.
DeleteWebVirtualDir - Deletes a Web virtual directory.
Metabase Backup and Restore Scripts -These scripts administer metabase backup files.
MetaBack - Creates a backup of your metabase
MetaBackDel - Deletes a metabase backup.
MetaBackEnum - Lists the current versions of metabase backups.
MetaBackRest - Restores the specified backup of your metabase.
RegFilt - Installs a new ISAPI filter on the server or service.