Deployment Solution

 View Only

Executing ASDK Methods Using Multiple DS Servers 

Apr 02, 2007 11:54 AM

If you ever need to execute a method against different DS servers when using the Web service in the ASDK use this code to switch between servers. This is useful when you need to find out which DS server a computer is located on and then execute a method against that computer.

ComputerManagementService computerManagement = new ComputerManagementService();
String strTargetServer = "SERVER.DOMAIN.COM";
computerManagement.Url = string.Format( "http://{0}/Altiris/ASDK.NS/ItemManagementService.asmx", strTargetServer);
CredentialCache cache = new CredentialCache();
cache.Add( new Uri(itemMS.Url), "Negotiate", new NetworkCredential( username, password, domain ) );
computerManagement.Credentials = cache;

Just change the strTargetServer to the next server. You could wrap this code in your own method to loop through all your servers and return the proper server that has the computer you are looking for.

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.