Key commands

Prev Next

Some commands are more commonly used than others. To create scripts quickly, we recommend that you familiarize yourself with the syntax for these common commands.

These tables list commonly used commands with their syntax and description. Each table covers a different functional area.

Note

Specify arguments followed by =<> by name. For example, the argument fullName= must be included in this command, core.addUser("ga", "ga", fullName="Joe Tester")

Commands for searching, querying, and listing

Command

Syntax

Description

core.executeQuery

core.executeQuery queryId [database=<>]
core.executeQuery target=<> [select=<>] [where=<>] [order=<>] [group=<>]
   [database=<>] [depth=<>] [joinTables=<>]

Executes a query and returns the results as a list of objects.

core.help

core.help [command] [prefix=<>]

Lists all registered commands, and displays help strings.

core.listDatabases

core.listDatabases

Returns all databases the user is permitted to see as a list of objects.

core.listQueries

core.listQueries

Returns all queries the user is permitted to see as a list of objects.

core.listTables

core.listTables [table=<>]

Returns all database tables the user is permitted to see as a list of objects.

policy.find

policy.find searchText

Finds all policies that the user is permitted to see that match the given search text.

repository.find

repository.find searchText

Finds all repositories that the user is permitted to see that match the given search text.

system.find

system.find searchText

Finds systems in the System Tree.



Commands for creating, importing, and exporting

Command

Syntax

Description

core.addUser

core.addUser userName password [fullName=<>] [email=<>]
[phoneNumber=<>] [notes=<>] [disabled=<>]
[admin=<>] 
core.addUser userName=<>
windowsUserName=<> windowsDomain=<> [fullName=<>]
[email=<>] [phoneNumber=<>] [notes=<>]
[disabled=<>] [admin=<>] 
core.addUser userName=<>
subjectDN=<> [fullName=<>] [email=<>]
[phoneNumber=<>] [notes=<>] [disabled=<>]
[admin=<>]

Adds a user to the system. Authentication parameters are mutually exclusive: either password, windowsUserName/windowsDomain, or subjectDN can be specified.

core.importPermissionSets

core.importPermissionSets file [overwrite]

Imports permission sets from a file.

core.exportPermissionSets

core.exportPermissionSets

Exports all permission sets as an XML string.

system.importSystem

system.importSystem fileName branchNodeID [allowDuplicates]
[uninstallRemoved] [pushAgent][pushAgentForceInstall]
[pushAgentSkipIfInstalled]
[pushAgentSuppressUI][pushAgentInstallPath] [pushAgentPackagePath]
[pushAgentDomainName][pushAgentUserName] [pushAgentPassword]
[deleteIfRemoved][createNewInLostAndFound] [flattenTreeStructure

Imports systems from a text file or a supplied comma-separated list.

repository.checkInPackage

repository.checkInPackage packageLocation branch [option]
[moveToPrevious] [allowUnsignedPackages]

Checks package into the master repository.



Commands for editing, assigning, and moving

Command

Syntax

Description

core.updateUser

core.updateUser userName [password=<>]
[windowsUserName=<>] [windowsDomain=<>]
[subjectDN=<>] [newUserName=<>] [fullName=<>]
[email=<>] [phoneNumber=<>] [notes=<>]
[disabled=<>] [admin=<>]

Updates an existing user. Authentication parameters are mutually exclusive: either password, windowsUserName/windowsDomain, or subjectDN can be specified.

core.addPermSetsForUser

core.addPermSetsForUser userName permSetName

Adds the given permission set to the specified user.

system.applyTag

system.applyTag names tagName

Assigns the given tag to a supplied list of systems.

system.setUserProperties

system.setUserProperties name [description] [customField1]
[customField2] [customField3] [customField4]

Sets user properties on the given system.

system.deployAgent

system.deployAgent names username [password] 
[agentPackage] [skipIfInstalled] [suppressUI] 
[forceInstall] [installPath] [domain] 
[useAllHandlers] [primaryAgentHandler]
[retryIntervalSeconds] [attempts] [abortAfterMinutes]
[includeSubgroups] [useSsh] [inputSource]

Deploys an agent to the given list of systems.

policy.assignToSystem

policy.assignToSystem names productId typeId objectId
[resetInheritance]

Assigns the policy to a supplied list of systems.



Commands for running and aborting

Command

Syntax

Description

clienttask.run

clienttask.run names productId taskID 
[retryAttempts] [retryIntervalInSeconds] [abortAfterMinutes]
[useAllAgentHandlers] [stopAfterMinutes] [randomizationInterval]

Runs the client task on a supplied list of systems.

scheduler.cancelServerTask

scheduler.cancelServerTask taskLogId

Ends a currently running task.

scheduler.runServerTask

scheduler.runServerTask taskName

Runs the specified server task.

system.wakeupAgent

system.wakeupAgent names [fullProps] [superAgent] [randomMinutes]
[forceFullPolicyUpdate] [useAllHandlers] [retryIntervalSeconds]
[attempts] [abortAfterMinutes] [includeSubgroups]

Wakes up the agent on a supplied list of systems.

repository.pull

repository.pull sourceRepository targetBranch [moveToPrevious]
[productList]

Pulls packages from the source repository.



Commands for deleting and purging

Command

Syntax

Description

commonevent.purgeEvents

commonevent.purgeEvents queryId [unit]

Deletes threat events based on age or a queryId. The query must be table-based.

core.purgeAuditLog

core.purgeAuditLog [age] [unit]

Purges the audit log by age.

system.delete

system.delete names [uninstall]

Deletes systems from a

ePO

server by name or ID.

tasklog.purge

tasklog.purge [age] [unit]

Purges the task log by age. Defaults to purging all entries.