Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


F.O.
  •  F.O.
  • No customer Topic Starter
2016-03-16T14:38:46Z
Hi everyone,
I have currently two VisualCron servers running with plenty of users on it who are creating Jobs. Every user has his own personal connection to a database. The password for this connection has to be changed frequently for security reasons and every time this happens the connection has to be edited and I'm the only one with the rights to do this.
I'm trying to add automation to the process and for that I need to know if it is possible at all, to edit/add connections to VC via a script. And if that's the case, under which conditions.

Thank you very much in advance for your answers.
Sponsor
Forum information
Support
2016-03-17T12:14:12Z
I would say the best way of doing this is to use the .NET API. Depending on how you want to interact with the API you can call it directly from your code, create a PowerShell script or an executable of it.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
F.O.
  •  F.O.
  • No customer Topic Starter
2016-04-07T10:29:12Z
Thank you Henrik and sorry for my late response.

I have taken a look into creating a solution with the .NET-API. I think the best solution for my case is a ViscualCron Job in combination with a C# script. Here's what I'm planning to do.

I created a VisualCron Job where a User can make an input with his credentials (popup-Task). The input get's passed to the C# script which updates the Connection with the new password.

I have two questions about that.
The first one: is there an elegant way to forward user input to another task? My current approach is to have a Popup-Task where the user puts adds his credentials, then the next task reads the output of the popup-taks: {TASK(d168bd52-0f07-458c-89a8-81f4fcb14cd3,StdOut)} The problem here is, that everyone can read the credentials in the Output-log.

The other question: Am I on the right track to update a connection in the following way: get the connection that has the same name as the users inputname -> set the password of this connection to the same password as the users inputpw -> Save the connection
My current approach on this topic looks something like this, but I'm not sure if I've got the right understanding of Connection, Connections and ConnectionClass:

            Connections c1 = new Connections(s);
            foreach(ConnectionClass cc in s.Connections.GetAll())
            {
                if(cc.Name == inputName)
                { 
                    cc.PassWord = inputPwBytes; //this is the user's new password
                    c1.Update(cc);
                }
            }
Support
2016-04-07T11:56:46Z
Use PrevTask instead of the Id that you use:

{TASK(PrevTask,StdOut)}

I would maybe use a .NET code Task to encrypt it and later decrypt it - but as you say the password is still in the original popup Task. It was never built with that in mind.

When setting password you should use ClientObj.Encrypt( method as the value is not plain text.


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2016-04-07T14:44:30Z
Because of his request, I think it would be a good idea to add an option for the 'Output on the PopUp task to be written to a Job Variable. That way it's not in plain text viewable by users... and then the last task in his job could be to update that variable to some generic text so the password would only be visible for a second if someone happened to view the variable after entered but before changed to generic text

Feature Request? :)

Brian
Support
2016-04-07T15:23:40Z
Originally Posted by: bbusse 

Because of his request, I think it would be a good idea to add an option for the 'Output on the PopUp task to be written to a Job Variable. That way it's not in plain text viewable by users... and then the last task in his job could be to update that variable to some generic text so the password would only be visible for a second if someone happened to view the variable after entered but before changed to generic text

Feature Request? :)

Brian



Yes, the Feature request should be something like "Be able to select where the output is stored; normal output, Job Variable and/or UserVariable".
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2016-04-07T15:45:32Z
I'll create the feature request 🙂 Thanks Henrik.

Brian
Similar Topics
Users browsing this topic
Scroll to Top