Product guide
IP address"
print "Provide help as the first parameter to get more information"
else:
if input == "help" or input == "-h" or input == "--h" :
print "This script attempts to do a OOB Power On for a remote AMT system using
scriptable support in the ePO"
print "It requires only one parameter. Pass the IP address of the remote AMT system
to do a Power On"
print "You can optionally pass a comma-separated list of IP addresses of the remote
AMT systems(s) to do a Power On"
print "Example: c:\python26\python.exe oobpoweron.py amt01"
print "NOTE: Run the command \"set PYTHONIOENCODING=utf-8\" on the command prompt
before running the oobpoweron.py script to be able to see the errors"
else:
try:
result = mc.amt.powerOn(input)
except mcafee.CommandInvokerError,e:
try:
print "Error in doing OOB Power on as the command failed to invoke properly
due to the following error"
print "================"
print e.__str__()
print "================"
except:
print "NOTE: Run the command \"set PYTHONIOENCODING=utf-8\" on the command
prompt
before running the oobpoweron.py script to be able to see the errors"
except AttributeError,e:
print "Error in using amt.powerOn attribute"
Sample script for Intel AMT policy enforcement
Here is a sample script to enforce Intel
®
AMT policy through the McAfee ePO Python Scripting support.
# Script to do an OOB Power On through the ePO Python Scripting support.
# The parameters to be passed to the script is an IP address or a list of comma-separated
IP address.
import mcafee
import sys
# mcafee.client() function in this command is using these parameters
# 1st parameter is the host name of the McAfee ePO system.
# 2nd parameter is the Port on which the McAfee ePO interface is accessible.
# 3rd parameter is the User name that will be used to login to the McAfee ePO interface.
# 4th parameter is the Password of the User name provided in the 3rd parameter.
# 5th parameter is always https and 6th parameter is always json.
mc = mcafee.client('m0','8443','admin','epo', 'https','json')
try:
input = sys.argv[1] #input to the script, our AMT system IP address.
except:
print "Missing 1st parameter. Provide a single IP address of a comma-separated list of
IP address"
print "Provide help as the first parameter to get more information"
else:
if input == "help" or input == "-h" or input == "--h" :
print "This script will attempt to do a OOB Policy Enforcement for a remote AMT
system
using scriptable support in the ePO"
print "It requires only one parameter. Pass the IP address of the remote AMT system
to do a Power On"
print "You can optionally pass a comma-separated list of IP addresses of the remote
AMT
systems(s) to do a Policy Enforcement"
print "Example: c:\python26\python.exe oobenforcepolicy.py amt01"
print "NOTE: Run the command \"set PYTHONIOENCODING=utf-8\" on the command prompt
before
running the oobenforcepolicy.py script to be able to see the errors"
else:
try:
result = mc.amt.enforcePolicy(input)
except mcafee.CommandInvokerError,e:
Additional information
Python scripts for ePO Deep Command
A
McAfee ePO Deep Command 2.1.0 Product Guide
163