Solved

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

Posted on 2012-12-25
5
712 Views
Last Modified: 2013-01-18
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)

{

}
0
Comment
Question by:ksd123
[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
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Yagya Shree
ID: 38720201
0
 

Author Comment

by:ksd123
ID: 38720601
Hi,

I am looking for c# code.
0
 
LVL 13

Expert Comment

by:Yagya Shree
ID: 38720739
0
 

Accepted Solution

by:
ksd123 earned 0 total points
ID: 38772444
I think the only option to get  current logon deails on remote server  is to create a webservice and host it on the remote server - This webservice has methods for creating event log entries. We need to pass the logged in user information to the webservice which will create the events
0
 

Author Closing Comment

by:ksd123
ID: 38792313
Did not get any relevant answer to my question and to my knowledge the above solution will resolve the issue
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display

749 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