1 / 28

CSI 277

CSI 277. AppCmd. AppCmd. The IIS command line administration tool. Sometimes using the GUI tool is just too much trouble!. APPCMD. General purpose IIS command line administration tool. APPCMD (command) (object-type) <identifier> < /parameter1:value1 ... > . AppCmd.

brilliant
Download Presentation

CSI 277

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSI 277 AppCmd

  2. AppCmd • The IIS command line administration tool Sometimes using the GUI tool is just too much trouble!

  3. APPCMD • General purpose IIS command line administration tool. • APPCMD (command) (object-type) <identifier> < /parameter1:value1 ... >

  4. AppCmd • Creates and configures sites, apps, application pools, and virtual directories • Starts and stops sites, etc.

  5. AppCmd • Also allows server administrators to build advanced management tasks simply by combining multiple AppCmdcommands, or reusing the output of the tool inside another program.

  6. AppCmd • AppCmd.exe is located in the %systemroot%\system32\inetsrv\ directory. Because this directory is not part of your PATH automatically, you need to use the full path to the executable when executing commands like "%systemroot%\system32\inetsrv\AppCmd.exe list sites". • Alternatively, you can manually add the inetsrv directory to the path on your machine so that you can access AppCmd.exe directly from any location.

  7. Adding to PATH • path = %PATH%;newdir

  8. APPCMD • APPCMD /? Getting help

  9. AppCmd • appcmd add site /? Getting more help

  10. Command Help • The command help screen describes the syntax for a specific command and object, including the parameters it supports and examples of common tasks. To display command help: • APPCMD <COMMAND> <OBJECT> /? • For example, this command-line will display help for the LIST command of the App object: • APPCMD list app /?

  11. AppCmd • LIST Display the objects on the machine. An optional <ID> can specify a unique object to list, or one or more parameters can be specified to match against object properties. • ADD Create a new object with the specified object properties to set during creation. • DELETEDelete the object specified by the <ID>. • SETSet parameters on the object specified by <ID>.

  12. Supported object types: • Site • App • Vdir • Apppool • Config • Wp • Request • Module • Backup • trace

  13. Supported Object Types ObjectDescription Site Administration of virtual sites App Administration of applications Vdir Administration of virtual directories Apppool Administration of application pools Config Administration of general configuration sections Backup Management of server configuration backups WP Administration of worker processes Request Display of active HTTP requests Module Administration of server modules Trace Management of server trace logs

  14. Object Help • The object help screen shows the commands supported by a specific object. • To display object help: • APPCMD <OBJECT> /? • where <OBJECT> is one of the supported object types. For example, this command-line will display help for the site object: • APPCMD site /?

  15. Finding Objects with the LIST Command • The LIST command is the most versatile command, and is supported by all objects. The purpose of this command is to find instances of the object based on the criteria you specify. The output of this command is a list of object instances, which you can inspect by viewing their properties, export for future re-creation on another machine, or use together with another command to perform actions on them.

  16. Listing all objects • The simplest way to use the LIST command is with no parameters, which simply lists all known instances of the object • appcmd list site object command

  17. AppCmd • The Site object provides methods (commands) to list, create and delete sites • Try this: • appcmdlist site

  18. AppCmd C:\Users\e6500>appcmd list site SITE "Default Web Site" (id:1,bindings:http/*:80:,state:Unknown) SITE "frogs" (id:2,bindings:http/*:80:,state:Unknown) SITE "yadda1" (id:123,bindings:http/*.80:www.yadda1.org,state:Unknown)

  19. AppCmd • In addition to LIST, most objects also support ADD, SET, and DELETE commands

  20. AppCmd • APPCMD add site /? The command help screen indicates which parameters are required. For example, use this command-line to see what parameters are required

  21. AppCmd • appcmd add site /name: string /id: uint /physicalPath: string /bindings: string appcmdadd site /name:yadda1 /id:123 /physicalPath:C:\inetpub\www\yadda1 /bindings:http/*.80:www.yadda1.org SITE object “yadda1” added APP object “yadda1/” added VDIR object “yadda1/” added

  22. Finding Objects • %systemroot%\system32\inetsrv\appcmdlist sites • The output will be similar to: SITE "Default Web Site" (id:1,bindings:HTTP/*:80:,state:Started) SITE "Site1" (id:2,bindings:http/*:81:,state:Started) SITE "Site2" (id:3,bindings:http/*:82:,state:Stopped) • By default, each object is shown on a single line, specifying its object-specific identifier (such as "Default Web Site") and one or more important properties (such as id, bindings, and state).

  23. APPCMD list <OBJECT> <ID> • The LIST command can be used to find an instance of a specificnamed object by using a command-line in the correct form • For example, use this command to find the site with a unique id of "Default Web Site": • %systemroot%\system32\inetsrv\appcmdlist site "Default Web Site"

  24. Listing Objects That Satisfy a Query • To find all object instances that match particular criteria, specify one or more parameters that indicate property values of the objects to match. For example, use this command-line to find all sites that are stopped: • %systemroot%\system32\inetsrv\appcmdlist sites /state:Stopped

  25. Listing sites based on criteria • APPCMD list sites /serverAutoStart:false

  26. AppCmd • APPCMD set site "Default Web Site" /id:200

  27. AppCmd • APPCMD set site "Default Web Site" /? Use a form of the command help syntax to see what properties can be set on a particular object. For example, to see the properties supported by the Default Web Site

  28. Deleting Objects • The DELETE command deletes an instance of an object. Like SET, this command also requires the object-specific identifier to be specified. For example, use this command-line to delete the site named "MyNewSite": • APPCMD delete site "MyNewSite"

More Related