--- title: "PowerShell Cmdlets for Trigger Actions" slug: "powershell-cmdlets-for-trigger-actions" updated: 2025-07-03T12:03:26Z published: 2025-07-03T12:03:26Z canonical: "support.controlup.com/powershell-cmdlets-for-trigger-actions" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.controlup.com/llms.txt > Use this file to discover all available pages before exploring further. # PowerShell Cmdlets for Trigger Actions From ControlUp version 9.0.5 and higher, you can run the following [PowerShell cmdlets](/v1/docs/powershell-cmdlets-for-triggers) to configure trigger [Script-based actions (SBAs)](/v1/docs/script-based-actions-sba) on a machine with a ControlUp Monitor installed: [](/v1/docs/script-based-actions-sba) - [Add-CUTriggerAction](/v1/docs/powershell-cmdlets-for-trigger-actions#addcutriggeraction). Adds a new trigger action to an existing trigger. - [Update-CUTriggerAction](/v1/docs/powershell-cmdlets-for-trigger-actions#updatecutriggeraction). Updates an existing trigger action. - [Remove-CUTriggerAction](/v1/docs/powershell-cmdlets-for-trigger-actions#removecutriggeraction). Removes an existing trigger action. - [Get-CUTriggerActions](/v1/docs/powershell-cmdlets-for-trigger-actions#getcutriggeractions). Get a list of trigger actions available for a specific trigger. - [Get-CUTriggerScripts](/v1/docs/powershell-cmdlets-for-trigger-actions#getcutriggerscripts). Get all Script-based actions available to add to a trigger. #### Add-CUTriggerAction Adds a new trigger action to an existing trigger. **Syntax** ```powershell Add-CUTriggerAction -TriggerID -Action ``` Add a "DumptoDisk" action to trigger example: ```powershell Add-CUTriggerAction -TriggerId c8e22b52-9af4-411a-8fd2-1d7b6e636f0c -Action @{TriggerActionType=3 DumpToDisk=@{LocationPath='C:\CONSOLE' Types='Machines','Sessions'}} ``` Add a webhook action to trigger example: ```powershell Add-CUTriggerAction -TriggerId c8e22b52-9af4-411a-8fd2-1d7b6e636f0c -Action @{TriggerActionType='WebHook' TemplateId='9585f09b-2889-4c37-b444-d5cd67bd02af' WebHook=@{ WebHookHttpMethod='Post' WebHookUri='https://webhook.site/5a6688a8-3c96-443e-82ce-b63c52bf5c4a'}} ``` Add an email action (to a specific organization member) to trigger example: ```powershell Add-CUTriggerAction -TriggerId c8e22b52-9af4-411a-8fd2-1d7b6e636f0c -Action @{TriggerActionType=0 TemplateId='C91C1F34-2225-4291-AAF3-23EA0D99E5FD' CloudEmail=@{Emailto='user.name@myorg.com'}} ``` Add an email action (to all organization members) to trigger example: ```powershell Add-CUTriggerAction -TriggerId c8e22b52-9af4-411a-8fd2-1d7b6e636f0c -Action @{TriggerActionType=0 TemplateId='C91C1F34-2225-4291-AAF3-23EA0D99E5FD' CloudEmail=@{Emailto=""}} ``` | Parameters | Description | Required | | --- | --- | --- | | -Action | Complex object containing the actions properties to add to this trigger | Yes | | -TriggerID | Trigger ID | Yes | #### Update-CUTriggerAction Updates an existing trigger action. **Syntax** ```powershell Update-CUTriggerAction -Action -triggerActionId -TriggerID ``` Update a "DumptoDisk" action example: ```powershell Update-CUTriggerAction -TriggerId c8e22b52-9af4-411a-8fd2-1d7b6e636f0c -TriggerActionId 7c0b10fa-cdb3-45d7-972d-1f93510513e5 -Action @{DumpToDisk=@{LocationPath='C:\Program Files\Smart-X\ControlUpAgent' Types='Machines'}} ``` Update a webhook action example: ```powershell Update-CUTriggerAction -TriggerId c8e22b52-9af4-411a-8fd2-1d7b6e636f0c -TriggerActionId 06f8eb09-6763-4e6c-b7ee-63be54c3ac21 -Action @{TemplateId='8fdf74c4-4f92-4a13-80ed-f4435047a1c5' WebHook=@{ WebHookHttpMethod='Get' WebHookUri='https://webhook.site/5'}} ``` Update an email action (to a specific organization member) example: ```powershell Update-CUTriggerAction -TriggerId c01232b8-1687-4557-867c-55c8cc6b7694 -TriggerActionId 18a2c500-8f89-430d-aa08-1a5ddbe161c3 -Action @{TemplateId='C91C1F34-2225-4291-AAF3-23EA0D99E5FD' CloudEmail=@{Emailto="user.name@myorg.com"} resendBehavior=@{interval="00:00:07" maxRepetitions=14}} ``` | Parameters | Description | Required | | --- | --- | --- | | -TriggerID | Trigger ID | Yes | | -TriggerActionId | Trigger action ID | Yes | | -Action | Action to update for this trigger | Yes | #### Add-CUTriggerAction & Update-CUTriggerAction Results Writes single result object to PowerShell with the following properties: - Error. In case of failure, the reason will be displayed. - Success. In case of success, the cmdlet returns with no output. #### Remove-CUTriggerAction Removes any type of action from any type of existing trigger. **Syntax** ```powershell Remove-CUTriggerAction [-TriggerId] [-TriggerActionId] ``` Remove action from trigger example: ```powershell Remove-CUTriggerAction -TriggerId a2d3582f-c629-4f4b-b0b4-07c29f320678 -TriggerActionId c30ce88d-da7a-4d63-a121-649a785038fd ``` | Parameters | Description | Required | | --- | --- | --- | | -TriggerActionId | Trigger action ID | Yes | | -TriggerID | Trigger ID | Yes | #### Remove-CUTriggerAction Results Writes single result object to PowerShell with the following properties: - Error. In case of failure, the reason will be displayed. - Success. In case of success, the trigger action is removed and the following message will be displayed: "Action '{ActionFriendlyName}' - {ActionId} was deleted successfully for trigger '{TriggerName}' - {TriggerId}." #### Get-CUTriggerActions Lists the available actions configured for a specific trigger. **Syntax** ```powershell Get-CUTriggerActions [-TriggerId] ``` List all actions for a trigger example: ```powershell Get-CUTriggerActions -TriggerId 7f88c98e-d213-422a-b801-9921e6724ac9 ``` | Parameters | Description | Required | | --- | --- | --- | | -TriggerID | Trigger ID | Yes | #### Get-CUTriggerActions Results - Error. In case of failure, the reason will be displayed. - Success. In case of success, writes multiple result objects to PowerShell with the following properties: ```powershell -templateId -friendlyName -resendBehavior -triggerActionId -triggerActionType -AddObjectNameToSubject -AddTriggerNameToSubject -CloudEmail -DumpToDisk -RecordEventLog -SmtpEmail -ScriptAction -WebHook ``` Results example: ![Powershell window displaying Get-CUTriggerActions cmdlet output results](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/Get-CUTriggerActions%20Results.png) #### Get-CUTriggerScripts Lists all scripts that are available to be added as SBAs to triggers. Doesn't list scripts that can't be added to triggers. Note that running **Get-CUTriggerScripts** without any parameters returns results listing all scripts added to your organization and selected as automated actions. **Syntax** ```powershell Get-CUTriggerScripts [[-Name] ] [[-RecordType] {None | RDPCnnection | Hosts | HFolder | Hypervisor | Folder | MachineExtention | HRFolder | Organization | Machine | ManagedHost | XDFolder | XDSite | Session | MachinesAndSession | XDRFolder | XDVDA | XDSession | Process | ProcessAndSession | XDBroker | AWSFolder | AWSConnection | Account | Datastore | DSHA | MachinesAndDSHA | VDisk | DSHAAndVDisk | DSDSHAAndVDisk | ProcessGroup | LogicalDisk | ProcessAndLogicalDisk | ProcessAndSessionAndLogicalDisk | ProcessAndLogicalDiskAndVDisk | ProcessAndSessionAndLogicalDiskAndVDisk | EventLogEntry | CitrixLicensing | ProcessAndSessionAndLogicalDiskAndCTXLic | ProcessAndSessionAndLogicalDiskAndCTXLicAndVDisk | FolderDrillDown | HyperFolderDrillDown | AWSComputer | BrowserURL | XDUser | XDApplicationInstance | XDPublishedApplications | XDSiteUser | NetScaler | LoadBalancer | LBServiceGroup | LBService | LBServiceGroupAndLBService | HDXSession | Gateway | STA | NIC | NetScalerDrillDown | NetScalerFolderDrillDown | RootFolderDrillDown | NetScalerFolder | LinuxDCFolder | LinuxDC | vSan | Association | CloudConnector | AzureConnection | AzureResourceGroup | FolderContainer | TreeContainer | AzureComputer | AzureDisk | AvdHostPool | AvdUserSession | AvdWorkspace | AvdApplicationGroup | AvdRemoteApp | FsLogixDisk | Service | Monitor | Site | NetworkDrives}] ``` List all scripts with record type example: ```powershell Get-CUTriggerScripts -RecordType Machine ``` List all scripts with name and record type example: ```powershell Get-CUTriggerScripts -Name SCCM -RecordType Machine ``` | Parameters | Description | Required | | --- | --- | --- | | -Name | Name of the trigger script | No | | -RecordType | Type of record associated with the trigger script. | No | #### Get-CUTriggerScripts Results - Error. In case of failure, the reason will be displayed. - Success. In case of success, returns list of all scripts you can configure to use for a specific trigger with the following properties: ```powershell -ID