473,378 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to kill a terminal server session (VB.NET)

Hi,
Is there a way to kill a Terminal Server session from vb.net?
I have to constantlly access our servers to reset ureser that get hung. I
would like to have a web interfave that I can access via my PDA/Phone. It
dose not have to be a wab page that does this. I could write to a queque
that is read by a windows servrice on the TS server and then reset the user.

Thanks.
George.

May 10 '06 #1
2 2623
You would probably be using the functions in wtsapi32.dll. Terminal services
can also be accessed through WMI
http://msdn.microsoft.com/library/de...er_classes.asp
but I am not sure if all of the functionality is exported.

Cheers,

Greg Young
MVP - C#
"George Lake" <g@lake.com> wrote in message
news:Op**************@TK2MSFTNGP03.phx.gbl...
Hi,
Is there a way to kill a Terminal Server session from vb.net?
I have to constantlly access our servers to reset ureser that get hung. I
would like to have a web interfave that I can access via my PDA/Phone. It
dose not have to be a wab page that does this. I could write to a queque
that is read by a windows servrice on the TS server and then reset the
user.

Thanks.
George.

May 10 '06 #2
pinvoke.net has some good info under wtsapi32 including examples of getting
sessions WTSEnumerateSessions
http://www.pinvoke.net/default.aspx/...merateSessions, getting
session info WTSQuerySessionInformation
http://www.pinvoke.net/default.aspx/...ionInformation, and
logging off a session WTSLogOffSession
http://www.pinvoke.net/default.aspx/...merateSessions

Cheers,

Greg Young
MVP - C#

"Greg Young" <Dr*************@hotmail.com> wrote in message
news:ua**************@TK2MSFTNGP02.phx.gbl...
You would probably be using the functions in wtsapi32.dll. Terminal
services can also be accessed through WMI
http://msdn.microsoft.com/library/de...er_classes.asp
but I am not sure if all of the functionality is exported.

Cheers,

Greg Young
MVP - C#
"George Lake" <g@lake.com> wrote in message
news:Op**************@TK2MSFTNGP03.phx.gbl...
Hi,
Is there a way to kill a Terminal Server session from vb.net?
I have to constantlly access our servers to reset ureser that get hung. I
would like to have a web interfave that I can access via my PDA/Phone. It
dose not have to be a wab page that does this. I could write to a queque
that is read by a windows servrice on the TS server and then reset the
user.

Thanks.
George.


May 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Maher K. Al-Jendasi | last post by:
Hello All, I have developed a .NET application, and I deployed the application to my server, when I go to the server and log into it the application runns correctly without any problems, even if...
2
by: Hans | last post by:
I am using Process.GetProcessesByName("SomeName") in my app and it workes on most windows platforms. On most - it does not work in a terminal server session on a Windows 2003 server. Although the...
1
by: mwolf | last post by:
I have an application written in c$ that needs to be run in 3 different terminal server sessions on a windows 2003 server. Everything will work fine for about an hour, after this point the...
0
by: Robert Jenkins | last post by:
I am trying to send a string of data to a remote Terminal Server session via the ActiveX client. I can start the session login or logout okay but I can't send data very well. I can send any data...
8
by: OHM | last post by:
Hi peoples, I dont know where to place this question, so as I know you guys are all resourceful experts, I thought I would try here. I am writing some code which will be run usingh remote...
2
by: Oenone | last post by:
Is it possible to detect whether my application is running within a Terminal Server session or not? I'd like to automatically switch off some of my graphics rendering under this environment as...
2
by: George Lake | last post by:
Hi, Is there a way to kill a Terminal Server session from vb.net? I have to constantlly access our servers to reset ureser that get hung. I would like to have a web interfave that I can access via...
1
by: Bill Nguyen | last post by:
One of my apps (running in a terminal server session) needs to access a local USB drive /fash card. Is there a way to access local drives programmatically? Thanks Bill
0
by: aliman | last post by:
Hi All, Coding in C#.Net 2.0 A requirement of my app is that certain functions should not be allowed to execute if excel is running. The app is used in terminal server sessions so checking if...
0
by: ofer1 | last post by:
I have user with 3 open session in disconnected state on the same server. I have the sessionid for each remote session with 'qwinsta' command. Is it possible to reconnect to specific session by...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.