Home » Questions » Computers [ Ask a new question ]

Create a logoff script/task for Windows

Create a logoff script/task for Windows

Without using AD GPOs (Active Directory Group Policy Objects), or similar, how would one go about creating a logoff script for Windows?

Asked by: Guest | Views: 260
Total answers/comments: 2
Guest [Entry]

"In the Run box type gpedit.msc and hit enter. This will open the Group Policy editor. This will allow you to edit the kind of things normally managed by an AD Policy directly on the local machine.

Under Windows Settings there is a Scripts (Startup/Shutdown) option where you can specify Startup and Shutdown scripts."
Guest [Entry]

"The two previous answers explain how to execute scripts on startup/shutdown.

The answer to the actual question asked (logon/logoff) is to create a windows task scheduler task where you tie the trigger to be ""On connect/disconnect from user session"" instead of a more familiar scheduled time or date.

Run taskschd.msc --> create task --> Triggers --> New --> ""On connection to user session"" ..."