Content:
Enumerate Automation Rules
Example 1: Enumerate Cayosoft Administrator rules
Get-CGraph automationRules
This example returns information about the first 100 Cayosoft Administrator automation rules.
To get all the rules, use -All flag.
To get the specific number of rules, use -MaxResults N flag where N is an integer value.
Get-CGraph rules
Example 2: Get Cayosoft Administrator rule by name
Get-CGraph automationRules -Identifier 'Office 365 Users | Assign Teams Policy'
This example returns information about the automation rule with the name 'Office 365 Users | Assign Teams Policy'.
Rule name must be unique otherwise you will get the error.
Example 3: Get Cayosoft Administrator rule by id
Get-CGraph automationRules -Identifier 'c3f4b835-9aef-463a-89c9-93e1feac2910'
This example returns information about the automation rule with the id 'c3f4b835-9aef-463a-89c9-93e1feac2910'.
You can find the id in Design mode > Query tab > Rule ID setting.
Execute Automation Rules
Example 1: Execute a Cayosoft automation rule by name
Set-CGraph execute -Parent "/automationRules/Office 365 Users | Assign Teams Policy"
This example executes the rule with the name "Office 365 Users | Assign Teams Policy".
Rule name must be unique otherwise you will get the error. It is recommended to run the rule by ID.
Set-CGraph rules -Name "RuleName"
Example 2: Execute a Cayosoft automation rule by rule ID
Set-CGraph execute -Parent "/automationRules/bf7fe742-a060-4c3a-9345-d462a5759b2c"
This example executes the rule with the id "bf7fe742-a060-4c3a-9345-d462a5759b2c".
You can find the id in Design mode > Query tab > Rule ID setting.
Set-CGraph rules -Identifier "GUID"
Enumerate Runbooks
Example 1: Enumerate Cayosoft Administrator runbooks
Get-CGraph runbooks
This example returns information about the first 100 Cayosoft Administrator runbooks.
To get all the runbooks, use -All flag.
To get the specific number of runbooks, use -MaxResults N flag where N is an integer value.
Example 2: Get Cayosoft Administrator runbook by name
Get-CGraph runbooks -Identifier 'Provision Hybrid Users'
This example returns information about the runbook with the name 'Provision Hybrid Users'.
The runbook name must be unique otherwise you will get the error.
Example 3: Get Cayosoft Administrator runbook by id
Get-CGraph runbooks -Identifier 'c3f4b835-9aef-463a-89c9-93e1feac2910'
This example returns information about the runbook with the id 'c3f4b835-9aef-463a-89c9-93e1feac2910'.
You can find the id in Design mode > Query tab > Rule ID setting.
Execute Runbooks
Example 1: Execute a Cayosoft Administrator runbook by name
Set-CGraph execute -Parent "/runbooks/Provision Hybrid Users"
This example executes the runbook with the name "Provision Hybrid Users".
The Runbook name must be unique otherwise you will get the error. It is recommended to run the runbook by ID.
Set-CGraph rules -Name "<runbook name>"
Example 2: Execute a Cayosoft Administrator runbook by ID
Set-CGraph execute -Parent "/runbooks/bf7fe742-a060-4c3a-9345-d462a5759b2c"
This example executes the runbook with the id "bf7fe742-a060-4c3a-9345-d462a5759b2c".
You can find the id in Design mode > Query tab > Rule ID setting.
Set-CGraph rules -Identifier <runbook ID>
Comments
0 comments
Please sign in to leave a comment.