Very simple, Citrix with the PowerShell module, although the use of some inexplicable error ...
The demand for this scenario is to end each day with a xasession that is open to users other than a certain user, Logoff+sessionid cannot judge the user name. A look at the PowerShell module is snapin.
The script is as follows:
Add-pssnapin "Citrix.XenApp.Commands" get-xasession | where {$_. Accountname-ne "DOMAIN\username"} | Stop-xasession
Get-xasession comes with some restriction parameters, such as-servername specifies the name of the server-browsername the specified application.
As a good XenApp administrator, it is important to learn about this PowerShell command, like VMware's powercli.
Then save to a path such as C:\script\killsession.ps1 file, build a scheduled task, execute program write powershell.exe parameter write –file c:\script\ Killsession.ps1, executed 5 o'clock in the morning every day. Get!
This article is from the "Castamere Rainy season" blog, be sure to keep this source http://sodaxu.blog.51cto.com/8850288/1554548
Use PowerShell to schedule a batch end of the Citrix Xen App Session