Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Question about Citrix Powershell

$
0
0

I am attempting to write a powershell script that will log off the oldest of duplicate connected session.  The part that I am stuck at, is getting to the point to log off the duplicates.

Here is what I have:

Add-PSSnapin Citrix.* –erroraction SilentlyContinue

foreach ($session in Get-XASession -Full | Group-Object ClientName | ? { $_.Count -gt 1 })
{
    write $session

    
}

With the above code, it will group the duplicate users (there are probably 3 or 4 different duplicates).  How would I take generated information, create an array  of just the grouped items and then compare the Log on time (this is retrieved from $session.LogOnTime) to log off the oldest (Stop-XASession $session.SessionId)?

Any help would be very much appreciated.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>