Solved

User of a process

Posted on 2006-11-15
8
164 Views
Last Modified: 2010-04-23
Hi experts

I have a small program in vb.net that checks if a process is running in a computer I would like to be able to know which user is running that process if I could get some help with that I’ll be really grateful.
 

Thanx one more time experts.
0
Comment
Question by:Stendor
  • 4
  • 4
8 Comments
 
LVL 6

Accepted Solution

by:
riyazthad earned 450 total points
ID: 17951347
Imports System.Diagnostics

  Dim pr As New Process
        pr = Process.GetCurrentProcess
        Dim s As String = pr.MachineName
0
 
LVL 1

Author Comment

by:Stendor
ID: 17951935
Thanx for your answer but I get a "."
if I try this instead of getting the username or the machine name

TextBox2.Text = s.ToString
0
 
LVL 6

Expert Comment

by:riyazthad
ID: 17957095
you created a program and you are running from your machine. Then it will return only ur machine name. I guess dot means current machine.

What is your ultimate aim?

0
 
LVL 1

Author Comment

by:Stendor
ID: 17957304
what I want is to check in my terminal server wich user or computer is using what process

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:riyazthad
ID: 17957424
Why you dont use System.Security.Principal.WindowsIdentity.GetCurrent.Name

each time user start your process from remote machine, u can just copy to a text file in server or database.

Is that what u want?
0
 
LVL 1

Author Comment

by:Stendor
ID: 17957521
Let me be more specific I have an application on a server and some stations connect to this server with their own session I need to check if they are running the application if not I want to start it.
0
 
LVL 6

Expert Comment

by:riyazthad
ID: 17958854
0
 
LVL 1

Author Comment

by:Stendor
ID: 17964909
thanx you show me the way and gave me some good ideas thanx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now