{"id":3213,"date":"2020-12-02T22:07:37","date_gmt":"2020-12-02T21:07:37","guid":{"rendered":"https:\/\/www.mariotti.de\/?p=3213"},"modified":"2020-12-02T22:07:37","modified_gmt":"2020-12-02T21:07:37","slug":"in-citrix-sitzungen-clientname-client-ip-client-os-client-version-etc-ermitteln","status":"publish","type":"post","link":"https:\/\/dev.mariotti.de\/?p=3213","title":{"rendered":"In Citrix Sitzungen Clientname, Client IP, Client OS, Client Version, etc. ermitteln"},"content":{"rendered":"<p>Will man im Benutzerkontext innerhalb einer Citrix Sitzung Information vom Clientrechner ermitteln wie z.B. Client Name, Client IP, Client Betriebssystem, Version der Citrix Workspace App, etc.\u00a0so w\u00e4re dies \u00fcber die WMI Schnittstelle m\u00f6glich. Citrix stell diese Informationen im Namensraum &#8222;Root\\Citrix&#8220; durch entsprechende Klassen zur Verf\u00fcgung.<\/p>\n<p>Hier einige beispielhafte PowerShell Schnipsel, die aufzeigen was man so alles abfragen kann:<\/p>\n<pre><code class=\"language-powershell\"># Citrix Client Version, Client Name, Client IP, Client Product ID (aka OS), etc.\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_Client\n\n# Translate ProductID to Client OS\nswitch ((Get-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_Client -OutVariable CitrixClient).ProductID)\n{\n    '1' {write-host \"Windows\"}\n    '81' {write-host \"UNIX \/ Linux\"}\n    '82' {write-host \"MacOS\"}\n    '83' {write-host \"iOS\"}\n    '84' {write-host \"Android\"}\n    '85' {write-host \"Blackberry\"}\n    '86' {write-host \"Windows Phone 8\/WinRT\"}\n    '87' {write-host \"Windows Mobile\"}\n    '88' {write-host \"Blackberry Playbook\"}\n    '257' {write-host \"HTML5\"}\n    '261' {write-host \"Java\"}\n    '7945' {write-host \"Windows CE\"}\n    '32940' {write-host \"Wyse WinCE\"}\n    '32993' {write-host \"Wyse ThinOS\"}\n    Default {write-host \"unknown\"}\n}\n\n# ICA Latency, Round Trip Time (RTT), Bandwidth, etc.\nGet-WmiObject -Namespace root\\Citrix\\euem -Class Citrix_Euem_RoundTrip \n\n# Username, Client Machine Name, Client Machine IP, Session ID, Passthrough Client Session Id, etc.\nGet-WmiObject -Namespace root\\Citrix\\euem -Class Citrix_Euem_ClientConnect\n\n# ICA Port, SR Port, Protocol details, etc.\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_Network\n\n# Published Name, Encryption, Is Publsihed App, Is HDX Protocol UDP, etc.\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_Sessions\n\n# List Virtual Channel Channels with status\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_VirtualChannel | Where-Object {$_.__Class -notlike \"*_Enum\"} | Select-Object __Class,IsEnabled, IsActive\n\n# List redirected smartcards\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_VirtualChannel_SmartCard_Enum | Select-Object Component_*\n\n# List USB Redirection rules\n(Get-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_VirtualChannel_USB).Policy_RedirectionRules\n\n# VDA version, Farm Name (aka Site Name), Delivery Group Name, License Server, etc.\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_XenDesktop\n\n# Site Name, Delivery Group Name, Machine Catalog Name, Delivery Controller\nGet-WmiObject -Namespace root\\Citrix\\DesktopInformation -Class Citrix_VirtualDesktopInfo\n\n# Graphic protocol details\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_Virtualchannel_thinwire\nGet-WmiObject -Namespace root\\Citrix\\hdx -Class Citrix_VirtualChannel_Framehawk\n\n# VDA parameter details like Delivery Group, Machine Catalog, Delivery Controller, Hypervisor Connection, etc.\nGet-WmiObject -Namespace root\\Citrix\\VdaParameters -Class CitrixVdaParameters\n\n<\/code><\/pre>\n<p>\u00dcber diese Beispiele hinaus gibt es noch einige weitere Namensr\u00e4ume und Klassen mit einer Vielzahl vom Eigenschaften die man abfragen kann. Um alle zu ermitteln kann folgender Codeschnipsel verwendet werden:<\/p>\n<pre><code class=\"language-powershell\"># List all properties of all classes and namespaces below Root\\Citrix\nforeach ($Namespace in Get-WmiObject -Namespace root\\Citrix -Class __Namespace)\n{\n    $Classes = (Get-WmiObject -Namespace root\\Citrix\\$($Namespace.Name) -List | Where-Object {$_.name -like 'Citrix*'}).Name\n    foreach ($Class in $Classes)\n    {\n        Write-Host \"`n### Namespace root\\Citrix\\$($Namespace.Name) and class $Class ###`n\"\n        Get-WmiObject -Namespace root\\Citrix\\$($Namespace.Name) -Class $Class\n    }\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Will man im Benutzerkontext innerhalb einer Citrix Sitzung Information\u00a0 vom Clientrechner ermitteln wie z.B. Client Name, Client IP, Client OS, Version der Citrix Workspace App, etc.\u00a0 so w\u00e4re dies \u00fcber die WMI Schnittstelle m\u00f6glich. Citrix stell diese Informationen im Namespace Root\\Citrix durch entsprechende Klassen zur Verf\u00fcgung. Ich zeige wie es geht.<\/p>\n","protected":false},"author":2,"featured_media":2347,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,37],"tags":[],"class_list":["post-3213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-citrix","category-powershell"],"_links":{"self":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/3213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3213"}],"version-history":[{"count":0,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/3213\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/media\/2347"}],"wp:attachment":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}