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


Guest
2008-06-10T20:45:25Z
We are looking to automate our credential updates (password change required every 60 - 90 days) across multiple servers and I have a .NET developer on hand to help with the Windows service accounts and other items. We were looking for an example on how we could connect to a server programmatically and update the password for the stored credentials. Any assistance would be appreciated.

Regards,
Urban Jonson
NMFTA
Sponsor
Forum information
Support
2008-06-10T21:56:56Z
This is one example. You need to get the Credential Id from the Task first:

Server s = null;
            Client c = new Client();
            c.LogToFile = false;
            Connection conn = new Connection();
            conn.UserName = "admin";
            conn.PassWord = "";
            conn.Port = 16444;
            conn.ConnectionType = Connection.ConnectionT.Remote;
            try
            {
                s = c.Connect(conn,true);
            }
            catch (VisualCronAPI.Client.ClientLoginFailedException ex)
            {
                MessageBox.Show(ex.Message);
            }

            // get credential
            NetworkCredentialClass nc = s.Credentials.Get("your_credential_id");
            nc.UserName = c.Encrypt("username");
            nc.PassWord = c.Encrypt("password");
            s.Credentials.AddUpdate(nc);

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
michaelhum
2019-04-02T20:11:10Z
I'm thinking of a way to automate the changing of a credential's password.

In the networkcredentials.xml file, I have the following:

<NetworkCredentialClass xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Id>fb681f39-69df-4193-bfd4-ca139ef6aff4</Id>
<UserName>T8R5Xb4hGLI=</UserName>
<PassWord>hkyplbYd9v4=</PassWord>


If I were to copy the <PassWord>hkyplbYd9v4=</PassWord> to another networkcredentials.xml file on another machine, would it be the same password? Is this a correct assumption?

I did some testing with 2 machines. I changed the password for the network credential FRED on both machines

old password = 654321
new password = 123456

The entry in the networkcredentials.xml changes on both machines to:

<PassWord>hkyplbYd9v4=</PassWord>

If this is an accurate observation, can I simply change the <Password> tag value to <PassWord>hkyplbYd9v4=</PassWord> on all the machines where I need to change the password for the credential FRED?
Support
2019-04-03T19:57:53Z
We do not recommend editing the files as that does not work in realtime and could cause other errors. It is better to work with the API.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top