b2ap3_thumbnail_1024px-Chrome_Logo.svg.png

This is my code used in a SCCM/Windows enviroment To remove any installed version of Chrome and Also remove Profile Data in Roaming Profiles.

The following code can be ran in a bat file in SCCM

@echo off
wmic product where "name like 'Google Chrome'" call uninstall /nointeractive

The following code can be ran after the uninstall, just run this ps1 script on an Administrator PC with access to the roaming profile share's which have all users roaming profiles stored . You will need to adjust directory's to match your environment. Save the following script as Chrome.ps1, you can then call this in CMD prompt using command powershell "C:\Chrome.ps1"

$users = Get-ChildItem Y:\StaffProfiles

foreach ($user in $users){

$folder = "C:\Profiles\" + $user + "\Google"       #Location of Roaming Profiles, Google dictates the name of the google appdata folder
$folder2 = "C:\Chrome\" + $user + "\"                     # Location on where i will be making a backup

Copy-Item -Path $folder -Destination $folder2 -Recurse
Remove-Item $folder -Recurse -Force -ErrorAction silentlycontinue         #Deletes after copy