Get-CUAvailableActions: Retrieve all Actions in Your ControlUp Environment
    • Dark
      Light
    • PDF

    Get-CUAvailableActions: Retrieve all Actions in Your ControlUp Environment

    • Dark
      Light
    • PDF

    Article Summary

    The Get-CUAvailableActions cmdlet provides an overview of all available actions in your ControlUp Environment. This includes built-in actions as well as script actions. You can run this cmdlet without any parameter to retrieve a full list of available actions or you can filter actions, as shown in the examples below

    Prerequisites

    • ControlUp Version 8.8 or higher
    • (Remote) access to one of your ControlUp Monitors
    • Administrative privileges in a PowerShell session

    How To Run

    1. Import the ControlUp.PowerShell.User module into your PowerShell session
    $pathtomodule = (Get-ChildItem "C:\Program Files\Smart-X\ControlUpMonitor\*ControlUp.PowerShell.User.dll" -Recurse | Sort-Object LastWriteTime -Descending)[0]
    Import-Module $pathtomodule
    
    1. Run the cmdlet without any parameter to retrieve a full list of available actions
    Get-CUAvailableActions
    

    Each action has a set of properties which we explain in the Output section

    image.png

    Output

    PropertyDescriptionType
    IdInternal action ID (GUID)String
    TitleAction NameString
    DescriptionAction descriptionString
    CategoryCategory in the web UI under which the action is availableString
    IsSBAIndicates if this is a script action (true) or a built-in actionBoolean
    ViewsShows under which view the action is availableObject[] Views=System.Object[]
    TableThe monitor table in which the action can be executed. Relevant for the web UI.String
    HasActionHandlerInternalBoolean
    HasEventHandlerInternalBoolean
    HasSignatureShows "true" when input parameters or credentials for this action exist. False, if either credentials are not configured for this action, or no input parameters are availableBoolean
    HasUIComponentInternalBoolean
    SignatureRepresent an object that define with which parameters to call the actionSystem.Management.Automation.PSCustomObject
    AtomicEntityInternalInteger
    AllowedEntitiesShows all ententies the action can run on. Find more information here.Integer
    ExecutionContextShows the execution contextInteger

    Signature

    The signature entity holds relevant user input details such as placeholders, input parameters, and output parameters. Let's take the signature of the Save multiple screenshots to file action which allows to capture screenshots of a user session and to save on the local disk.
    image.png

    InParam

    The InParam property defines the structure for input parameters. The Save multiple screenshots to file actions has 4 input parameters.
    image.png

    Each input parameter has additional properties and methods, such as name, caption, or parameterType.
    image.png

    • Name. The position of the input parameter
    • Caption. The caption shown

    Views

    The Views property shows from which view the action can be selected.
    For example, the Analyze drive contens with WinDirStat action is available for entities in the Machines (= Computers), Sessions, and Logical Disks view
    image.png

    In the console, the views represent the tab view as illustrated here
    image.png

    AllowedEntities

    TypeValue
    None0
    RDPCnnection1
    Hosts2
    HFolder4
    Hypervisor8
    Folder16
    MachineExtention32
    HRFolder64
    Organization128
    Machine256
    ManagedHost512
    XDFolder1024
    XDSite2048
    Session4096
    XDRFolder8192
    XDVDA16384
    XDSession32768
    Process65536
    XDBroker131072
    AWSFolder262144
    AWSConnection524288
    Account1048576
    Datastore2097152
    DSHA4194304
    VDisk8388608
    ProcessGroup16777216
    LogicalDisk33554432
    EventLogEntry67108864
    CitrixLicensing134217728
    AWSComputer268435456
    BrowserURL536870912
    XDUser1073741824
    XDApplicationInstance2147483648
    XDPublishedApplications4294967296
    XDSiteUser8589934592
    NetScaler17179869184
    LoadBalancer34359738368
    LBServiceGroup68719476736
    LBService137438953472
    HDXSession274877906944
    Gateway549755813888
    STA1099511627776
    NIC2199023255552
    NetScalerFolder4398046511104

    ExecutionContext

    This value represents the Execution Context as shown in the script properties
    image.png

    Execution ContextValue
    Target Machine0
    ControlUp Console / Monitor1
    User Session2
    Other Machine3

    Examples

    Example 1 - Export all actions to a text file

    $actions = Get-CUAvailableActions 
    $actions | Out-File -FilePath .\actions.txt
    

    Example 2 - Show all actions that can run on a Session

    $actions = Get-CUAvailableActions 
    $actions | Where-Object {$_.AllowedEntities -eq '4096'}
    

    Example 3 - Show title, category and allowed entities of all actions

    $actions = Get-CUAvailableActions 
    $actions | Select-Object Title, Category, AllowedEntities | Sort-Object -Property AllowedEntities
    

    image.png

    Example 4 - Show on which entities the Flush DNS action is available

    $actions = Get-CUAvailableActions 
    $actions | Where-Object {$_.Title -eq 'Flush DNS'} | select-object -Property AllowedEntities
    

    In this example, 272 indicates that the Flus DNS is available in the Folders (16) and Machines (256) view. 16 + 256 = 272
    image.png

    Example 5 - Show all actions that run on a user session

    $actions = Get-CUAvailableActions 
    $actions | Where-Object {$_.ExecutionContext -eq '2'} | Select-Object Title, ExecutionContext 
    

    image.png

    Example 6 - Show all input parameters of a specific action

    $actions = Get-CUAvailableActions 
    $actionSignatures = $actions | Where-Object {$_.ExecutionContext -eq '2'} | Select-Object Signature
    $inParamScreenshotAction = $actionSignatures.Signature | Where-Object {$_.id -eq '15c99346-e3d1-4dde-a9a7-eb2cbed3bf55'} | select-object -property inParam
    $inParamScreenshotAction.inParam
    

    Was this article helpful?