openwsman command line client - Openwsman/openwsman GitHub Wiki
wsmancli is the command line client which uses the openwsman client interface and API to provide a utility for testing and accessing WS-Management information from the command line.
Most RPM-based Linux distributions ship the wsmancli package. You can also get the latest version at the open build service
wsman [Option...] <action> <Resource Uri>
| -?, --help | |
| --help-all | Show help options |
| --help-enumeration | Enumeration Options |
| --help-tests | Test Cases |
| --help-cim | CIM Options |
| --help-flags | Request Flags |
| --help-event | Subscription Options |
| -q, --version | Display application version |
| -d, --debug=1-6 | Set the verbosity of debugging output. |
| -j, --encoding | Set request message encoding |
| -c, --cacert=<filename> | Certificate file to verify the peer |
| -A, --cert=<filename> | Certificate file. The certificate must be in PEM format. |
| -K, --sslkey=<key> | SSL Key. |
| -u, --username=<username> | User name |
| -g, --path=<path> | Service Path (default: 'wsman') |
| -J, --input=<filename> | File with resource for Create and Put operations in XML, can be a SOAP envelope |
| -p, --password=<password> | User Password |
| -h, --hostname=<hostname> | Host name |
| -b, --endpoint=<url> | End point |
| -P, --port=<port> | Server Port |
| -X, --proxy=<proxy> | Proxy name |
| -Y, --proxyauth=<proxyauth> | Proxy user:pwd |
| -y, --auth=<basic|digest|gss> | Authentication Method |
| -a, --method=<custom method> | Method (Works only with 'invoke') |
| -k, --prop=<key=val> | Properties with key value pairs (For 'put', 'invoke' and 'create') |
| -C, --config-file=<file> | Alternate configuration file |
| -O, --out-file=<file> | Write output to file |
| -V, --noverifypeer | Not to verify peer certificate |
| -v, --noverifyhost | Not to verify hostname |
| -I, --transport-timeout=<time in sec> | Transport timeout in seconds |
Using wsman identify is the simplest way to ensure correct client-server communication.
Run it as
wsman identify -h <hostname> -P <port> -u <user> -p <pass>
wsman identify -h localhost -P 5985 -u wsman -p secret
Enumeration requires a resource path to address the correct CIM class
wsman enumerate -h localhost -P 5985 -u wsman -p secret http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_ComputerSystem
This call will return an XML representation of the matching resoure(s).
WSMAN - Windows / Linux Command Conversion
Dell has put together a document about Programmatic scripting with WSMAN