Link to home
Start Free TrialLog in
Avatar of ksd123
ksd123

asked on

How do I get log details (current logon user /machine name) on remote server in window application?

Hi ,

We have a developed a windows application using c# to start/stop/execute a service (windows service written in .Net) on a remote server.

I need to maintain log information for the current logon user who started /stopped/executed the service on the remote server.That means on the remote server we need details(current logon user who invoked the service) in the  event viewer . How can I achieve this?

Basically we have 3 buttons for start,stop,execute functions and below is simplified piece of code and need to maintan user log information(machine name/current logon user)  on remote server Event viewer.

//  start / stop / execute buttons

try

{

servicecontroller sc =new servicecontroller(servicename,machinename)

sc.start();

}

catch(exeception ex)

{

}
Avatar of ksd123
ksd123

ASKER

Hi,

I am looking for c# code.
ASKER CERTIFIED SOLUTION
Avatar of ksd123
ksd123

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ksd123

ASKER

Did not get any relevant answer to my question and to my knowledge the above solution will resolve the issue