Solved

Google Chrome - Wipe history via GPO

Posted on 2016-10-12
15
61 Views
Last Modified: 2016-10-28
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
Comment
Question by:Paul Wagner
  • 7
  • 7
15 Comments
 
LVL 1

Expert Comment

by:Tim Berry
Comment Utility
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
 
LVL 53

Accepted Solution

by:
McKnife earned 500 total points
Comment Utility
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
 
LVL 3

Author Comment

by:Paul Wagner
Comment Utility
@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
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
Yes, why not.
0
 
LVL 3

Author Comment

by:Paul Wagner
Comment Utility
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
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
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
 
LVL 3

Author Comment

by:Paul Wagner
Comment Utility
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 3

Author Comment

by:Paul Wagner
Comment Utility
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
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
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
 
LVL 3

Author Comment

by:Paul Wagner
Comment Utility
Gotcha. I'm looking to run the script via GPO. Any benefit to using one over the other?
0
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
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
 
LVL 3

Author Comment

by:Paul Wagner
Comment Utility
- 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
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
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
 
LVL 3

Author Closing Comment

by:Paul Wagner
Comment Utility
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
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
You're welcome.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Working with spreadsheets can be a daunting task, especially when having to deal with large amounts of data. All you see are rows and rows of numbers and soon your eyes begin to glaze over. Take advantage of the tools in Google Sheets to create prof…
OfficeMate Freezes on login or does not load after login credentials are input.
This Micro Tutorial will introduce a Google tool, which is a great way to learn more about dimensions in metrics in Google Analytics, even if you use the interface or the API.
This Micro Tutorial demonstrates in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now