Article ID: 816568 - Last Review: September 4, 2008 - Revision: 6.0 How to manage Web sites and Web virtual directories by using command-line scripts in IIS 6.0
For a Windows 2000 version of this article, see 308622
(http://support.microsoft.com/kb/308622/
)
.
On This PageSUMMARYThis article describes how to use command-line scripts to
perform some common administrative tasks that pertain to the management of Web sites and Web virtual
directories in Internet Information Services (IIS) 6.0. It also describes how to use
the Iisweb.vbs script to create and delete Web sites, and how to use the
Iisvdir.vbs script to create and delete Web virtual
directories. OverviewIIS 6.0 includes several supported command-line scripts that use the Windows Management Instrumentation (WMI) provider to configure and manage IIS metabase configurations on local or remote computers that are running IIS. You can use these scripts to automate tasks, remotely administer sites and resources, and take advantage of batch files to create and manage objects. Microsoft supports the command-line scripts that are included in IIS, assuming that those scripts are not modified. If you want to modify a supported script, save it under a new file name so that the original script remains unmodified.The scripts are located in the %SystemRoot\System32 folder. You must be a member of the Administrators group on the local computer to run scripts and executables. To open a command prompt to perform any of the tasks that are described in this article, follow these steps:
To Create and Manage Web SitesTo create and manage Web sites by using the Iisweb.vbs script, use the following methods.To Create a New Web SiteTo create a new Web site configuration, use the iisweb /create command. This command does not create content, but it sets up the folder structure and some IIS configuration files. When you use Iisweb.vbs to create a new Web site, you specify only the basic properties that are required to create the site and identify its contents. To configure more advanced properties, use IIS Manager.The Iisweb /create command uses the following syntax: iisweb /create PathSiteName [/b Port] [/i IPAddress] [/d HostHeader] [/dontstart] [/s Computer [/u [Domain\]User /p Password]]
The parameters used by Iisweb /create are described as follows:
iisweb /create C:\MySource "My Site" /d www.mywebsite.com /dontstart
To Delete a Web SiteTo delete a Web site configuration, use the iisweb /delete command. This command is useful if you plan to move the site to a new Uniform Resource Locator (URL) or server, or if you want to remove it completely. The content of the site is not affected after you use this command, but the site is inaccessible to users.The iisweb /delete command uses the following syntax: iisweb /delete WebSite [WebSite...] [/s Computer [/u [Domain\]User/p Password]] The parameters used by Iisweb /delete are described as follows:
iisweb /delete "My Site"
To List Web SitesTo query or list Web sites, use the iisweb /query command. This command is useful when you want to check the status or check the properties of Web sites on a local or remote computer.The iisweb /query command uses the following syntax: iisweb /query WebSite [WebSite...] [/s Computer [/u [Domain\]User /p Password]] The parameters used by iisweb /query are described as follows:
iisweb /query To Create and Manage Web Virtual DirectoriesTo create and manage Web virtual directories by using the iisvdir.vbs script, use the following methods.To Create a New Web Virtual DirectoryTo create a new Web virtual directory, use the iisvdir /create command. This command does not create content, but it sets up the virtual directory structure and IIS configuration files. When you use Iisvdir.vbs to create a new Web virtual directory, you specify only the basic properties that are required to create the site and identify its contents. To configure more advanced properties, use IIS Manager.The iisvdir /create command uses the following syntax: iisvdir /create WebSite [/Virtual Path]Name Physical Path [/s Computer [/u [Domain\] User /p Password]] The parameters used by iisvdir /create are described as follows:
iisvdir /create Marketing Projects c:\corp\projects\web
To Delete a Web Virtual DirectoryTo delete a Web virtual directory, use the iisvdir /delete command.The iisvdir /delete command uses the following syntax: iisvdir /delete WebSite [/Virtual Path]Name [/s Computer [/u [Domain\]User /p Password]] The parameters used by iisvdir /delete are described as follows:
iisvdir /delete Marketing/Projects
MORE INFORMATIONFor more information about how to administer IIS from a
command prompt, see the Programmatic Administration Guide of the IIS 6.0 Online
Documentation. To view the IIS 6.0 Online Documentation, visit the following
Microsoft Web site: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/f89838b2-e8ef-41ea-99b6-6c829ffbcacd.mspx?mfr=true
(http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/f89838b2-e8ef-41ea-99b6-6c829ffbcacd.mspx?mfr=true)
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
