This message was deleted.
# citrix-vad
s
This message was deleted.
a
WSA?
r
Workspace App
Got this from one of the Citrix guys. Works for me, but ymmv. Not documented/supported solution.
Copy code
$src = @'
using System;
using System.Runtime.InteropServices;
public static class Win32 {
    public static uint WM_ENDSESSION = 0x0016;
    public static IntPtr One = new IntPtr(0x1);
	[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
    public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
    public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
}
'@
Add-Type -TypeDefinition $src
[Win32]::SendMessage([Win32]::FindWindow("ReceiverMessageClass", "ReceiverMessageWindow"), [Win32]::WM_ENDSESSION, [Win32]::One, [Win32]::One)
@Aaron Parker ^---
a
Wow, that’s quite the approach - is that to ensure it closes cleanly and doesn’t leave a running session on the remote end?
Obviously
Stop-Process
isn’t what you were looking for?
r
Well, WSA is like 10 processes, right? Authman, SelfService.exe, wfica, etc etc.
and yes, exactly, to make sure it closes fully, cleanly, and completely.
a
Makes sense, I didn’t think of the additional processes.