Thursday, 22 August 2013

LogOff disconnected users from remote desktop

LogOff disconnected users from remote desktop

Firstly I'm new to this..Excuse me If something might asked here is not
appropriate.
I would like to find out the disconnected users and then make all of them
logOff at once from my windows app.
This is what I have found here
Can anyone say how do I use this and from where ?
Or any other alternative is the best option to do ?
As when I'm trying this way :
ExecuteCommand("TSDISCON 31 /SERVER:myservername /V")
Public Sub ExecuteCommand(ByVal Command As String)
Dim ProcessInfo As ProcessStartInfo
Dim Process As Process
ProcessInfo = New ProcessStartInfo("cmd.exe", "/K" & Command)
ProcessInfo.CreateNoWindow = True
ProcessInfo.UseShellExecute = True
Process = Process.Start(ProcessInfo)
End Sub
It gives me an error that session Id 31 is not found and when checked it
is showing me the session id 31 is there in the task manager as you can
see it below.
http://imageshack.us/photo/my-images/443/elhs.png/
Sorry as I'm having low rep I couldnt post images here infact proving a link.

No comments:

Post a Comment