The add_credentials_ex API function lets you add credentials for hosts.
Arguments
The add_credentials_ex API function includes the arguments described in the following table:
Name |
Type |
Description |
---|---|---|
session_id |
uint |
The session ID that was returned by calling the create_session function API. |
scenario_id |
uint |
The scenario ID to which you want to add credentials. |
host_name |
string |
The host IP address. Example: 155.35.76.44. |
port |
uint |
The engine port number. Typically, the port number is 25000. |
user_name |
string |
The user name. Example: Administrator |
password |
string |
The password for the user name. Example: Arcserve |
domain_name |
string |
The domain name. Example: arcserve.com |
Return Values
The return type is ulong. A return value of zero indicates that API completed successfully. When the return value does not equal zero, the API failed.
Example
public bool add_credentials_ex_example() { try { uint scenario_id = _scenario_id; //Add credential for Master string host_ip = "155.35.66.138"; uint port = 25000; string user_name = "administrator"; string password = "caworld"; string domain_name = "155.35.66.138"; ulong res = get_mng().add_credentials_ex(_session_id, scenario_id, host_ip, port, user_name, password, domain_name); //Add credential for Replica host_ip = "155.35.66.142"; domain_name = "155.35.66.142"; res = get_mng().add_credentials_ex(_session_id, scenario_id, host_ip, port, user_name, password, domain_name); return (res == 0); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } return false; }
Copyright © 2015 Arcserve.
All rights reserved.
|
|