Learning Windows Server 2003
8.13. Command-Line Utilities
Many scripts are available for administering IIS from the command line, and they're detailed in this section. Most of these are located in the \inetpub\adminscripts directory; exceptions are noted within the individual command's discussion. 8.13.1. iisreset
You can control IIS using a command-line function called iisreset. Depending on the argument switches you use with the command, you can perform any number of tasks:
8.13.2. iisweb
iisweb can create new web sites from the command line. For instance: iisweb /create e:\webcontent "Main Website" /d www.win.com
creates a web site named Main Website that can be addressed at www.win.com from content stored in the directory e:\webcontent. By default, iisweb will start the new web site. To prevent this, add the /dontstart switch at the command line. 8.13.3. iisvdir
Using the utility iisvdir you can create virtual web directories from the command line. For instance: iisvdir /create "Default Website" support e:\webcontent\support
creates a virtual directory named support in the web site named Default Website, deriving its content from the directory e:\webcontent\support. If you specify a path that doesn't exist, IIS will create it. 8.13.4. iisapp
iisapp enables you to look at what process IDs (PIDs) are being used by which application pool. Simply type iisapp from the command line, and the result will display the worker PID and the application pool to which that process is assigned. This is a good way to monitor the health of worker processes and application pools. 8.13.5. iisftp
iisftp can create new FTP sites from the command line. For instance: iisftp /create e:\webcontent "Main Website" /i 64.246.42.130 creates a web site named Main Website at the IP address 64.246.42.130 from content stored in the directory e:\webcontent. iisftp contains a couple of other switches:
The utility iisftp, as discussed earlier in this chapter, also explicitly defines a user's home directory with his Active Directory profile. This is for use with user isolation mode in FTP. You can call it directly from the command line, and the syntax to set these properties is as follows: iisftp /SetADProp nameofuser FTPRoot pathtohomedirectory iisftp /SetADProp nameofuser FTPDir pathtohomedirectory 8.13.6. iisftpdr
Using the utility iisftpdr, you can create virtual FTP directories from the command line. For instance: iisftpdr /create "Default Website" support e:\webcontent\support creates a virtual directory named support in the web site named Default Website, deriving its content from the directory e:\webcontent\support.
8.13.7. winpop
You can use winpop, located in \Windows\system32\pop3server, to automatically add mailboxes and create user accounts within Windows, depending on the authentication method you've chosen for the POP3 service. For instance: winpop add lisa@divelover.net simply adds the mailbox to the POP3 service. This command assumes a preexisting user account unless your authentication method is Encrypted Password File. This command: winpop add lisa@divelover.net /createuser luv2dive
adds a mailbox and creates a corresponding user within Active Directory with the password "luv2dive." There isn't any need to use this version of the command with the Encrypted Password File method of authentication. |