Use PowerShell to schedule a batch end of the Citrix Xen App Session

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.