2

My requirement is I have to run an application when user logs out from windows. To achieve this I felt that adding a Shutdown script to Group Policy of Windows would be a feasible solution. We normally do it by gpedit.msc. But I want to do it programatically from C#. Any help is highly appreciated.

Thanks in advance.

  • Do you mean local group policy or a group policy object in an active directory domain? Also note that if a user just logs out without shutting down, a shutdown script won't run. – Harry Johnston Aug 24 '12 at 04:09
  • Hi Harry, yes I am aware that, the shutdown script won't run if the User logs out. I just need the same functionality. Can you help me out.. Thanks for your time. – KiranTheWizard Aug 27 '12 at 07:05
  • See http://msdn.microsoft.com/en-us/library/windows/desktop/aa374177%28v=vs.85%29.aspx – Harry Johnston Aug 27 '12 at 20:03

1 Answers1

-1

The use of "gpedit.msc" means we are talking Local GPO so please see my answer here.

Hope this answers your question,

Shaun

Community
  • 1
  • 1
  • Welcome to Stack Overflow! Thanks for posting your answer! Please note that you should post the essential parts of the answer here, on this site, or your post risks being deleted [See the FAQ where it mentions answers that are 'barely more than a link'.](http://stackoverflow.com/faq#deletion) You may still include the link if you wish, but only as a 'reference'. The answer should stand on its own without needing the link. – Taryn Oct 30 '14 at 14:10