Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline jonson@nmfta.org  
#1 Posted : Tuesday, June 10, 2008 10:45:25 PM(UTC)
jonson@nmfta.org

Rank: Paid support

Joined: 6/10/2008(UTC)
Posts: 3
Location: Alexandria, VA USA

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
Offline Support  
#2 Posted : Tuesday, June 10, 2008 11:56:56 PM(UTC)
Support

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,223

Thanks: 875 times
Was thanked: 446 time(s) in 424 post(s)
This is one example. You need to get the Credential Id from the Task first:

Code:
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!
Offline michaelhum  
#3 Posted : Tuesday, April 2, 2019 10:11:10 PM(UTC)
michaelhum

Rank: Paid support

Joined: 5/25/2015(UTC)
Posts: 97
Canada
Location: Scarborough, Ontario

Was thanked: 6 time(s) in 6 post(s)
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?
Offline Support  
#4 Posted : Wednesday, April 3, 2019 9:57:53 PM(UTC)
Support

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,223

Thanks: 875 times
Was thanked: 446 time(s) in 424 post(s)
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!
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top