通过vbscript更改现有的COM +应用程序标识

时间:2010-11-09 12:17:37

标签: .net vbscript com+ msdtc

如何通过vbs脚本更改现有的COM +应用程序标识。例如Authentication level = none和通过vb脚本对该用户的身份。在添加/删除com +应用程序但未更改现有应用程序时发现了许多帖子。请帮忙

1 个答案:

答案 0 :(得分:3)

这是一个脚本,它检索所有应用程序,找到您感兴趣的名称的应用程序,并将Identity,Password和Authentication设置为Connect。有关应用程序属性的完整列表,请参阅Applications Collection下的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