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.