Solved

VB.Net Automatically killing processes that have not closed properly

Posted on 2015-01-28
1
131 Views
Last Modified: 2015-01-28
Hi Experts.  On our terminal servers, we often have processes that have hung or not closed properly.   Does anyone know of a way to identify processes that are not live, "owned" or have been running for hours, and a way of killing them?  There are some programs that have known issues on Terminal Server and writing something would save us having to go into the server and kill the processes.  Thanks in advance
0
Comment
Question by:PNRT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
ChloesDad earned 500 total points
ID: 40575903
To get an array of all the process do this

         ' Get all processes running on the local computer. 
         Dim localAll As Process() = Process.GetProcesses()

Open in new window


The process class has properties, Kill, which kills the process, Responding which indicates if the UI is responding, and starttime, which you can use to work out how long the process has been running.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The reason that corporations and businesses use Windows servers is because it supports custom modifications to adapt to the business and what it needs. Most individual users won’t need such powerful options. Here I’ll explain how you can enable Wind…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question