Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Seniors,

I have developed a program to collect system login and logout informations from Windows Event logs.

This program creates a text file on local & server machine.

It's working fine with my Windows system that has enough Admin rights.

But when i run my application on another Windows computer (exe - copied and pasted) it requires 'Administrator Password'. then it's working fine.

The problem is, we have nearly 100 machines in a Domain and we need to collect Logs from the same for 200 users working on 100 machines.


Thanks,
Rajan.
Posted
Updated 13-Aug-14 3:45am
v3
Comments
Maciej Los 13-Aug-14 9:26am    
Yes, you do.

If this is a genuine program, I would suggest looking at a windows service program. This can then be set to run with sufficient privileges to access the event log and do what you need to do.

Then you just need a method of deployment, so companies use Group Policy managed deployment to deploy software, or you need to go around each machine, login as an administrator and install the service.

An alternative to the service approach is to create a Scheduled task that runs as an administrator on each machine, again I believe (although I'm not certain) this is something that can be deployed by scripting/Group Policy. The scheduled task then just runs your program at the required frequency.
 
Share this answer
 
In Windows, there is a feature called UAC (User Access Control), what will prompt the user if the program is accessing informations that need higher rights than standard user.

If the program is running as a part of Group Policy Login script in Windows, it will have Local Administrator rights and will be able to get informations that need higher rights, then a standard user.
 
Share this answer
 
Comments
NPSSR 14-Aug-14 4:23am    
Is this task can be done using "Microsoft.Win32.SystemEvents" is the best alternative way? Or any disadvantages with this.? Please advise.!
Kim Togo 14-Aug-14 4:35am    
Hi.
Microsoft.Win32.SystemEvents will not work, SystemEvents event like SessionSwitch is only for current logged in user.
And the current user has no admin rights.

Alternative method is to use Windows Task Scheduler, if it is Windows 7 or Windows 8. Task can run when any user logged on and you can define what security rights that Task runs under.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900