简体   繁体   English

获取Identity Windows Com +应用程序?

[英]Get Identity Windows Com+ Application?

I have found where I can SET the Identity for Com+ Applications, but cannot find how to GET the Identity for existing Com+ Applications. 我找到了可以在其中设置Com +应用程序身份的地方,但是找不到如何为现有Com +应用程序获取身份的地方。

set: How to modify COM+ applications from powershell 设置: 如何从PowerShell修改COM +应用程序

get the COM+ application name, ID, and whether it is running: https://social.technet.microsoft.com/Forums/projectserver/en-US/7b035318-fc4c-41bb-ad9a-33fa51485c57/check-whether-aplication-in-comadmincomadmincatalog-is-running-or-not?forum=ITCG 获取COM +应用程序名称,ID以及它是否正在运行: https : //social.technet.microsoft.com/Forums/projectserver/zh-CN/7b035318-fc4c-41bb-ad9a-33fa51485c57/check-whether-aplication- in-comadmincomadmincatalog是否正在运行?论坛= ITCG

Dim Catalog, AppCollection, AppList, AppItem
Set Catalog = CreateObject("COMAdmin.COMAdminCatalog")
Set AppCollection = Catalog.GetCollection("Applications")
AppCollection.Populate
Set AppList = CreateObject("Scripting.Dictionary")
For Each AppItem In AppCollection
  AppList.Add AppItem.Value("ID"), AppItem.Name
Next

Dim AppInstances, AppInstance, AppInstanceList, Value
Set AppInstances = Catalog.GetCollection("ApplicationInstances")
AppInstances.Populate
Set AppInstanceList = CreateObject("Scripting.Dictionary")
For Each AppInstance In AppInstances
  Value = AppInstance.Value("Application")
  AppInstanceList.Add Value, AppList(Value)
Next

For Each AppItem In AppList
  WScript.Echo vbNewLine _
    & "App Name: " & vbTab & AppList(AppItem) & vbNewLine _
    & "App ID: " & vbTab & AppItem & vbNewLine _
    & "Running? " & vbTab & CStr(AppInstanceList.Exists(AppItem))
Next

So I figured if I change the item 'AppItem.Value("ID")' , to 'AppItem.Value("Identity")' , that would give me what I am looking for, but I get error --- 所以我想如果我将项目'AppItem.Value(“ ID”)'更改为'AppItem.Value(“ Identity”)' ,那会给我我想要的东西,但出现错误-

Script:  c:\pathtofile\test.vbs
Line:    7
Char:    3
Error:   This key is already associated with an element of this collection
Code:    800A01C9
Source:  Microsoft VBScript runtime error
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("Identity")  = "domain\username") Then

Wscript.Echo application.value("Name")

        Call applications.SaveChanges
    End If
Next

暂无
暂无

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

相关问题 未设置COM +应用程序标识 - COM+ Application Identity is not set 如何获得com +应用程序的所有com +组件的列表? - How can I get a list of all the com+ components of a com+ application? 尝试通过组件服务在Windows 8中添加新的COM +应用程序时收到错误消息。 - Getting error message when trying to add new COM+ application in Windows 8 through Component services. 是否有任何理由不在COM +应用程序中托管COM服务器? - Are there any reasons not to host a COM server in a COM+ application? 在Windows 8.1上调用COM +组件时出现自动化错误 - Automation Error when calling COM+ component on Windows 8.1 如何授予对我的 COM+ 应用程序的访问权限? - How do I grant access to my COM+ application? 将COM对象导入COM +应用程序,同时保留直接访问COM对象的权限吗? - Import COM object into COM+ application while retaining access to the COM object directly? 将COM服务器添加到COM +服务器应用程序后,无法再在过程中实例化它-为什么? - Once I add a COM server into a COM+ server application I can no longer instantiate it in-proc - why? 在哪里可以找到有关Microsoft未来Windows版本中COM +支持计划的可靠信息? - Where can I find reliable information about Microsoft's plans for COM+ support in future versions of Windows? Windows Service以C#托管的COM +组件,用于控制外部设备 - COM+ Component hosted by Windows Service in C# to control an external device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM