Jump to content
Welcome to our new Citrix community!
  • 0

Check if EDT / UDP is active via Powershell


Dennis Schierenbeck

Question

Hello together,

 

I would like to create a report of the users using EDT over UDP and the users using the TCP fallback.

I can see that information on the Details Tab inside the Director, but I can't find this information via Powershell.

 

In the Get-BrokerSession I can find the protocol (HDX), but not the uses network protocol.

 

Do somebody know how to get this information for all active sessions (via PowerShell)?

 

Thanks for your help.

Link to comment

3 answers to this question

Recommended Posts

As noted in the script, this isn't exactly what you are asking for in a report, but should get you well on the way to building a report yourself with the information gathered from the sessions. My script only notifies me if a specific user account is connected via TCP rather than UDP (EDT), indicating an issue with the server and EDT connections.  Using the informatoin from the IF statement you should be able to modify and create a report that suits your needs though.  (Obviously this isn't the entire script...but just a sample bit to get you going.)

 

#Get the users you are looking to report on...filter optional of course.
$users = get-brokersession -DesktopGroupName "DGNAME" -AdminAddress "DCNAME" | Where { $_.ClientVersion -gt 14.8 -and $_.SessionState -eq "Active" -and $_.UserName -like "*\somethingifdesired*" }

foreach ($u in $Users) 
{
 #if find a user that should be EDT but is running TCP, send notification.
 #This isn't exactly what you want, but has the basics to pull EDT vs. TCP connections and you can build from there.
    if((invoke-command -ComputerName $($u.DNSName) -ScriptBlock { param($Session) (ctxsession -s $Session ) } -ArgumentList ((quser $($u.UserName.Split("\")[1]) /server:$($u.DNSName) | Findstr -i $($u.UserName.Split("\")[1])) -replace '\s+', ' ').Split(" ")[3]).Split(" ")[4] -like "*TCP") 
    {
        Write-ToSFLauncherLog "Sending notification of issue discovered  User: $($u.UserName)"
        $MessageText = " server: $($u.DNSName) - User: $($u.UserName)"
        $MessageSubj = " server: $($u.DNSName)"
        $XenAppTo = "xxx@domain.com"  

        Send-MailMessage -Body $MessageText -From $global:FromAddress -To $XenAppTo -Subject $MessageSubj -SmtpServer $global:SMTPServer
    }
}

 

This is some testing script that I saved as I was creating the final version above which may make it easier to understand what I was thinking/doing to get the information:

#Get the users you are looking to report on...filter optional of course.
$users = get-brokersession -DesktopGroupName "DGNAME" -AdminAddress "DCNAME" | Where { $_.ClientVersion -gt 14.8 -and $_.SessionState -eq "Active" -and $_.UserName -like "*\somethingifdesired*" }

foreach ($u in $Users) 
{
    $un = $u.UserName.Split("\")[1]
    $Server = $u.DNSName
    quser $un /server:$Server | Findstr -i $un
    $SessionID = ((quser $un /server:$Server | Findstr -i $un) -replace '\s+', ' ').Split(" ")[3]
    $Sessions = invoke-command -ComputerName $Server -ScriptBlock { (ctxsession) }

    ForEach ($s in $Sessions) 
    {
        $Line = $s.Split(" ")
        If($Line[1] -eq $SessionID) 
        {
            $Protocol = $Line[3]
        }
    }
    if($Protocol -like "*TCP") 
    {
        Write-Host Send Email Here.
        $un
    }
}

 

Link to comment

Hi Dennis,

 

Thanks a lot for your help!

 

Your script helped me to create a script to generate a report which user is using which Protocol (TCP/UDP).

 

Nice Workaround to get this Information from the ctxsession command!!

 

It is not the fastes one and I think it will rund a while for my 2.000 users, but it works!!!

 

@Citirx: Why is it not possible to get this Information directly from the PowerShell, you are showing this Information in the Director, so this Information should be already availble.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...