< -- BuySellAds Ad Code ALLEN -->
  • Home
  • General
  • Delete Cookies On Workstation When User Logs Off VIA GPO
Microsoft Logo

Delete Cookies On Workstation When User Logs Off VIA GPO

IT Problem

When you users on your network log off you want to delete all the local cookies so that the system is more secure with passwords etc. This can be done with a batch file that is called during the log off process.Delete cookies via gpo

IT Solution

Ok so first of all create a file called deletecookies.bat and then copy the text below into it. These commands clear all the local cookies.

@ECHO OFF
ECHO Removing all cookies from local machine
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
ECHO Cookie removal complete!

 

The copy the batch file on your domain controller to C:\Windows\SYSVOL\domain\scripts

Once done  you now need to create a group policy and modify the log off option to point to your script.

It can be found here. User Configuration>Windows Settings>Scripts (Logon/Logoff) > Logoff

 

now when a user logs off all the cookies are deleted.

Tags: Group Policy

Allen White

Allen is an IT Consultant and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5, 6 and HP ASE, AIS - Network Infrastructure.

Comments (1)

  • Avatar

    Bill

    |

    FYI – RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 clears the cookies. The other lines clear everything else in IE – temp files, history, etc.

    Reply

Leave a comment

Categories

Vote!

What Web Browser Do You Use?

View Results

Loading ... Loading ...

Vote!

What do you prefer..VMware or Hyper-V?

View Results

Loading ... Loading ...