asked onย
ASKER
ASKER
$user = Read-Host "Enter user name (in domain\user format)"
$application = Read-Host "Enter published application to log off"
Add-PSSnapIn Citrix*
$sessions = Get-BrokerApplicationInstance | ? {$_.applicationName -eq $application -and $_.username -eq $user}
if ($sessions.Count -gt 0)
{
Write-Host "The following sessions will be logged off:"
$sessions | Select Username, MachineName, ApplicationName | ft -auto
$confirm = Read-Host "Do you wish to continue? (Y/N)"
if ($confirm -eq 'Y')
{
Foreach ($session in $sessions)
{
Stop-BrokerSession $session.SessionKey
}
}
}
else
{
Write-Host "There are no sessions matching your criteria."
}
A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.
TRUSTED BY