通过VBS脚本改变现有的COM +应用程序的身份有的、应用程序、脚本、身份

2023-09-03 22:54:08 作者:-/不管怎样活着就好

如何通过vbs脚本改变现有的COM +应用程序的身份。像通过VB脚本的身份验证级别= none和身份给该用户。发现有很多张贴在添加/删除COM +应用程序,但不改变现有的。请大家帮忙

How to changing existing COM+ applications identity via vbs script. like Authentication level = none and identity to this user via vb scripts. found many posting on add/delete com+ applications but not changing existing one. please help

推荐答案

下面是检索所有的应用程序的脚本,找到一个与你感兴趣的名称,并设置标识,密码和的认证以连接。对于应用程序属性的完整列表,请参阅 Applications集合 COM +管理类别。

Here's a script that retrieves all of the applications, finds the one with the name you are interested in and sets the Identity, Password and Authentication to Connect. For a full list of Application properties see Applications Collection under COM+ Administration Collections.

Const COMAdminAuthenticationDefault   = 0
Const COMAdminAuthenticationNone      = 1
Const COMAdminAuthenticationConnect   = 2
Const COMAdminAuthenticationCall      = 3
Const COMAdminAuthenticationPacket    = 4 
Const COMAdminAuthenticationIntegrity = 5
Const COMAdminAuthenticationPrivacy   = 6

Dim catalog
Dim applications
Dim application

Set catalog = CreateObject("COMAdmin.COMAdminCatalog")
Set applications = catalog.GetCollection("Applications")

Call applications.Populate

For Each application In applications

    If (application.value("Name")  = "AppName") Then

        application.Value("Authentication") = COMAdminAuthenticationConnect
        application.Value("Identity") = "domain\account"
        application.Value("Password") = "Password"

        Call applications.SaveChanges
    End If
Next