Jump to content

.bat Script to delete Chrome stored passwords.


Recommended Posts

Posted (edited)

As per the title, I have just got around to disabling password manager in Chrome ADMX via GPO (turned off the 'Offer to save passwords', but still trying to turn off auto-sign in - if anyone knows the GPO?).

 

I've also turned off the 'Allow sign-in', 'Sync' option and the 'Guest Window' and 'Manage People'... seems like their is a fair bit to deal with in Chrome (if anyone has a safe browsing/school friendly GPO template/settings list that would be handy)!

 

Anyway, I have just found that the children have already been saving passwords and I would like to delete them from each machine. Unfortunately these are stored in the AppData for each user. Using a log-on script for the user fails, possibly as they don't have permissions/access to that folder...

 

Running this as a .bat

 

del "%LocalAppData%\Google\Chrome\User Data\Default\Login Data" /q

 

Can't run a start-up script as it would need to know each user wouldn't it?

Edited by Koldov
Posted
Out of curiosity, what is the need behind this? Surely teaching students to use a password manager (even if just one in a browser) is a good thing? Or is it a shared account?
Posted (edited)
Out of curiosity, what is the need behind this? Surely teaching students to use a password manager (even if just one in a browser) is a good thing? Or is it a shared account?

 

Yeah, exactly that... Unfortunately it is for the early years group that have shared class log-ins.

Edited by Koldov
Posted
In that case, just run a startup script that deletes them from all the shared user account folders (I'm guessing there can't be that many). If there's a pattern, even better - can use PowerShell and reduce repetition.
Posted
In that case, just run a startup script that deletes them from all the shared user account folders (I'm guessing there can't be that many). If there's a pattern, even better - can use PowerShell and reduce repetition.

 

There are only 12 classes.

 

This is the current 1 line script:

 

del "%LocalAppData%\Google\Chrome\User Data\Default\Login Data" /q

 

Not got any Powershell skillz, so any scripting advice gratefully received...

 

But if not, a .bat file something like this that explicitly names each 'user' ?

 

del "C:\Users\CLASS NAME HERE\AppData\Local\Google\Chrome\User Data\Default\Login Data" /q

del "C:\Users\CLASS NAME HERE\AppData\Local\Google\Chrome\User Data\Default\Login Data" /q

del "C:\Users\CLASS NAME HERE\AppData\Local\Google\Chrome\User Data\Default\Login Data" /q

del "C:\Users\CLASS NAME HERE\AppData\Local\Google\Chrome\User Data\Default\Login Data" /q

del "C:\Users\CLASS NAME HERE\AppData\Local\Google\Chrome\User Data\Default\Login Data" /q

 

etc....

Posted
Not got any Powershell skillz, so any scripting advice gratefully received...

PowerShell version...

 

Remove-Item -Path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Login Data" -Force -ErrorAction SilentlyContinue

Posted
PowerShell version...

 

Remove-Item -Path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Login Data" -Force -ErrorAction SilentlyContinue

 

Note that this will delete all users' login data, including (e.g.) teachers and individual student accounts, which may not be what you want. If not, I'd use the individual version above.

  • Thanks 1
Posted
Note that this will delete all users' login data, including (e.g.) teachers and individual student accounts, which may not be what you want. If not, I'd use the individual version above.

Good point! I had assumed students and teachers would be using different computers.

 

Here's a better version... :)

 

$Users = Get-ChildItem -Path "C:\Users" -Directory | Where Name -like "[color="#FF0000"]Class-4*[/color]"
$Users | ForEach { Remove-Item -Path "$($_.FullName)\AppData\Local\Google\Chrome\User Data\Default\Login Data" -ErrorAction SilentlyContinue }

  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...