- Print
- DarkLight
- PDF
PowerShell Cmdlets for Export Rules
- Print
- DarkLight
- PDF
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
Parameter | Description | Mandatory | Possible Values |
---|---|---|---|
RuleId | Rule GUID | No | |
View | Available view | No |
|
Examples
Get-CUScheduledExportRules
Lists all configured export rules.
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
Parameter | Description | Mandatory | Possible Values |
---|---|---|---|
View | Available view | Yes |
|
Days | The days of the week on which the export rule should be executed | Yes |
|
StartTime | Time of day when the export rule should begin execution | Yes |
|
EndTime | Time of day at which the export rule will stop running | Yes |
|
Interval | Interval at which the export rule will run. The minimum interval is one minute and maximum is 100 000 days | Yes |
|
DeleteOlderThan | Retention period for historical data. The minimum setting is one 1 minute and the maximum 100 000 days | No | |
IncludeAssociations | If specified, exports an expanded set of columns which are usually not visible in the console. These columns are mostly for internal use | No |
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
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
Parameter | Description | Mandatory | Possible Values |
---|---|---|---|
RuleId | Rule GUID | Yes | |
Force | If used, no confirmation prompt is shown | No |
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.