november 2010 - Posts

[] Citrix XenApp 6.0 - SDK 6.1.2

Hello again,

I have created an application that can read and do a lot of stuff from the application to a farm in Cirtrix XenApp 6.0


But being a programmer and not a C# one, I didn't find what I was looking for on the net... so I wrote it myself.


Here you got the basic required funtion to connect a program to the cirtix XenApp SDK (powershell)


Private Sub GetCitrixInfo()

'Adding the default Runspace to the Form
Dim Runspace As Runspace
Runspace = CitrixRunspaceFactory.DefaultRunspace

'Now we have a runespace we need a pipeline (to send and receive objects from PowerShell)
Dim Pipeline As Pipeline
Pipeline = Runspace.CreatePipeline()

'Creating the command we want to send
'The Name of the Application
Dim GetSessionByApplicationsByName As New GetXASessionByApplicationName

Dim BrowserName As Array
BrowserName = {"*"}

Dim Commando
Commando = GetSessionByApplicationsByName.Command

'Adding the command to the pipeline

'We need to to give a variable which we will use in the Pipe

Dim results As Collection(Of PSObject)
results = Pipeline.Invoke()

'Now our variable will be filled by PowerShell objects, we need to translate them to .NET object

Dim app As PSObject
Dim allowedUsers As Dictionary(Of String, User)

For Each app In results
'app' is an instance of PSObject

Dim xaSession As XASession
xaSession = app.BaseObject

Dim item As New ListViewItem

Catch ex As Exception

End Try
End If


'Autosize Columns in the Listview
For Each column As ColumnHeader In Me.SessionListView.Columns
column.Width = -2

progressBar.Style = ProgressBarStyle.Blocks

End Sub


If you have more question on the subject, just ask ! :)