### wbemexec

#### Name

wbemexec - submit a CIM operation to the CIM Server for execution

#### Synopsis

`wbemexec [ -h hostname ] [ -p portnumber ] [ -v httpversion ] [ -m httpmethod ] [ -t timeout ] [ -u username ] [ -w password ] [ -d debugoption ] [ -s ] [ inputfilepath ]`

#### Description

The wbemexec command provides a command line interface to the CIM Server. The input to the command consists of a CIM request encoded in XML. The request is submitted to the CIM Server for execution. The result of the operation is returned to stdout, and consists of the CIM response encoded in XML.

By default, the operation is executed on the local host, using the default port (5988), and the request is sent as an HTTP/1.1 request, using the HTTP POST method. By default, wbemexec waits 20000 milliseconds (20 seconds) on sending a request, then times out if a response hasn't been received. The `-h` option allows the user to specify a different host. The `-p` option allows the user to specify a different port number. The `-v` option allows the user to specify a different HTTP version for the request. The `-m` option allows the user to specify a different HTTP method (i.e. M-POST) for the request. The `-t` option allows the user to specify, in milliseconds, a different timeout value for the request. The `-u` and `-w` options allow the user to specify a username and password to use for authentication of the user and authorization of the operation. By default, stdin is used as the input, if no input file is specified. The `-s` option enables the SSL protocol between wbemexec and the CIM server. The `-d` option may be used to specify that debug information be included in the output.

##### Options

`wbemexec` recognizes the following options:

`-h hostname`
  Use the specified host. A CIM Server must be running on the specified host. If this option is not specified, wbemexec will connect to the local host and authenticate itself.
`-p portnumber`
  Use the specified port number. The port number must be the port number on which the CIM Server is running on the specified host.
`-v httpversion`
  Use the specified HTTP version for the request. The version must be "1.0" or "1.1". The 1.0 version may not be specified if the M-POST method is specified.
`-m httpmethod`
  Use the specified HTTP method for the request. The method must be "POST" or "M-POST". The M-POST method may not be specified if the 1.0 version is specified.
`-t timeout`
  Wait the specified number of milliseconds on sending a request, before timing out if no response has been received. The timeout value must be an integer value greater than 0.
`-u username`
  Authorize the operation using the specified username. If username is not specified, the current logged in user will be used for authentication and authorization.
`-w password`
  Authorize the operation using the specified password. If the password is not specified and the remote host requests authentication, the user will be prompted for a password.
`-s`
  Enable the use of the SSL protocol between wbemexec and the CIM server.
`-d debugoption`
  Include specified debug information in the output.

  1 | Include HTTP-encapsulated XML request in output.
  2 | Include HTTP header of response in output.

##### Return Value

When an error occurs, an explanatory error message is written to stderr and an appropriate value is returned. The following return values are returned:

0 | Success
1 | Error

#### Examples

Submit an XML request contained in the file cimrequest.xml to the CIM Server running on the local host on the default port (5988), using the username guest and password guest for authentication and authorization:

`wbemexec -u guest -w guest cimrequest.xml`

Submit an XML request contained in the file cimrequest.xml to the CIM Server running on the host hpserver on port 49152, using the username guest and password guest for authentication and authorization:

`wbemexec -h hpserver -p 49152 -u guest -w guest cimrequest.xml`

Submit an XML request contained in the file cimrequest.xml to the CIM Server running on the local host on the default port (5988), including both the HTTP-encapsulated XML request, and the HTTP header portion of the response in the output:

`wbemexec -d 1 -d 2 cimrequest.xml`

#### Author

`wbemexec` was developed by the Hewlett-Packard Company.