Intranet/Hosting Toolkit | [table of contents]

`v1.3 November 30th 2001` | CFX_Services OPEN-SOURCE NT DLL for Cold Fusion 4.0.1 and up Lewis A. Sellers http://www.intrafoundation.com/ihtk.html ihtk@intrafoundation.com

FOREWORD This is an Allaire Cold Fusion Extension Tag (CFX). It is for use with Allaire Cold Fusion Servers 4.01 (and up) running on Microsoft NT. It was written by Lewis A. Sellers of Intrafoundation Software. The purpose of CFX_Services is to stop or start an NT service such as the IIS Web or FTP services. This is of use with CFX_IIS in resesting IIS after an update. Please read the version history for current tag status before emailing questions. | C O N T E N T S `Foreword` General Services `Version History`

`top`

## G E N E R A L

### ABOUT

#### <CFX_Services ACTION="ABOUT">

The tag itself returns a couple variables back no matter what you do (ServicesDescription, ServicesVersion and ServicesError). These are always available unless there is a catastrophic failure of the tag.

Additionally you can use the ABOUT function to return more detailed information on the tag. The fields returned are mostly only of interest for curiosity or in debugging a situation.

Note below that though the tag returns it's SerialNumber, it's not used currently, and hasn't been for a very long time, but probably will be again soon.

For the curious, it also proves the total number of lines of c/c++ that the current build was using. This includes the scant comments in the source code. For instance, this build of the tag has 614 lines of code.

Description
  The general product description.
Version
  The version number of the software, ie 2.0.
Quality

  The quality field will be one of the following four: "Alpha", "Beta", "Gamma" or "Omega". Quality relates the quality control status of the version of the tag you're currently using.

  Alpha code is highly unstable and shouldn't be trusted for anything. Do not use on production machines.

  Beta code is close to being finish and it is in a debugging phase. Do not use on production machines.

  Gamma code is for use on production machines. As far as the beta testers have determined it works as it should.

  When a product goes Omega that generally means it is long used Gamma code that is now no longer being maintained.

SubVersion
  The subversion number of the software, ie 4 for "2.0beta4".
SerialNumber
  Currently unused.
Lines
  The total lines of c/c++ code in the software.
BuildDate
  The ODBC DATETIME when the tag was last compiled (built).
Evaluation
  Boolean field (0 or 1). 1 indicates the version of the tag you're using is a time-limited evaluation version. 0 is full commercial.
ExpirationDate
  The ODBC DATETIME date when the tag will stop working.

`top`

## S E R V I C E S

Some of the important NT Services you'll probably be interested in are:

- IISADMIN
- W3SVC
- MSFTPSVC
- Cold Fusion Executive
- Cold Fusion Application Server
- Cold Fusion RDS

### SERVICES

#### <CFX_SERVICES ACTION="SERVICES">

FIELDS
Name | string
Description | string
Status | string
Startup | string
Dependencies | csv string
Account | string

REQUIRED
Action | SERVICES
Domain | string
Computer | string

Lists all the services on a computer and their current status.

When trying to start or stop a service use the NAME for the SERVICE parameter.

The Dependencies field is a csv (comma seperated list) of all other services this service depends on. Typically you have to stop all it's dependencies first before you can stop a service.

The status of a service is returned as a text value which may be any of the following values (sic):

- Stopped
- Start Pending
- Stop Pending
- Running
- Continue Pending
- Pause Pending
- Paused
- Error

Startup describes how the service normally starts up.

- Automatic
- Manual
- Disabled

The Account field is the name of the NT Account (see CFX_UserManager) that this service runs under.

Example: `<CFX_SERVICES ACTION="SERVICES" DOMAIN="FOUNDATION" COMPUTER="SUSY">`

### STOP

#### <CFX_SERVICES ACTION="STOP">

REQUIRED
Action | STOP
Domain | string
Computer | string
Service | string

Stops an NT service.

Example: `<CFX_SERVICES ACTION="STOP" DOMAIN="FOUNDATION" COMPUTER="SUSY" SERVICE="MSFTPSVC">`

### START

#### <CFX_SERVICES ACTION="START">

REQUIRED
Action | START
Domain | string
Computer | string
Service | string

Starts an NT service.

Example: `<CFX_SERVICES ACTION="START" DOMAIN="FOUNDATION" COMPUTER="SUSY" SERVICE="MSFTPSVC">`

### PAUSE

#### <CFX_SERVICES ACTION="PAUSE">

REQUIRED
Action | PAUSE
Domain | string
Computer | string
Service | string

Pauses an NT service.

Example: `<CFX_SERVICES ACTION="PAUSE" DOMAIN="FOUNDATION" COMPUTER="SUSY" SERVICE="MSFTPSVC">`

### CONTINUE

<CFX_SERVICES ACTION="CONTINUE">

REQUIRED
Action | CONTINUE
Domain | string
Computer | string
Service | string

Continue an NT service.

Example: `<CFX_SERVICES ACTION="CONTINUE" DOMAIN="FOUNDATION" COMPUTER="SUSY" SERVICE="MSFTPSVC">`

### RESTART

#### <CFX_SERVICES ACTION="RESTART">

REQUIRED
Action | RESTART
Domain | string
Computer | string
Service | string

Restarts an NT service (does a STOP then immediately does a START).

Example: `<CFX_SERVICES ACTION="RESTART" DOMAIN="FOUNDATION" COMPUTER="SUSY" SERVICE="MSFTPSVC">`

`top`

## VERSION HISTORY

- 1.2 January 3rd 2001.

  Added IHTKPASSWORD. Upgraded reporting code.

- 1.1 September 19th 2000.

  Upgraded error reporting code to v1.2.

- 1.0 July 26 2000.

  This tag started out as a few functions added to CFX_IIS last night. Thought about it today and it made more sense to place them in their own tag, so I did.

  The purpose of this tag is to support CFX_IIS.

  Windows 2000 or ADSI 2.5 or higher on NT4 is required for this tag to work.

`top`
`f i n i`
`-{ts '2001-12-03 03:35:33'} /ihtkdocs/Services/index.cfm-`