# Let's add the Citrix Cmdlets to our PowerShell session... Add-PsSnapin Citrix.XenApp.Commands # What commands are available to us now? Get-Command -module Citrix.XenApp.Commands | Group-Object Noun # This brings us to a grand total of... Get-Command -module Citrix.XenApp.Commands | Measure-Object # Lets see what our Farm configuration looks like... Get-XaFarmConfiguration # Forget to set the License Server. We need to add that.. Set-XAFarmConfiguration -LicenseServerName $Env:ComputerName # Now lets add the farm administrators... New-XAAdministrator "$Env:ComputerName\XenApp Administrators" -AdministratorType Full # Lets publish our first application New-XAApplication -ApplicationType ServerInstalled -DisplayName Notepad -CommandLineExecutable "C:\WINDOWS\system32\notepad.exe" -ServerNames $Env:ComputerName -Accounts "$($Env:ComputerName)\Users" # Lets Export our applications Get-XAApplication | Export-Clixml C:\WIndows\Temp\Application.xml # Lets see what is in the file notepad C:\Windows\Temp\Application.xml # Oops, we accidently deleted the application Remove-XAApplication "Notepad" # That is ok, we can recover from backup... Import-Clixml C:\Windows\Temp\Application.xml | New-XAApplication Get-XAApplication | Enable-XAApplication