• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3640
  • Last Modified:

Google Chrome - Wipe history via GPO

We need to reduce the amount of space taken up in roaming profiles.
I am curious about the "SavingBrowserHistoryDisabled" setting in the ADMX for Google Chrome.

From the description, it looks like the user isn't able to retain any history at all during their session.
I am envisioning some kind of issue where a website needs to store something during a session.
Does this setting cause problems like that? (looking for answers from those who have used this setting before)

Is there a better setting to use that will wipe Chrome history on browser exit or computer logoff?
0
Paul Wagner
Asked:
Paul Wagner
  • 7
  • 7
1 Solution
 
Tim BerryCommented:
How I understand it,  I think the history is just that.... a log file of where you have been and when.

When the browser needs to save something during a session, most of them use cookies I believe.

I use the setting on browser exit to wipe my tracks.  So others that use my pc/account cant see where I have been. I have had no issues with with data that web sites need to store during session.
0
 
McKnifeCommented:
To save space, one deletes the browser cache, not the history.
Use a script:
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\Media Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\File System" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\Application Cache\Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Profile 1\Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Profile 1\Media Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Profile 1\File System" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Profile 1\Application Cache\Cache" /d -14 /S /c "cmd /c del @file /s /q

Open in new window

This deletes chrome's crap that is older than 14 days. We run it using a scheduled task every day, you could trigger it to run at logon for example with a 1 minute delay, so no one will be bothered. Tasks can be deployed by GPO.
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
@Tim - Good clarification. I meant to talk about disk cache and not history/cookies.

@McKknife - Where would I put you code in my existing script? Before goto END?

@echo off
if %os%==Windows_NT goto WINNT
goto NOCON

:WINNT
echo .Using a Windows NT based system
echo ..%computername%

echo Delete Google Earth Cache
del /q /f /s "%USERPROFILE%\AppData\LocalLow\Google
echo deleted!

goto END

:NOCON
echo Error...Invalid Operating System...
echo Error...No actions were made...
goto END

:END

Open in new window

0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
McKnifeCommented:
Yes, why not.
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
Does running it like you have it cause problems 14 days later?
Ex: A user has their password/session/"whatever" saved on a website. Now that 14 days has passed since they first set it up, the "whatever" is gone and they have to do it over again?
0
 
McKnifeCommented:
Website passwords are not cleared. "Sessions saved on websites" - now what should that be? You need to be more specific. We have been using this for years with all our users - no complaints at all.
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
Passwords sticking around is actually a good thing.

Maybe I worded the question incorrectly. No matter to pursue the issue. I wanted to know if there were any outlying issues and you have answered that.

I'll run a test on it today and see how it goes.
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
Why do you think it's better to run this particular script at logon rather than logoff? Is there a benefit to doing it that way?
0
 
McKnifeCommented:
You'd use task scheduler. T.S. knows logon triggers as well as delayed start. It won't be noticed when started delayed. T.S. does not know logoff triggers.
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
Gotcha. I'm looking to run the script via GPO. Any benefit to using one over the other?
0
 
McKnifeCommented:
Since the deletions will not take forever (at least not after it had run for the first time), it is all the same. Logon, logoff, do whatever you like.
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
- The "Cache" folder in "Default" that you listed does show for most of my users, but it does on a few.
- File System doesn't seem to take up any space, really. What was the reason for adding it?
- Profile 1 folder does not show in my computer or for any end users in the VDI.
- I added JumpListIcons and JumpListIconsOld since they take up a good amount of space.

How do I modify it to not wait 14 days? I want to delete the data regardless of age.
Would it be "/d -0"?
The issue we face is that people just disconnect from the VDI and never log off.

Would I do this?
del /q /f /s "%USERPROFILE%\AppData\Google\Chrome\User Data\Default\Media Cache"

Here is what I have now for the script:
@echo off
if %os%==Windows_NT goto WINNT
goto NOCON

:WINNT
echo .Using a Windows NT based system
echo ..%computername%

echo Delete Google Chrome Cache
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\Media Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\File System" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\Application Cache\Cache" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\JumpListIcons" /d -14 /S /c "cmd /c del @file /s /q
forfiles /p "%localappdata%\Google\Chrome\User Data\Default\JumpListIconsOld" /d -14 /S /c "cmd /c del @file /s /q
echo deleted!

goto END

:NOCON
echo Error...Invalid Operating System...
echo Error...No actions were made...
goto END

:END

Open in new window

0
 
McKnifeCommented:
Cache folder -  Leave it in the script, it will eventually be created.
-File System can take up space after people do certain downloads. I have seen GBs in there.
-Profile 1 is only used if people use chrome with different profiles - experts do. Non-experts don't even know how.
-Jumplisticons - why not.

14 days: yes, the number 14 stood for the 14 days. Setting it to zero makes no sense as this is a cache. Deleting cache files immediately is against the logic of a cache. A cache is used so that people don't download files over and over.
"The issue we face is that people just disconnect from the VDI and never log off" - ok, then deploy a scheduled task that runs at a certain time of the day and use the user that is currently logged on as executor as seen here:
Screenshot
0
 
Paul WagnerFriend To Robots and RocksAuthor Commented:
I changed the time to 5 days. We want to cut down on space usage as much as possible, but I do see your point about retaining a cache.
We will forego using task scheduler as this will likely cause grief with users who leave documents and web tabs open. Knowing my environment and people, they would be upset to find we logged them off.

I've tested the script on a few test accounts and it is working great. Thanks for all of your help!
0
 
McKnifeCommented:
You're welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now