Content:
Overview
Starting with Cayosoft Administrator 8.0 you can export or import Automation rules with the help of the Cayosoft Graph Module for PowerShell. Please see this article for details: Installing Cayosoft Graph Module from PowerShell Gallery – Cayosoft Help Center.
Using the Cayosoft Graph (CGraph) Module allows the import or export of Automation Rules in bulk in JSON file. Below in this article, you will find the Cgraph parameters descriptions and usage examples.
Commands
Export-CGAutomationRule
[-Container] (optional)
[-ConfiguredRulesOnly] (optional)
[-ExcludeContainer] (optional)
[-ExcludeRule] (optional)
[-FileName] (required)
[-Name] (optional)
[-ShowBanner] (optional)
Description
The Export-CGAutomationRule cmdlet exports the Automation Rule configuration from the Cayosoft Administrator to a JSON file.
Example 1
Export-CGAutomationRule -FileName C:\Temp\output.json -Name "My runbook"
This command exports the runbook to a JSON file.
Example 2
Export-CGAutomationRule -FileName C:\Temp\output.json -ConfiguredRulesOnly:$True
This command exports all configured rules.
Import-CGAutomationRule
[-DonotEnableSchedule] (optional)
[-FileName] (required)
[-Overwrite] (optional)
[-ReportFileName] (optional)
[-ShowBanner] (optional)
Description
The Import-CGAutomationRule cmdlet imports the automation rule configuration of one or more rules from a JSON file to the Cayosoft Administrator Service.
Example 1
Import-CGAutomationRule -Overwrite -DoNotEnableSchedule -FileName C:\Temp\output.json
This command imports the Automation Rule configuration from the JSON file to the Cayosoft Administrator Service and disables its schedule. If the rules already exist in the target Service they will be overwritten.
Remove-CGAutomationRule
[-FileName] (required)
[-ShowBanner] (optional)
Description
The Remove-CGAutomationRule cmdlet Deletes automation rule configuration from the Cayosoft Administrator based on the input JSON file.
Example
PS>Remove-CGAutomationRule -FileName C:\Temp\output.json
This command deletes Automation Rules specified in the JSON file and removes links to these rules from the Runbooks and Rules to run after this rule section.
Parameters description
Export parameters
-Container <String>
Specifies one or more container names with Automation Rules. Supports PowerShell wildcard-expression. When not set, it exports all Automation Rules from the Cayosoft Administrator.
-ConfiguredRulesOnly <SwitchParameter>
If set to $True it exports only configured Automation Rules.
Configured Automation Rules are the rules that have:
- At least one setting changed - the value in this setting is not by default
- Enabled schedule
- Changed Output type
-ExcludeContainer <String>
Specifies one or more names of containers with Automation Rules that are excluded from the export. Supports PowerShell wildcard-expression.
[-ExcludeRule] <String>
Specifies one or more Automation Rule names to exclude them from the export. Supports PowerShell wildcard-expression.
-Name <String>
Specifies one or more Automation Rule names to export. Supports PowerShell wildcard-expression. When not set, it exports all Automation Rules from the specified container.
Import parameters
-DonotEnableSchedule <SwitchParameter>
If set to $False it enables the Automation Rule schedule after import.
-Overwrite <SwitchParameter>
If set to $True it overwrites existing Automation Rules in the target Cayosoft Administration Service with the rules that are specified in the JSON file.
-ReportFileName <String>
Specifies file name to store a report with the results of the Automation Rules import.
Common parameters
-FileName <String>
Specifies the input JSON file name.
-ShowBanner <SwitchParameter>
If set cmdlet prints version information.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters about_CommonParameters - PowerShell | Microsoft Docs.
Release Notes
Version | Notes |
---|---|
8.0.2.292 |
|
Comments
0 comments
Please sign in to leave a comment.