PowerShell Cmdlets for Export Rules
    • Dark
      Light
    • PDF

    PowerShell Cmdlets for Export Rules

    • Dark
      Light
    • PDF

    Article Summary

    With export rules, the ControlUp Monitor can automatically create CSV files which contain metrics of different views, such as Machines, Folders, or Applications. Learn more about export rules here.

    This article provides an overview of PowerShell cmdlets that you can use to interact with export rules.

    Import Module

    All PowerShell cmdlets for export rules are implemented in the ControlUp.PowerShell.User module. Befoer you can start using them, open a PowerShell session with administrative privileges on one of your monitor machines and execute:

    $pathToUserModule = (Get-ChildItem "C:\Program Files\Smart-X\ControlUpMonitor\*ControlUp.PowerShell.User.dll" -Recurse | Sort-Object LastWriteTime -Descending)[0]
    
    Import-Module $pathToUserModule
    

    Required User Permission

    The user that runs the PowerShell cmdlets needs to be assigned the Manage Monitor permission in the Security Policy.

    Get-CUScheduledExportRules

    Lists all export rules.

    Syntax

    Get-CUScheduledExportRules [[-RuleId] <string>] [[-View] {Folders | Hosts | Machines | Sessions | Processes | Accounts | Applications}] [<CommonParameters>]
    

    Input Parameters

    ParameterDescriptionMandatoryPossible Values
    RuleIdRule GUIDNo
    ViewAvailable viewNo
    • Folders
    • Hosts
    • Machines
    • Sessions
    • Processes
    • Accounts
    • Applications

    Examples

    Get-CUScheduledExportRules
    

    Lists all configured export rules.
    image.png

    Get-CUScheduledExportRules -View Machines
    

    Lists all export rules for the Machines view

    Add-CUScheduledExportRule

    Creates a new export rule (for monitor only). The user that runs the action needs the Manage Monitors permission in the Security Policy.

    Syntax

    Add-CUScheduledExportRule [-View] <PsExportRuleView> [-Days] <DayOfWeek[]> [-StartTime] <TimeSpan> [-EndTime] <TimeSpan> [-Interval] <TimeSpan> [[-DeleteOlderThan] <TimeSpan?>] [[-IncludeAssociations] <SwitchParameter>] [<CommonParameters>]
    

    Input Parameters

    ParameterDescriptionMandatoryPossible Values
    ViewAvailable viewYes
    • Folders
    • Hosts
    • Machines
    • Sessions
    • Processes
    • Accounts
    • Applications
    DaysThe days of the week on which the export rule should be executedYes
    • "0" or "Sunday"
    • "1" or "Monday"
    • etc..
    StartTimeTime of day when the export rule should begin executionYes
    • 8:30:00 (= 8:30 AM)
    • 21:00:00 (= 9:00 PM)
    EndTimeTime of day at which the export rule will stop runningYes
    • 8:30:00 (= 8:30 AM)
    • 21:00:00 (= 9:00 PM)
    IntervalInterval at which the export rule will run. The minimum interval is one minute and maximum is 100 000 daysYes
    • 00:30:00 (= every 30 minutes)
    • 03:00:00 (= every 3 hours)
    DeleteOlderThanRetention period for historical data. The minimum setting is one 1 minute and the maximum 100 000 daysNo
    IncludeAssociationsIf specified, exports an expanded set of columns which are usually not visible in the console. These columns are mostly for internal useNo

    Examples

    Add-CUScheduledExportRule -View Applications -Days Monday,Friday -StartTime "8:30:00" -EndTime "19:30:00" -Interval "00:30:00"
    

    By executing this command, a new export rule is created for the Applications view. The rule is set to run every 30 minutes on Mondays and Fridays, beginning at 8:30 AM and ending at 7:30 PM

    image.png

    Set-CUScheduledExportRule

    Edits an existing export rule.

    Syntax

    Set-CUScheduledExportRule [-RuleId] <String> [[-View] <PsExportRuleView>] [[-Days] <DayOfWeek[]>] [[-StartTime] <TimeSpan>] [[-EndTime] <TimeSpan>] [[-Interval] <TimeSpan>] [[-DeleteOlderThan] <TimeSpan?>] [[-IncludeAssociations] <Boolean>] [<CommonParameters>]
    

    Input Parameters

    See input parameters for Add-CUScheduledExportRule

    Examples

    Set-CUScheduledExportRule -RuleId 1b6cc94f-b7c9-4284-bdd4-0dd34af1c614 -Days Monday,Friday -StartTime "8:30:00" -EndTime "19:30:00"
    

    Updates "Days", "StartTime" and "EndTime" properties while keeping all other properties unchanged.

    Remove-CUScheduledExportRule

    Removes an export rule.

    Syntax

    Remove-CUScheduledExportRule [-RuleId] <String> [[-Force] <SwitchParameter>] [<CommonParameters>]
    

    Input Parameters

    ParameterDescriptionMandatoryPossible Values
    RuleIdRule GUIDYes
    ForceIf used, no confirmation prompt is shownNo

    Examples

    Remove-CUScheduledExportRule -RuleId a48a0c46-6901-43ed-ac6f-69ce2a0463a8
    

    Prompts the user to confirm the deletion of Rule ID a48a0c46-6901-43ed-ac6f-69ce2a0463a8 before removing it.
    image.png


    Was this article helpful?