Welcome to Sign in | Join | Help
in
Home Blog Forums

The Lazy Admin

IIS Command Line Administration

Sponsor


I'll be the first to admit I love using the GUI to admin my network, however there are times when command line tools will speed up the task at hand. Managing IIS 6.0 from the command line can cut down on the time you take to create or delete, start or stop web sites running on your IIS server(s).

IIS.vbs is installed to %systemroot%\System32 when you install IIS and it can do most of the things that you can do with IIS Manager and here are some common examples.

Create a new website

iisweb /create Path SiteName [/b Port Number ] [/i IPAddress ] [/d HostHeader ] [/dontstart] [/s Computer [/u [Domain \]User /p Password ]]

The first two variables Path and SiteName are required, Path specifies the local directory where the data will be found, and SiteName specifies the name of the website. The /b and /i switch will define the port and IP address respectively. If you leave these out the default will be port 80 and All Unassigned IP addresses. The /d switch would specify a Host Header if you require one and /dontstart will prevent the website from starting once the website is created. You can run the script on a remote computer with the /s switch but you will need to use the /u and /p switches to specify a username and password. i.e. iisweb /create D:\IIS "Test Site" /b 8080 /i 192.168.1.100 /dontstart

Delete a website

iisweb /delete WebSite [/s Computer [/u [Domain \]User /p Password ]]

Deleting a website is even easier, but be careful. When you delete a website with this tool, it only deletes the website in IIS, it does not delete the data. The variable WebSite is required (obviously) and again, this can be run against remote computers in the same manner as adding websites. i.e. iisweb /delete "Test Site"

List websites

iisweb /query [/s Computer [/u [Domain \]User /p Password ]]

This simple command will list all the websites running on the server. Once again we can run this against a remote server. i.e. iisweb /query /s IIS_Server /u dortoh\administrator /p password You can also start, stop, and pause websites and create/delete virtual directories as well.

 





Published Wednesday, June 01, 2005 7:26 AM by rodney.buike
Filed under:

Comments

No Comments
Anonymous comments are disabled

This Blog

Powered By

 

Syndication

Sponsors

 
 
Get a free 5GB e-mail account @isalazyadmin.com

Certifications & Awards




All postings are provided "AS IS" with no warranties, and confer no rights.
Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.