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(servicen ame,machin ename)
sc.start();
}
catch(exeception ex)
{
}
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(servicen
sc.start();
}
catch(exeception ex)
{
}
ASKER
Hi,
I am looking for c# code.
I am looking for c# code.
Here they are
Monitor and Manage Services on Remote Machines
http://www.codeproject.com/Articles/36268/Monitor-and-Manage-Services-on-Remote-Machines
Check if a process is running on a remote system using C#
http://stackoverflow.com/questions/865412/check-if-a-process-is-running-on-a-remote-system-using-c-sharp
C# Service Status On Remote Machine
http://stackoverflow.com/questions/6866104/c-sharp-service-status-on-remote-machine
Monitoring and Controlling the Service
http://roque-patrick.com/windows/final/bbl0175.html
Monitor and Manage Services on Remote Machines
http://www.codeproject.com/Articles/36268/Monitor-and-Manage-Services-on-Remote-Machines
Check if a process is running on a remote system using C#
http://stackoverflow.com/questions/865412/check-if-a-process-is-running-on-a-remote-system-using-c-sharp
C# Service Status On Remote Machine
http://stackoverflow.com/questions/6866104/c-sharp-service-status-on-remote-machine
Monitoring and Controlling the Service
http://roque-patrick.com/windows/final/bbl0175.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Did not get any relevant answer to my question and to my knowledge the above solution will resolve the issue
Refer to below posts
Quick-Hits: Find currently logged on users
http://learn-powershell.net/2010/11/01/quick-hit-find-currently-logged-on-users/
PowerShell Script To Retrieve the Logged On User For A Remote Machine
http://www.myitforum.com/articles/1/view.asp?id=11217
PowerShell script to find status of service on a remote computer
http://www.pixelchef.net/powershell-script-find-status-service-remote-computer
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/c3459e6c-1e5e-409f-b654-76014a456d04/
http://apprepack.blogspot.in/2012/07/get-status-of-service-on-remote-machine.html
http://learn-powershell.net/2012/01/15/startingstopping-and-restarting-remote-services-with-powershell/