Audience: ClassLink Administrator
Events & Actions are actions that are taken when an event occurs. In other words, a specific action is taken when a user triggers a condition based on its properties. You can also select users with other conditions not based on user properties. These include: User is Enabled, User is Disabled, User is Added, From Source, or For All Users.
Note: For these conditions, the preview's user counts represent the maximum number of eligible users.
- Assign Property and Value
- Execute ODBC Query
- Execute PowerShell Script
- Execute Visual Basic Script
- Remove From Unmanaged Groups
- Move to OU
- Execute API Request
- Verify Network Share
- Advanced: User Account Controls
- Advanced: Fail User Exports if this Event Fails?
Default Disable Event
After creating a destination you may realize that there is a default event that gets created upon creation which is called Disable Users On Disable. This event will disable a user during an export if they are disabled within OneSync. If this event is not turned on any users that are disabled in OneSync will not get disabled during the export.
Assign Property and Value
This action will set a value for a specified property for the selected users. No additional configuration is required.
To setup email credentials to use with OneSync click the grey button labeled Email Credentials in the top right in the Events & Actions tab.
This action messages the designated email address. The email address, the email body, and the email subject can all be templated. That is, they will accept mappings and text transformations. Before you can use this action, you must enter email credentials in the Events & Actions tab of the destination. These credentials include an Email to Send From, Password, Port, and Host. Once you have entered your credentials, you can send a test email to confirm that the action will function correctly. Your email client will often set a secure port for you. Otherwise, you must choose a port yourself. The host is the server name of your email client. For example, for Office 365 email accounts, the port number is 587 and the host is "smtp.office365.com".
Note for Gmail Users: In order to send emails via an SMTP relay, you must edit your account permission settings to allow lower security clients to access your account. For more detailed on how to route outgoing non-Gmail messages through Google and more information, click here.
Execute ODBC Query
To use this action, you must first set up a Database Connection in OS Settings -> Database Connections. Once a connection has been created, you can use this action in destination Events & Actions. Select type Execute ODBC Query, select a database connection, and then enter a database query in the Query Editor. The query's results will be output to the Export Logs. If there is no results or output, the logs will state so. Otherwise, the logs will detail the first 50 rows. Larger queries will be truncated, but full queries can be listed if Verbose Logging is enabled in OS Settings.
Execute PowerShell Script
This action runs a PowerShell file of your own design. This action will load all .ps1 files from "C:\ClassLink OneSync\Scripts". Once loaded, you can then enter parameters into the event and action. These parameters can accept mappings and text transformations. In the parameters, you can also specify whether to run the script via Windows PowerShell or PowerShell Core.
For the Execute PowerShell Script action in Events & Actions, you can also specify whether to run the script via Windows PowerShell or PowerShell Core.
1. Navigate to your destination event.
2. In the Actions tab -> edit the parameters.
3. In the flyover, click the toggle to specify Windows PowerShell or PowerShell Core.
Execute Visual Basic Script
Execute Visual Basic Script which will run a specified VB script with any given parameters. This event is similar to Execute Powershell Script how the script files need to be within "C:\ClassLink OneSync\Scripts" folder for OneSync to recognize them.
Here's an an example of an event with a test.vbs file that is on the same computer as OneSync:
By clicking the blue cog you can enter any parameters (in order) for your script here:
Remove From Unmanaged Groups
Remove From Unmanaged Groups removes the selected users from any groups that OneSync hasn't created. Use this action by creating a new Event with a condition and under the Actions tab select Remove From Unmanaged Groups under the type. This event will now trigger for each user that meets the condition for this event.
Move to OU
This action moves a user to the specified organizational unit, formatted specifically for the destination type. No additional configuration is required. This action is only available for Active Directory and GSuite destinations.
Execute API Request
This action allows you to call Post, Get, or Put endpoints from an API via a specified URL. You can configure the request with query parameters, headers, and/or a request body.
To create an Execute API Request action:
1. Create or edit an event & action in a destination. Fill in the required details
2. Edit the desired event. In the Actions tab of the flyover, click the blue gear icon next to the desired action's value.
3. An additional flyover will open. Specify the HTTP verb for the endpoint and URL for the API.
4. Click the Query Parameters tab to enter any specified parameters for the request.
5. Click on the Headers tab to enter the headers of the request. Headers usually include authorization credentials and/or what kind of data you're expecting in return (JSON, HTML, etc.)
6. Next click on the Request Body tab which may only be used during POST and PUT requests. You will need to format the request body in JSON format for the request.
7. Click the blue Save button to save the configuration. Click the green Save Destination button to save the event & action.
Verify Network Share
This action will verify that the home folder and the home drive of each user got created successfully. This event will only verify the network share of users that meet the event condition and is only applicable to Active Directory destinations.
To setup Verify Network Share:
1. Create or edit an event & action in a destination. Fill in the Basic Details and Conditions
2. Then under Actions select Verify Network Share
This action will run for any user that meets the specific condition and will appear in those user's export logs. Also, Verify Network Share also can set user permissions for the specific network share.
There are two user permissions:
- Full Control: Allows users to read, write, change, and delete files and subfolders. In addition, users can change permissions settings for all files and subdirectories.
- Modify: Allows users to read and write of files and subfolders.
Advanced: User Account Controls
An advanced setting for Active Directory only called User Account Controls allows you to override default user account controls, for example: user account control policies and password policies.
To specify this setting:
1. Create or edit an event & action in an Active Directory destination.
2. Under the User Account Controls tab click the toggle Override Default User Account Controls?
3. The prompt below will appear for the configurable settings:
There are available options for setting the User Account Control Policies such as:
- Normal Account (this is a default account type that represents a typical user)
- Password Not Required (no password is required)
There are also available options for setting Password Policies:
- Password Never Expires (the password for this account will never expire)
- User Cannot Change Password (user cannot change the password)
- User Must Change Password On Next Log On (forces a user to change their password at next logon)
There is also an option to when these properties get mapped. To the right of User Account Controls there is a drop down menu with 2 different arrows:
1. Always Map: this will always map these properties on an add, edit, and enable
2. Only map when adding user: this will only map these properties when a user is added.
Advanced: Fail User Exports if this Event Fails?
You can indicate whether the failure of an event & action will cause the entire export to fail.
To specify the setting:
1. Create or edit an event & action in a destination. Fill in the required details
2. Edit the desired event. In the Advanced tab of the flyover, click the toggle to select either "Yes, fail the user export if this event fails" or "No, do not fail the user exports if this event fails".
Updated: Nov 2019