In this article:
Overview - Basic overview of Action system
Action Types - Introduction to the Action factories
Creating an Action - How to create a new Action
Creating an Action Chain Action - How to author a new Action Chain Action
Creating a Batch File Action - How to author a new Batch File Action
Creating a Command Line Action - How to author a new Command Line Action
Creating a Patch Action - How to author a new Patch Action
Creating a PowerShell Action - How to author a new PowerShell Action
Creating a VBScript Action - How to author a new VBScript Action
Creating a Windows File System Action - How to author a new Windows File System Action
Creating a Windows Process Action - How to author a new Windows Process Action
Creating a Windows Registry Action - How to author a new Windows Registry Action
Creating a Windows Service Action - How to author a new Windows Service Action
Creating a WMI Action - How to author a new WMI Action
Creating a Workflow Action - How to author a new Workflow Action
Saving and Deploying an Action - How to save a new Action
Further Information - Where to go for further information
Overview
Adaptiva Actions are objects that perform some task or activity on a device.
They are primarily used by the Adaptiva workflow system in conjunction with REST API calls, invoked by the ExecuteActionOnClient workflow activity.
Actions can take many forms and perform differently, depending on the type of action that has been authored.
Actions can be accessed from the left-hand menu in the web UI, under the Endpoint Inventory product, or from the Endpoint VM product.
Action Types
- Action Chain - This action type allows you to chain different actions together to execute a sequence of actions from within the same invocation/policy.
- Batch File - These actions will execute a batched set of command line instructions similar to a Windows batch (.bat) file.
- Command Line - These actions will execute a single-line Windows command-line.
- Java - These actions are intended to invoke Java code of the Adaptiva Client itself. These are generally for internal actions only and wouldn't be authored without instruction from the Adaptiva support and solutions team.
- Patch - These actions can be used to perform an installation of a piece of content.
- PowerShell - These actions will execute a PowerShell script on the endpoint.
- VBScript - These actions will execute a Visual Basic Script (vbs) on the endpoint.
- Windows File System - These actions will perform one of many listed file system operations.
- Windows Process - These actions will perform one of many listed Windows process operations.
- Windows Registry - These actions will perform one of many listed Windows registry operations.
- Windows Service - These actions will perform one of many listed Windows service operations.
- WMI - These actions will perform one of many listed Windows Management Instrumentation operations.
- Workflow - These actions will execute the specified Adaptiva workflow.
Creating an Action
To author a new Action from the Actions browser, select +New in the top-right corner
To author a new sensor from within the Action editor, select +New in the top-right corner
This will open a new editor window where you can select a type of action to author.
Give the Action a Name, optionally add a Description, select the Action Type from the drop-down list.
Creating an Action Chain Action
The Action Chain Action allows you to chain different actions together into a single invokable action.
First, create a new Action by following the Creating an Action section. Select Action Chain as the Action type.
Next, in the Action Settings section, click the +Add Actions button. This will bring out an Action Browser where you can select one or more actions to chain together. Select the actions you wish to execute.
Note: The same action type can be added multiple times if you wish to perform the same action with different inputs.
Note: Actions can be reordered by dragging the six dots ( ) next to the action name either up or down
In the example below, we are terminating a process and then deleting a file:
Adding Action Parameters
Most actions require one or more parameters. These are specified in the Action Parameters section.
To set the parameter value, in the Actions column click the ellipse (...) button next for the parameter you wish to modify.
This will bring out the Edit Parameter window which will allow you to set a Default value for the parameter.
In the example above, the two actions we have selected each have a single input parameter. TerminateProcessByName expects a parameter called Name and DeleteFile expects a parameter called Path.
We will set the TerminateProcessByName.Name default value to MyBadFile.exe and the DeleteFile.Path default value to C:\Windows\MyBadFile.exe
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Batch File Action
This action is similar to a Windows batch file (.bat) and will execute a batched set of Windows command line commands.
First, create a new Action by following the Creating an Action section. Select Batch File Action as the Action type.
In the Action Settings section, enter the Batch Command(s) that you wish to execute.
For this example we will enter the following batch command that will create a TMP file in the system TEMP directory with a random file name:
:Again
SET TempFile=%Time: =0%
SET TempFile=%TempFile::=%
SET TempFile=%TempFile:.=%
SET TempFile=%TempFile:,=%
FOR /L %%A IN (0,1,9) DO SET TempFile=%TempFile%%Random%
SET TempFile=%TempFile%.tmp
IF EXIST "%Temp%.\%TempFile%" (
GOTO Again
) ELSE (
TYPE NUL > "%Temp%.\%TempFile%" || SET TempFile=
)
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Command Line Action
This action will execute a specified Windows command line on the endpoint.
First, create a new Action by following the Creating an Action section. Select Command Line Action as the Action type.
In the Action Settings section, enter the Command that you wish to execute.
For this example we will enter the following command that will output Hello World to a file C:\Windows\Temp\ActionOutput.txt
cmd /c echo Hello World >> C:\Windows\Temp\ActionOutput.txt
Adding Action Parameters
Parameters can be added which will get appended onto the end of the command line specified above.
The format for the parameter will be /<parameterName>:<parameterValue>
For example, if a string parameter is added with a name of 'Foo' and a value of 'Bar', the command-line would append /Foo:Bar
To add a parameter, in the Actions Parameters section click Add Parameters.
This will bring out the Edit Parameter window which will allow you add a new parameters and set a Default value.
Enter a name, optionally a description, select the data type for the parameter and choose whether or not it is required.
Optionally, set a default value and then click OK
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Patch Action
Patch actions are intended to be used primarily by the Endpoint VM product as a remediation for a vulnerability. They can however, be used to install any content.
First, create a new Action by following the Creating an Action section. Select Patch Action as the Action type.
In the Action Settings section, specify the following:
- Content: Click the Browse button to browse for the piece of content to install. If the content has not yet been created, please create the content using the Content section of Endpoint VM or the Adaptiva Content section of OneSite.
- Kill Process List: (Optional) Enter the names of processes that should be terminated prior to installing the software. Separate multiple processes using semi-colon (;)
- Commands: Enter the command(s) that should be executed to perform the installation. Separate multiple command using semi-colon (;). Use $(UnpackingFolder) to refer to the patch that the content gets unpacked to during download.
- Working Directory: (Optional) Enter the working directory to start the command from.
- Load User Profile: Select whether the install should load the user profile.
- Allowed Execution Time: (Optional) Enter the maximum execution time for the installation after which the install will be aborted and status returned.
- Success Exit Codes: (Optional) Enter the exit codes returned that denote success. Separate multiple exit codes with comma (,)
- Failure Exit Codes: (Optional) Enter the exit codes returned that denote failure. Separate multiple exit codes with comma (,)
- Reboot Exit Codes: (Optional) Enter the exit codes returned that denote a reboot is required. Separate multiple exit codes with comma (,)
- Reboot If Required: Select whether a reboot should be performed if the installation exits with an exit code that matches one of the specified Reboot Exit Codes.
In the example below, we are installing a piece of software called Junction21:
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a PowerShell Action
PowerShell actions will execute the specified PowerShell script on the endpoint.
First, create a new Action by following the Creating an Action section. Select PowerShell Action as the Action type.
In the Action Settings section, specify the PowerShell Script to execute and any parameters that should be passed into the script. Parameters should be specified in the standard format. Example:
Param (
$MyParam
)
In this very simple example PowerShell script, we are going to output the value of the $MyParam parameter to a text file C:\Windows\TEMP\PowerShellAction.txt:
Out-File -FilePath C:\Windows\Temp\PowerShellAction.txt -InputObject $MyParam -Encoding ASCII
Adding Action Parameters
If we have specified any parameters in the Action Settings section, we must assign matching parameters to the Action itself in the Action Parameters section.
Click the +Add Parameters button to bring out the Parameter editor. Give the parameter the Name of the parameter specified in the Action Settings section, an optional description, an appropriate data type that matches the datatype expected in the script, specify whether the parameter is required (mandatory) and a default value.
Important: The Parameter name and data type must match exactly with the parameter name and data type specified in the script.
In this example, we are giving a default value of Hello World so when the PowerShell script runs it will output "Hello World" to the C:\Windows\Temp\PowerShellAction.txt file.
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a VBScript Action
VBScript actions will execute the specified Visual Basic script on the endpoint.
First, create a new Action by following the Creating an Action section. Select VBScript Action as the Action type.
In the Action Settings section, specify the Visual Basic Script to execute on the endpoint.
For this example, we will use a simple VB Script example to replace the text "Foo" with "Bar" in text file C:\Windows\Temp\MyFile.txt:
sFile = "C:\Windows\Temp\MyFile.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(sFile, 1)
sText = objFile.ReadAll
objFile.Close
strNewText = Replace(sText, "Foo", "Bar")
Set objFile = objFSO.OpenTextFile(sFile, 2)
objFile.WriteLine strNewText
objFile.Close
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Windows File System Action
First, create a new Action by following the Creating an Action section. Select Windows File System Action as the Action type.
Windows File System actions support a number of different operations. An action can be created to perform any of the following functions:
- Create a File
- Takes one parameter: CaseSensitivePath - the full path of the file to create
- Delete a File
- Takes one parameter: CaseSensitivePath - the full path of the file to delete
- Copy Files
- Takes three parameters:
- Path - The full source path of the file to copy
- CaseSensitiveDestinationPath - The full destination path to copy to
- Overwrite - Whether to overwrite the file if it already exists
- Takes three parameters:
- Move Files
- Takes two parameters:
- SourcePath - The full source path of the file to move
- CaseSensitiveDestinationPath - The full destination path to move to
- Takes two parameters:
- Rename a File
- Takes two parameters:
- SourcePath - The full source path of the file to rename
- CaseSensitiveNewFileName - The new file name to rename to
- Takes two parameters:
- Compress a File
- Takes two parameters:
- Path - The path to the file to compress
- CaseSensitiveZipPath - The full path to the zip file to create
- Takes two parameters:
- Set NTFS Permission on File
- Takes five parameters:
- Path - The path to the file to set NTFS permissions on
- AccountNames - Comma-separated list of account names to set
- AccountNamePermissions - Permissions to set (one of: read/write/all)
- AccountSids - Comma-separated list of account SIDs to set
- AccountSidPermissions - Permissions to set (one of: read/write/all)
- Takes five parameters:
- Delete NTFS Permission on File
- Takes one parameter: Path - the full path to the file to remove NTFS permissions
- Create a Folder
- Takes one parameter: CaseSensitivePath - the full path to the folder to create
- Delete a Folder
- Takes one parameter: Path - the full path to the folder to delete
- Copy Folders
- Takes two parameters:
- SourcePath - The full path to the folder to copy
- CaseSensitiveDestinationPath - The full path to the destination to copy to
- Takes two parameters:
- Move Folders
- Takes two parameters:
- SourcePath - The full path to the folder to move
- CaseSensitiveDestinationPath - The full path to the destination to move to
- Takes two parameters:
- Rename a Folder
- Takes two parameters:
- SourcePath - The full path to the folder to rename
- CaseSensitiveDestinationPath - The full path including the new file name of the file
- Takes two parameters:
- Compress Folder
- Takes two parameters:
- SourcePath - The full path to the folder to compress
- CaseSensitiveZipPath - The full path to the zip file to create
- Takes two parameters:
- Set NTFS Permission on Folder
- Takes five parameters:
- Path - The path to the folder to set NTFS permissions on
- AccountNames - Comma-separated list of account names to set
- AccountNamePermissions - Permissions to set (one of: read/write/all)
- AccountSids - Comma-separated list of account SIDs to set
- AccountSidPermissions - Permissions to set (one of: read/write/all)
- Takes five parameters:
- Delete NTFS Permission on Folder
- Takes one parameter: Path - the full path to the folder to remove NTFS permissions
- Share Folder
- Takes four parameters:
- CaseSensitiveShareName - The name to assign to the share
- CaseSensitivePath - The full path of the folder to share
- CaseSensitiveRemark - The comment to assign to the share
- MaxAllowedConnections - The maximum number of connections allowed to the share
- Takes four parameters:
- Delete Share Folder
- Takes one parameter: ShareName - the name of the share to be removed
- Set Share Permission on Folder
- Takes five parameters:
- ShareName - The name of the share to set permissions on
- AccountNames - Comma-separated list of account names to set
- AccountNamePermissions - Permissions to set (one of: read/write/all)
- AccountSids - Comma-separated list of account SIDs to set
- AccountSidPermissions - Permissions to set (one of: read/write/all)
- Takes five parameters:
Select the operation you wish to perform and then assign the default value to that operation's parameters.
Adding Action Parameters
To set the parameter value, in the Actions column click the ellipse (...) button next for the parameter you wish to modify.
This will bring out the Edit Parameter window which will allow you to set a Default value for the parameter.
As an example, the Create a File operation requires an action parameter called CaseSensitivePath for the full path of the file to create. Here we will give it the value C:\Windows\Temp\MyFile.txt
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Windows Process Action
First, create a new Action by following the Creating an Action section. Select Windows Process Action as the Action type.
Windows Process actions support a number of different operations. An action can be created to perform any of the following functions:
- Terminate Process by ID
- Takes one parameter: ProcessID - the numeric ID of the process to terminate
- Terminate Process Tree by ID
- Takes one parameter: ProcessID - the numeric ID of the process whose tree should be terminated
- Terminate Process by Name
- Takes one parameters: Name - the name of the process to terminate (e.g. notepad.exe)
- Terminate Process Tree by Name
- Takes one parameters: Name - the name of the process whose tree should be terminated (e.g. notepad.exe)
- Start Process as System
- Takes two parameters:
- CaseSensitiveCommandLine - The command line to execute to start the process
- CurrentFolder - The folder to start the command from
- Takes two parameters:
- Start Process as Logged In User
- Takes two parameters:
- CaseSensitiveCommandLine - The command line to execute to start the process
- LaunchInUserSession - If set to true will launch the process in the currently logged in user's session
- Takes two parameters:
- Start Process as Specific User
- Takes five parameters:
- CaseSensitiveCommandLine - The command line to execute to start the process
- Domain - The Domain of the user to launch the process as
- Username - The username of the user to launch the process as
- CaseSensitivePassword - The password of the user to launch the process as
- LoadUserProfile - If set to true will load the user profile whilst launching the process
- Takes five parameters:
- Set Process Priority
- Takes two parameters:
- Name - the name of the process to set priority of (e.g. notepad.exe)
- Priority - the numeric priority level to assign to the process
- Takes two parameters:
- Create Dump File
- Takes three parameters:
- Name - the name of the process to create the dump file for (e.g. notepad.exe)
- CaseSensitivePath - the full path to the dump file to create
- FullDump - If true will create a full dump. If false will create a partial dump
- Takes three parameters:
- Set Process Priority by ID
- Takes two parameters:
- ProcessID - The ID of the process to set priority of
- Priority - The numeric priority level to assign to the process
- Takes two parameters:
- Create Dump File by ID
- Takes three parameters:
- ProcessID - the ID of the process to create the dump file for
- CaseSensitivePath - the full path to the dump file to create
- FullDump - If true will create a full dump. If false will create a partial dump
- Takes three parameters:
Select the operation you wish to perform and then assign the default value to that operation's parameters.
Adding Action Parameters
To set the parameter value, in the Actions column click the ellipse (...) button next for the parameter you wish to modify.
This will bring out the Edit Parameter window which will allow you to set a Default value for the parameter.
As an example, the Terminate Process by Name operation requires an action parameter called Name for the name of the process to terminate. Here we will give it the value Notepad.exe
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Windows Registry Action
First, create a new Action by following the Creating an Action section. Select Windows Registry Action as the Action type.
Windows Registry actions support a number of different operations. An action can be created to perform any of the following functions:
- Create Key
- Takes four parameters:
- Hive - The numeric value of the hive for the key to create (see hive possible values reference below)
- CaseSensitiveSubKeyPath - The full path to the subkey to create
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- CaseSensitiveDefaultValueData - (Optional) The data to assign to the default value of the key
- Takes four parameters:
- Delete Key
- Takes five parameters:
- Hive - The numeric value of the hive for the key to delete (see hive possible values reference below)
- SubKeyPath - The full path to the subkey to delete
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- DeleteIfEmpty - If set to true, the key is deleted only if it is empty: i.e. it does not contain any child keys or child values
- DeleteRecursively - If set to true all child key and values are deleted. If false then the key and its direct values are deleted only if it does not contain any child key
- Takes five parameters:
- Rename Key
- Takes four parameters:
- Hive - The numeric value of the hive for the key to rename (see hive possible values reference below)
- CurrentPath - The full path to the subkey to rename
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- CaseSensitiveNewName - The new name to give to the key
- Takes four parameters:
- Set Default Value
- Takes four parameters:
- Hive - The numeric value of the hive for the value (see hive possible values reference below)
- SubKeyPath - The full path to the subkey to set the default value for
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- CaseSensitiveDefaultValueData - The data to assign to the default value of the key
- Takes four parameters:
- Set Named Value
- Takes six parameters:
- Hive - The numeric value of the hive for the value (see hive possible values reference below)
- SubKeyPath - The full path to the subkey containing the value to set
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- ValueType - The numeric value of the value type for the value to set. (see Registry Type possible values reference below)
- CaseSensitiveName - The name for the value to set
- ValueData - The data to assign to the value
- Takes six parameters:
- Rename Value
- Takes five parameters:
- Hive - The numeric value of the hive to rename from (see hive possible values reference below)
- SubKeyPath - The full path to the subkey containing the value to rename
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- Name - The name of the value to rename
- CaseSensitiveNewValueName - The new name to assign to the value
- Takes five parameters:
- Delete Value
- Takes four parameters:
- Hive - The numeric value of the hive to delete from (see hive possible values reference below)
- SubKeyPath - The full path to the subkey containing the value to delete
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below)
- Name - The name of the value to delete
- Takes four parameters:
- Move Key
- Takes six parameters:
- OldHive - The numeric value of the old hive to move from (see hive possible values reference below)
- OldSubKeyPath - The full path to the subkey to move
- SourceWow32_64 - The numeric value of the architecture redirection for the source key (see Wow32_64 possible values reference below)
- NewHive - The numeric value of the hive to move to (see hive possible values reference below)
- CaseSensitiveNewSubKeyPath - The full path to the new subkey to move to
- TargetWow32_64 - The numeric value of the architecture redirection for the target key (see Wow32_64 possible values reference below)
- Takes six parameters:
- Move Value
- Takes eight parameters:
- OldHive - The numeric value of the old hive to move from (see hive possible values reference below)
- OldSubKeyPath - The full path to the subkey containing the value to move
- SourceWow32_64 - The numeric value of the architecture redirection for the source key (see Wow32_64 possible values reference below)
- Name - The name of the value to move
- NewHive - The numeric value of the hive to move to (see hive possible values reference below)
- NewSubKeyPath - The full path to the subkey that should hold the new value
- TargetWow32_64 - The numeric value of the architecture redirection for the target key (see Wow32_64 possible values reference below)
- CaseSensitiveNewValueName - The new name to assign to the moved value
- Takes eight parameters:
- Copy Key
- Takes seven parameters:
- OldHive - The numeric value of the old hive to copy from (see hive possible values reference below)
- OldSubKeyPath - The full path to the subkey to copy
- SourceWow32_64 - The numeric value of the architecture redirection for the source key (see Wow32_64 possible values reference below)
- NewHive - The numeric value of the hive to copy to (see hive possible values reference below)
- CaseSensitiveNewSubKeyPath - The full path to the new subkey to copy to
- TargetWow32_64 - The numeric value of the architecture redirection for the target key (see Wow32_64 possible values reference below)
- Recursive - If true, operation has to be performed recursively
- Takes seven parameters:
- Copy Value
- Takes seven parameters:
- OldHive - The numeric value of the old hive to copy from (see hive possible values reference below)
- OldSubKeyPath - The full path to the subkey containing the value to copy
- SourceWow32_64 - The numeric value of the architecture redirection for the source key (see Wow32_64 possible values reference below)
- CaseSensitiveName - The name of the value to copy
- NewHive - The numeric value of the hive to copy to (see hive possible values reference below)
- NewSubKeyPath - The full path to the subkey that should contain the copied value
- TargetWow32_64 - The numeric value of the architecture redirection for the target key (see Wow32_64 possible values reference below)
- Takes seven parameters:
- Export
-
-
- Takes four parameters:
- Hive - The numeric value of the hive to export from (see hive possible values reference below)
- SubKeyPath - The full path to the subkey to export
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below
- CaseSensitivePath - The full path for the export file to create
- Takes four parameters:
-
-
- Import
- Takes four parameters:
- Hive - The numeric value of the hive to import into (see hive possible values reference below)
- SubKeyPath - The full path to the subkey to import into
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below
- Path - The full path for the previously exported data to import
- Takes four parameters:
- Permission
- Takes seven parameters:
- Hive - The numeric value of the hive for the key to set permissions on (see hive possible values reference below)
- SubKeyPath - The full path to the subkey to set permissions on
- Wow32_64 - The numeric value of the architecture redirection (see Wow32_64 possible values reference below
- AccountNames - Comma-separated list of account names to set
- AccountNamePermissions - Permissions to set (one of: read/write/all)
- AccountSids - Comma-separated list of account SIDs to set
- AccountSidPermissions - Permissions to set (one of: read/write/all)
- Takes seven parameters:
Reference: Hive Possible Values:
- 0 = HKEY_CLASSES_ROOT
- 1 = HKEY_CURRENT_USER
- 2 = HKEY_LOCAL_MACHINE
- 3 = HKEY_USERS
- 4 = HKEY_PERFORMANCE_DATA
- 5 = HKEY_PERFORMANCE_TEXT
- 6 = HKEY_PERFORMANCE_NLSTEXT
- 7 = HKEY_CURRENT_CONFIG
- 8 = HKEY_DYN_DATA
- 9 = HKEY_CURRENT_USER_LOCAL_SETTINGS
Reference: Value Type Possible Values:
- 0 = REG_SZ
- 1 = REG_EXPAND_SZ
- 2 = REG_BINARY
- 3 = REG_DWORD
- 4 = REG_MULTI_SZ
- 5 = REG_QWORD
Reference: Wow32_64 Possible Values:
- 0 = Automatic (determined by process architecture - normally 32 bit)
- 1 = Force 32 - will force the Wow6432Node redirection where available
- 2 = Force 64 - will force the 64-bit (non-Wow6432Node) where available
Select the operation you wish to perform and then assign the default value to that operation's parameters.
Adding Action Parameters
To set the parameter value, in the Actions column click the ellipse (...) button next for the parameter you wish to modify.
This will bring out the Edit Parameter window which will allow you to set a Default value for the parameter.
As an example, the Create Key operation requires four action parameters:
- Hive for the numeric value of the hive to create the key in. Here we will assign 2 (HKLM)
- CaseSensitiveSubKeyPath for the subkey to create. Here we will assign SOFTWARE\MySoftware
- Wow32_64 for the redirection setting. Here we will assign 2 (Force 64-bit)
- CaseSensitiveDefaultValueData for the default value data. Here we will leave blank (no default)
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Windows Service Action
First, create a new Action by following the Creating an Action section. Select Windows Service Action as the Action type.
Windows Service actions support a number of different operations. An action can be created to perform any of the following functions:
- Start Service
- Takes one parameter: Name - the name of the service to start
- Stop Service
- Takes two parameters:
- Name - the name of the service to stop
- StopDepedentServices - If true, will also stop any services that the named services depends on
- Takes two parameters:
- Set Service Information
- Takes ten parameters:
- CaseSensitiveName - The name of the service to set the service information for
- CaseSensitiveDisplayName - The display name for the service
- CaseSensitiveServiceDescription - The description for the service
- Path - The path to the executable that the service runs
- StartupType - The numeric value of the service start-up type (See Service Start-up Possible Values reference below)
- Dependencies - Comma-separated list of other services on which this service depends
- CaseSensitiveLogon - Set to "LocalSystem" in case the service runs as local system, else set to the domain\user name of the account under which the service runs
- CaseSensitivePassword - If a named account has been specified, enter the password for the account
- OwnProcess - Set to true if service should run in its own process, else false for shared process
- Interactive - Set to true if the service is allowed to interact with the desktop
- Takes ten parameters:
- Change Service Login
- Takes three parameters:
- Name - the name of the service to change login info for
- CaseSensitiveLogon - Set to "LocalSystem" in case the service runs as local system, else set to the domain\user name of the account under which the service runs
- CaseSensitivePassword - If a named account has been specified, enter the password for the account
- Takes three parameters:
- Create Service
- Takes ten parameters:
- CaseSensitiveName - The name of the service to create
- CaseSensitiveDisplayName - The display name for the service
- CaseSensitiveServiceDescription - The description for the service
- Path - The path to the executable that the service runs
- StartupType - The numeric value of the service start-up type (See Service Start-up Possible Values reference below)
- Dependencies - Comma-separated list of other services on which this service depends
- CaseSensitiveLogon - Set to "LocalSystem" in case the service runs as local system, else set to the domain\user name of the account under which the service runs
- CaseSensitivePassword - If a named account has been specified, enter the password for the account
- OwnProcess - Set to true if service should run in its own process, else false for shared process
- Interactive - Set to true if the service is allowed to interact with the desktop
- Takes ten parameters:
- Delete Service
- Takes one parameter: Name - the name of the service to delete
- Change Service Start Mode
- Takes two parameters:
- Name - the name of the service to modify the start mode for
- StartupType - The numeric value of the service start-up type (See Service Start-up Possible Values reference below)
- Takes two parameters:
Reference: Service Start-up Possible Values:
- 0 = HKEY_CLASSES_ROOT
- 1 = HKEY_CURRENT_USER
- 2 = HKEY_LOCAL_MACHINE
- 3 = HKEY_USERS
- 4 = HKEY_PERFORMAN
Select the operation you wish to perform and then assign the default value to that operation's parameters.
Adding Action Parameters
To set the parameter value, in the Actions column click the ellipse (...) button next for the parameter you wish to modify.
This will bring out the Edit Parameter window which will allow you to set a Default value for the parameter.
As an example, the Start Service operation requires an action parameter called Name for the name of the service to start. Here we will give it the value wuauserv (the Windows Update service)
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a WMI Action
First, create a new Action by following the Creating an Action section. Select WMI Action as the Action type.
WMI actions support a number of different operations. An action can be created to perform any of the following functions:
- Create Instance
- Takes two parameters:
- Namespace - the name of the namespace to create the instance in
- WMIClassName - the name of the WMI class to create the instance for
- Takes two parameters:
- Delete Instance
- Takes two parameters:
- Namespace - the name of the namespace to delete the instance from
- WMIInstancePath - the path of the WMI instance to delete
- Takes two parameters:
- Delete Instances
- Takes two parameters:
- Namespace - the name of the namespace to delete the instances from
- WMIQuery - the WMI query that returns the instances to delete
- Takes two parameters:
- Set Property Values for Instance Path
- Takes five parameters:
- Namespace - the name of the namespace to set the property values for
- WMIInstancePath - the path of the WMI instance to set the property values for
- PropertyNames - comma-separated list of property names to set the values for
- PropertyDataTypes - comma-separated list of data types for the respective properties
- PropertyValues - comma-separated list of values for the respective properties
- Takes five parameters:
- Set Property Values for Query
- Takes five parameters:
- Namespace - the name of the namespace to set the property values for
- WMIQuery - the WMI query that will return the instances to set the property values for
- PropertyNames - comma-separated list of property names to set the values for
- PropertyDataTypes - comma-separated list of data types for the respective properties
- PropertyValues - comma-separated list of values for the respective properties
- Takes five parameters:
- Set Property Values for Class
- Takes five parameters:
- Namespace - the name of the namespace to set the property values for
- WMIClassName - the WMI class name that contains the instances to set the property values for
- PropertyNames - comma-separated list of property names to set the values for
- PropertyDataTypes - comma-separated list of data types for the respective properties
- PropertyValues - comma-separated list of values for the respective properties
- Takes five parameters:
- Delete Class Instances
- Takes two parameters:
- Namespace - the name of the namespace to delete the class from
- WMIClassName - the WMI class name to delete the instances from
- Takes two parameters:
- Execute Instance Method
- Takes six parameters:
- Namespace - the name of the namespace to execute the instance method in
- WMIInstancePath - the path of the WMI instance containing the method to execute
- MethodName - the name of the method to execute
- PropertyNames - comma-separated list of property names
- PropertyDataTypes - comma-separated list of data types for the respective properties
- PropertyValues - comma-separated list of values for the respective properties
- Takes six parameters:
- Execute Instance Method on Instances
- Takes six parameters:
- Namespace - the name of the namespace to execute the instance method in
- WMIClassName - the WMI class name containing the method to execute
- MethodName - the name of the method to execute
- PropertyNames - comma-separated list of property names
- PropertyDataTypes - comma-separated list of data types for the respective properties
- PropertyValues - comma-separated list of values for the respective properties
- Takes six parameters:
- Execute Class Method
- Takes six parameters:
- Namespace - the name of the namespace to execute the class method in
- WMIClassName - the WMI class name containing the method to execute
- MethodName - the name of the method to execute
- PropertyNames - comma-separated list of property names
- PropertyDataTypes - comma-separated list of data types for the respective properties
- PropertyValues - comma-separated list of values for the respective properties
- Takes six parameters:
- Create Class
- Takes two parameters:
- Namespace - the name of the namespace to create the class in
- WMIClassName - the name of the class to create
- Takes two parameters:
- Edit Class
-
- Takes two parameters:
- Namespace - the name of the namespace to edit the class in
- WMIClassName - the name of the class to edit
- Takes two parameters:
-
- Delete Class
-
- Takes two parameters:
- Namespace - the name of the namespace to delete the class from
- WMIClassName - the name of the class to delete
- Takes two parameters:
-
- Create Namespace
- Takes one parameter: Namespace - the name of the namespace to create
- Edit Namespace
- Takes one parameter: Namespace - the name of the namespace to edit
- Delete Namespace
- Takes one parameter: Namespace - the name of the namespace to delete
Select the operation you wish to perform and then assign the default value to that operation's parameters.
Adding Action Parameters
To set the parameter value, in the Actions column click the ellipse (...) button next for the parameter you wish to modify.
This will bring out the Edit Parameter window which will allow you to set a Default value for the parameter.
As an example, the Create Class operation requires an action parameter called Namespace for the WMI namespace to create the class in, and WMIClassName for the name of the new WMI Class to create. Here we will give the values root\cimv2 and MyNewClass respectively
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Creating a Workflow Action
Workflow actions can be used to execute any Adaptiva client workflow on an endpoint. These workflows can be extended to perform almost any conceivable endpoint task.
First, create a new Action by following the Creating an Action section. Select Workflow Action as the Action type.
In the Action Settings section, select the workflow you wish to execute.
In this example, we are running a workflow called ActionExecutionWorkflow
The only thing left to do is save and deploy the Action. Please refer to the Saving and Deploying an Action section.
Saving and Deploying an Action
To save and deploy the action we can use the buttons at the top of the page. Save will save the metadata about the action, but not make it available for use. Save & Deploy will save and make it available for use within policies and workflows. Note: Deploy will NOT send to any clients.
Note: After clicking Save instead of Save & Deploy, the Save & Deploy button will be greyed out and in order to make the action available to assign to clients, the Deploy button next to Deployment Status must be used instead:
Further Information
For further information, please see the other resources in the Technical Reference Library or speak to a member of Adaptiva Support.
If you experience any issues or suspect there is a bug in any part of the action system, please log a support ticket and a member of the Adaptiva support team will be touch as soon as possible.
Comments
0 comments
Article is closed for comments.