[英]How do you get a unique client ID on Citrix XenApp 6.0? (MFCom from 4.0 and 4.5 doesn't work)
Currently for Presentation Server 4.0 and 4.5, I am getting the unique client ID via MFCom in C# .NET.目前对于 Presentation Server 4.0 和 4.5,我正在通过 MFCom 在 C# .NET 中获取唯一的客户端 ID。
MetaFrameFarm farm = new MetaFrameFarm();
farm.Initialize(MetaFrameObjectType.MetaFrameWinFarmObject);
foreach (MetaFrameSession session in farm.Sessions)
{
clientId = session.ClientID;
.....
I began to get an error testing on 6.0.我开始在 6.0 上进行错误测试。 The line in question that is failing is the first line to instantiate a the object 'farm' above.有问题的行是实例化上述 object 'farm' 的第一行。
Looking online I found this...上网查了一下,发现这个...
Starting in XenApp 6.0, MFCOM as a publically supported programming and scripting interface will no longer be available.从 XenApp 6.0 开始,MFCOM 作为公共支持的编程和脚本接口将不再可用。 All existing MFCOM-based code no longer works on XenApp 6.0.所有现有的基于 MFCOM 的代码不再适用于 XenApp 6.0。 No doubt that the absence of MFCOM will be something that requires additional effort to the adoption of XenApp 6.0.毫无疑问,没有 MFCOM 将需要额外的努力才能采用 XenApp 6.0。
Is there a way to get a unique client ID in 6.0?有没有办法在 6.0 中获得唯一的客户端 ID?
This is pretty old, but I kept coming across this when I wanted to get a clientID.这已经很老了,但是当我想获得 clientID 时,我一直在遇到这个问题。
Keep in mind the ClientIDs from 4.X don't appear to be the same format for 6.X.请记住,来自 4.X 的 ClientID 似乎与 6.X 的格式不同。 This goes for about all the IDs, App and Server:这适用于所有 ID、应用程序和服务器:
Runspace rs = RunspaceFactory.CreateRunspace();
rs.Open();
PowerShell ps = PowerShell.Create();
ps.Runspace = rs;
PSSnapInException ex;
rs.RunspaceConfiguration.AddPSSnapIn("Citrix.XenApp.Commands", out ex);
ps.AddCommand("GET-XASession").AddParameter("Full");
foreach (PSObject Session in ps.Invoke())
{
try
{
ClientID = Convert.ToString(Session.Properties["ClientId"].Value);
Console.WrileLine(ClientID);
}
catch (Exception e)
{
WriteError.WriteEntry("Client Failure " + e.Message + EventLogEntryType.FailureAudit);
}
}
As you've correctly established, MFCOM is not available on XenApp 6. So, you're left with two ways of getting a unique ClientID:正如您正确建立的那样,MFCOM 在 XenApp 6 上不可用。因此,您有两种获取唯一 ClientID 的方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.