Toad World® Forums

Change automation scripts bd credentials with the API or automatically

Hi,

We are still preparing the deployment of Toad Data Point and Toad Intelligence Central.

Users will connect to TIC and to our MS SQL Server using their own windows login (Active Directory).

In order to prevent their automated scripts to fail in case they changed their windows password, we will be using the "automation scripts managment page under Objects" to make sure all the automated scripts run with the windows service user name (which has access to the database).

But is there a way to perform this action automatically using the API or other method? We don't want to login manually with the root user everyday to update new automated scripts.

We are new to Toad, so any help or any other suggestion would be appreciated.

Thanks

hi,

I am still not very clear what you want. As I know, AD users will not change their windows password frequently, right? Why did you need to manually login TIC web portal and check every day? Just in case some users have changed their password?

You may configure a SMTP server in Server==>Notifications page and assign an email address for user root in Users page. If any automation script runs failed, the user root will receive email notifications for that event. And you may take actions once you get the email notification.

We have REST APIs for update automation script run-as credential. But I think it is not friendly for end-user to call. If you are interesting in it, I will provide more detail for you.

If I publish an automated script on TIC using my active directory login and I change my active directory password after, the automated script no longer work as the automated script can't login anymore.

So we want to make sure all automated scripts run under a "system" user while the owner is still the original user.

The REST Api call will be made by our (IT) and no by end users.

OK.

First, you need to call 'tic/v1/artifacts?types=script' to retrieve all automation scripts.


It's a GET request with Basic Authentication of user name and password.
And the response is something like below:

{
"artifacts": [
{
"artifact_type": "SCRIPT",
"can_manage": "False",
"contributor_code": "DATAPOINT",
"created_at": "12/12/2019 4:16:05 PM",
"database": "data_gavin",
"description": "",
"display_type": "Automation Script",
"etag": null,
"extra_properties": {
"db_platform": "None"
},
"folder": "/folder2",
"folder_id": 3,
"force_update": "False",
"is_manager": true,
"is_visible": true,
"key": "Script_1",
"last_used": null,
"links": ,
"locked_by": null,
"modified_at": "12/12/2019 4:16:05 PM",
"modified_by": "gavin",
"name": null,
"owner": "gavin",
"sequence_no": null,
"shared_with": ,
"tags": ,
"version": null,
"visibility": "PRIVATE"
}
]
}

Second, call API of 'tic/v1/artifacts/scripts/authentication' to set automation script run as user.

  • If you want to set run as user to any Active Directory user, call the api with parameters like this:

    For SpecifyUser and EditedUser in new_credential, just set they to true. They are just some flag and without any meaning.
  • If you want to set run as user to default user, like this:

NOTE: the database_name bind to the database field in step 1 and object_name is key field in step 1. You may update multiple automation scripts in one call.

1 Like

Thank you much.

We'll use the default user that runs the windows service.