Skip to content

Instantly share code, notes, and snippets.

@belotn
Created September 10, 2013 13:24
Show Gist options
  • Save belotn/6509348 to your computer and use it in GitHub Desktop.
Save belotn/6509348 to your computer and use it in GitHub Desktop.
Get XenApp Server Role
$Branch='LocalMachine'
$SubBranch="SOFTWARE\Wow6432Node\Citrix\IMA\RUNTIME"
get-xaserver | select ServerNAme,@{N="Session-Only";E={
$registry=[microsoft.win32.registrykey]::OpenRemoteBaseKey($branch,$_.servername)
$registrykey=$registry.OpenSubKey($Subbranch)
@{$true="Controller";$false="Worker"}[$registrykey.GetValue("WorkerRole") -eq 0]
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment