Search code examples
remote-servercom+

Get List of COM+ services running on remote servers?


How I can get list COM+ services running on remote servers? and how to set identity to com+ server remotely.


Solution

  • You can use the COM+ Administration API to accomplish this. It allows you to administer services in the local or remote catalog. See this article for guidance on how to get and set properties. Here's a simple example written in C#. You will add a reference to the COM + 1.0 Admin Type Library

    using COMAdmin;
    
    COMAdminCatalogCollection applications;
    COMAdminCatalog catalog;
    
    catalog = new COMAdminCatalog();
    // To connect to a remote server you would user the following
    catalog.Connect(serverName); 
    
    applications = (COMAdminCatalogCollection)catalog.GetCollection("Applications");
                applications.Populate();
    
    foreach (COMAdminCatalogObject application in applications)
    {
        //do something with the application
        if (application.Name.Equals("MyAppName"))
        {
            application.Value["Identity"] = @"MACHINE\UserName";
            application.Value["Password"] = @"UserPassword";
        }
    
    }