简体   繁体   English

获取远程服务器上运行的 COM+ 服务列表?

[英]Get List of COM+ services running on remote servers?

How I can get list COM+ services running on remote servers?如何获取在远程服务器上运行的列表 COM+ 服务? and how to set identity to com+ server remotely.以及如何远程设置 com+ 服务器的身份。

You can use the COM+ Administration API to accomplish this.您可以使用COM+ Administration API来完成此操作。 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#.这是一个用 C# 编写的简单示例。 You will add a reference to the COM + 1.0 Admin Type Library您将添加对COM + 1.0 管理类型库的引用

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";
    }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM