White Paper

8 Scripting WSMAN Operating System Deployment Boot Network ISO
namespace, username, password, ipaddress and the SSL certificate. The certificate is defaulted to
dummy.
The constructed command can be directly launched on the command line or shell of the host OS,
using the API detailed in the Launch WSMAN CLI command section.
# Enumerate
def wsman_enumerate_command(classname, namespace, username, password, ipaddress,
cert = "dummy"):
"""
Constructs the WSMan Enumerate Operation command based on the OS and returns
the command to be used.
"""
if detect_host_os() == 1:
wsman_command = 'winrm e "http://schemas.dmtf.org/wbem/wscim/1/cim-
schema/2/%s?__cimnamespace=%s" -u:%s -p:%s -r:https://%s/wsman -encoding:utf-8 -
a:basic -SkipCNcheck -SkipCAcheck -format:pretty'
wsman_command = wsman_command % (classname, namespace, username, password,
ipaddress)
else:
wsman_command = 'wsman enumerate http://schemas.dmtf.org/wbem/wscim/1/cim-
schema/2/%s -N %s -u %s -p %s -h %s -P 443 -v -j utf-8 -y basic -o -m 256 -c %s -
V'
wsman_command = wsman_command % (classname, namespace, username, password,
ipaddress, cert)
return wsman_command
Enumerate Keys
This API detects the host operating system and constructs the relevant WSMAN enumerate keys CLI
command, using the input parameters provided. The input parameters for the API are classname,
namespace, username, password, ipaddress and the SSL certificate. The certificate is defaulted to
dummy.
The constructed command can be directly launched on the command line or shell of the host OS,
using the API detailed in the Launch WSMAN CLI command section.
# Enumerate End Point Reference (EPR)
def wsman_enumerate_epr_command(classname, namespace, username, password,
ipaddress, cert = "dummy"):
"""
Constructs the WSMan Enumerate EPR Operation command based on the OS and
returns
the command to be used.