[英]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.