需要配置 COM+ 的帮助使用 C# 或脚本以编程方式提供服务

发布于 2024-08-19 14:49:01 字数 427 浏览 2 评论 0原文

是否可以以编程方式配置 COM+ 服务。

我需要使用 C# 或任何脚本执行以下操作

  1. 打开管理工具 ->组件服务
  2. 展开组件服务 ->我的电脑 -> COM+ 应用程序
  3. 右键单击​​ HyperV 环境管理器(COM+ 服务名称)并选择属性。
  4. 单击“池化”和“池化” “回收”选项卡
  5. 在“应用程序回收”下,将“内存限制 (KB)”值设置为 262144。
  6. 单击“确定”
  7. 右键单击​​ HyperV 环境管理器(COM+ 服务名称)并选择“关闭”
  8. 右键单击​​ HyperV 环境管理器(COM+ 服务名称)并选择“启动”

如果您可以指导我或向我发送代码片段。

提前致谢。

问候, 斯里吉思·拉詹

Is it possible to programmaticaly configure COM+ service.

I need to do the following using C# or any script

  1. Open Administrative Tools -> Component Services
  2. Expand Components Services -> My Computer -> COM+ Applications
  3. Right Click HyperV Environment Manager(COM+ service name) andselect Properties.
  4. Click on Pooling & Recycling tab
  5. Under Application recycling, set Memory Limit(KB) value to 262144.
  6. Click OK
  7. Right Click HyperV Environment Manager(COM+ service name) and select ShutDown
  8. Right Click HyperV Environment Manager(COM+ service name) and select Start

It will be great if you could guide me or send me the code snippet.

Thanks in advance.

Regards,
Sreejith Rajan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

素手挽清风 2024-08-26 14:49:01

您可以使用组件服务管理 (COMAdmin) 库以编程方式完成您概述的步骤。人们可以通过 C#、VBScript、PowerShell 以及其他任何可以利用 COM 组件的功能来访问它。

配置 COM+ 应用程序回收值 MSDN 上的 VB6 代码示例页面完全满足您配置回收属性的需求。检查设置应用程序回收设置来自代码/命令行的 COM+ 组件 MSDN 示例 VBScript 端口的问题。

顺便说一句,您不必重新启动目标 COM+ 应用程序即可使更改生效。也就是说,您例程中的最后两个步骤是多余的:

 7. Right Click HyperV Environment Manager(COM+ service name) and select ShutDown
 8. Right Click HyperV Environment Manager(COM+ service name) and select Start

You can use Component Services Administration (COMAdmin) Library to programmatically accomplish the steps you outlined. One can access it from C#, VBScript, PowerShell, anything else that can harness the power of COM components.

VB6 code sample on Configuring COM+ Application Recycling Values MSDN page addresses exactly your need to configure Recycling properties. Check Setting application recycling settings for COM+ component from code / command line question for VBScript port of MSDN sample.

By the way, you do not have to restart target COM+ application for changes to take effect. I.e. the last two steps in your routine are redundant:

 7. Right Click HyperV Environment Manager(COM+ service name) and select ShutDown
 8. Right Click HyperV Environment Manager(COM+ service name) and select Start
他夏了夏天 2024-08-26 14:49:01

您应该使用 HyperV 的 WMI 来执行此操作。网上有很多例子,比如

You should use HyperV's WMI to do this. There are many examples on the web, such as this one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文