How do I get a citrix client receiver version number in c# - c#

I'm running a c#.NET application as a login/logout script on a XenApp server. The application will run in a user context and I need to be able to retrieve the (client's) citrix receiver version number as well as the client os and machine name.
I'm fairly new to Citrix APIs and they don't seem to have very good documentation--anyone out there know how to accomplish this?

I found the citrix receiver version number in the windows registry on the XenApp server:
HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Ica\Session\{SESSION_NUMBER}\Connection
where {SESSION_NUMBER} can be found in
HKEY_USERS\{SID_NUMBER}\Software\Citrix\SessionSfr
as the only subkey in that key, and where {SID_NUMBER} is the SID of the user logged into the XenApp session.

If anyone is interested, I spent the weekend writing a .NET wrapper around the Citrix CCM SDK and published the code on GitHub: CcmSdk.Net
The project targets .NET Standard 2.1 at the moment because I needed the new UTF-8 marshaling functionality that is not available in older versions. If .NET Framework support is required, you can simply copy the code to a .NET Framework 4.7+ project and use that build instead.
Citrix Workspace sepersedes Citrix Receiver, and I think the registry method mentioned here doesn't work to find out the client version of Citrix Workspace, but it was still very helpful for me because many of our clients are still using the old Citrix Receiver.

Related

Windows User Impersonation in .NET Core on Linux?

I'm writing a .NET Core application in C# that will run on a Linux server, but I need to impersonate a Windows user in order to access some remote resources on a Windows Server. I have credentials to authenticate there, but all the implementations I see rely on the "Advanced Windows 32 Base API" (advapi32.dll), which is a shared Windows library not available on Linux.
How do I make this work?
I was able to get a solution by thinking outside the box a bit. I discovered that I could use SharpCifs.Core for CIFS access and the Microsoft PowerShell SDK to gain a remote PowerShell session, and get environment variables. I do wish that Microsoft would write some better cross-platform tooling.
Mono project has a kind of wrapper of several linux commands, one of them is seteuid (the linux command used for impersonation). It could be worth having a look to the NuGet package Mono.Posix.NETStandard. It seems is going to be revamped in the new .Net 5 version. I'm not sure if it can fit your needs...

Is it possible to use self hosted Nancy with https (ECDH-ECDSA) on Linux (Mono)?

The software I'm working on will run on an embedded system running Linux. We are currently in a hardware evaluation phase so the OS will either be Debian or a stripped-down buildroot Linux (presumably it's going to be this one). I managed to get Nancy up and running but now the requirement arose to use TLS with ECDH-ECDSA.
The official documentation only offers an example configuration for Windows using netsh (which I unfortunately cannot test since I'm not allowed to execute netsh commands on my machine). While researching, I found other sources (here and here) which are also only true for Windows.
There is also a rather old post stating that "Nancy console hosting doesn't support ssl itself, so in order to have ssl, you need to run another web server, which does support ssl". And indeed, there is a documentation for using Nancy with Nginx on Ubuntu. Since the buildroot Linux has no package manager it is hardly (if at all) possible to install Nginx on the system. I also found this post stating to use httpcfg to bind a certificate to a port. But again, httpcfg is not available on the buildroot Linux system, altough it might be possible to get it installed if available.
So, is it possible to use self hosted Nancy with https (ECDH-ECDSA) on Linux (Mono) without running another web server?
If so, how can I accomplish this and how can I tell Nancy to use TLS with ECDH-ECDSA?

How can I configure an "INDEPENDENT" .NET application with DB Connection to Oracle?

I have a WebService developed in .NET which connects to an Oracle Database. To do that I use the ODAC which Oracle Provides.
But every time I need to install my application on the Client Machines, I have so much trouble regarding the "Oracle Client", depending on if he already has an Oracle Client installed that is not the same version, or if he has one with a different platform (32bit, 64 bit), or anything else.
The point is I spend too much time trying to fix that thing every time.
Is there a way I can configure my application that I can install it, and it has everything it needs. And I don't need to worry about what the server has installed or what will be installed on it. Is there a way?
ODP.NET is distributable and multiple versions can be installed on one machine. You can include it with your app and that will minimize versioning issues.
It sounds like you are currently using the unmanaged ODP.NET driver. If so, have a look at the XCopy install. You can look at how the scripts work and include them in your own install.
If you can use the Fully Managed ODP.NET that will mostly eliminate the 32-bit vs 64-bit issue (unless you are using distributed transactions). And it is only 10 MB.
http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index-101716.html
Maybe you can check out the Oracle Instant Client?
Oracle Instant Client
The Basic download contains all files needed if you're only wanting to connect to the db from your .Net app. I have used this a lot in the past. Simple install, too.

Deploy and start .NET service on multiple Windows Server 2012

I have a service written in C# that relies on features in .NET 4.5 that are not yet supported in any version of mono, so I have to use Windows servers. In other cases to deploy a network service I would just SCP a jar/tar/whatever over and then SSH over the deployment process, and that can be made a part of an sh script that can distribute to wherever. But because this is Windows, I don't have those tools and I'm at a bit of a loss as to how to deploy this to 20 (or more) different servers.
So I see that there is a publish process in MSVS 2012, but it seems to make use of Windows file shares or else I'm supposed to send it to a website of some kind(???) but it doesn't look like it has any way of starting it even if I could figure out how to get it there.
Is there some product that does this in Windows or would it be easier for me to just install an SSH server? I have remote desktop access, but would prefer not to have to deploy anything manually on them.
Thank you!
Try using Powershell with WMI. [This question] (https://superuser.com/questions/337810/how-can-i-remotely-install-or-uninstall-a-service-on-windows-server-2008-r2) discussed some approaches to install windows service remotely.

How to access Linux directories/files from a Windows Service using C#

I have a C# Windows Service that needs to access to a Linux computer to get a list of files in a particular directory. What .NET 3.5SP1 method would one use that allows me to do this?
Thanks.
You'll have to create a Samba (SMB) or NFS share on the Linux box that is accessible from the Windows machine that is running your application.
You can then use the standard tools for working with files/directories in .NET to work with the files.
As mentioned in comments, you could also use the standard FTP libraries which would require configuring an FTP server on your Linux machine. SFTP is also an option...but would require a third party library on the .NET side.
Hi you can check at my open source project http://code.google.com/p/nekodrive You can use directly NekoDrive.NFS c# library that wraps my implementation of V2 e V3 NFS Protocol (V4.1 is coming).. It doesn't support the full protocol yet but It works for basic browsing/download/upload functions..
hope this helps

Categories