Citrix useful commands
- Enable Citrix powershell snap-ins for XenDesktop/XenApp 7.6:
Add-PSSnapin Citrix.*.Admin.V*
- Enable Citrix powershell snap-ins for XenApp 6.5:
Add-PSSnapIn citrix.xenapp.commands
Add-PSSnapIn citrix.common.Commands
Add-PSSnapIn citrix.common.groupPolicy
- To get a listing of all your XenApp 6.5 servers:
get-xaserver | select servername > c:\temp\XenApp_VM_list.txt
- To get a listing of XenDesktop logged in users:
get-brokersession | select UserName > c:\temp\logged_in_users.txt
- To get a listing of ALL XenDesktop/XenApp 7.6 VMs:
get-brokermachine -maxrecordcount 2000 | select machinename > c:\temp\VM_list.txt
- To send a reboot notification message to a specific desktop group on XenDesktop/XenApp 7.6:
Add-PSSnapin citrix*
$sessions = Get-BrokerSession -MaxRecordCount 5000 | Where {$_.desktopgroupname -match "Virtual Desktop Group 1"}
Send-BrokerSessionMessage $sessions -MessageStyle "Information" -Title "REMINDER: Virtual Desktop Reboot @ 11 PM" -Text "REMINDER: Virtual Desktops will be rebooted Saturdays @ 11 PM. Please save your work and logoff prior to this when you go home for the day. If you work from home you will be logged off at 11 PM but can immediately log back in after the 11 PM reboot."
- To get a list of all published applications being used along with associated user names in a XenApp 7.x environment:
Add-PSSnapin Citrix.*.Admin.V*
get-brokersession -maxrecordcount 20000 | select ApplicationsInUse, DesktopGroupName, UserName, UserUPN, ClientName, ConnectedViaIP, AppState, EstablishmentTime | Sort-Object ApplicationsInUse > c:\temp\citrix-apps-launched-right-now.txt
credit: jasonsamuel
Comments
Post a Comment