arcadesdude / BRU

Bloatware Removal Utility, for automating removal of pre-installed, factory bloatware from devices running Windows 7-10 and newer. Silently removes items selected if possible. Preselects common bloatware. Can remove Win10 UWP/Metro/Modern/Windows Store apps and provisioned apps.
MIT License
497 stars 31 forks source link

HP ProDesk 400G6 now come with "Microsoft 365 - en-us" instead of "Microsoft Office 365" #11

Closed jduke-halls closed 3 years ago

jduke-halls commented 3 years ago

First and foremost, thank you for all you do.

We're updating our PCs and the new HP ProDesk 400 G6s we received now come with "Microsoft 365 - en-us" instead of "Microsoft Office 365"

I started with running the BRU with -include "Microsoft 365*" which works, but I'm lazy and button presses are not fun.

I tried running the old .vbs for removing click to run, but that didn't work. There's a new tools that doesn't seem to be automatable here: Office Uninstall Tool via support page: Uninstall Office from a PC (Microsoft Support)

I found this on Reddit: https://www.reddit.com/r/sysadmin/comments/jjtpnp/script_to_silently_uninstall_builtin_office_365/

Awesome, I'm gonna save that as it'll probably also allow removal of Applications other than Office.

I've had to overcome the same Problem with pre-installed office Applications in the past, but I went another route. I got the Office Deployment tool, used the setup.exe from that with a XML config to uninstall all applications:

<Configuration>
<Remove All="TRUE"/>
<Display Level="None" AcceptEULA="TRUE"/>
<Property Name="AUTOACTIVATE" Value="0"/>
<Property Name="FORCEAPPSHUTDOWN" Value="TRUE"/>
<Property Name="SharedComputerLicensing" Value="0"/>
<Property Name="PinIconsToTaskbar" Value="FALSE"/>
</Configuration>

I saved that in an uninstall.xml and execute it from a script with setup.exe /configure uninstall.xml.

Maybe this will be usefull for someone else too. :)

I'll be trying this out. We have 4 more to prep, so hopefully I can get it working in less than 4 tries.

Let me know if you'd like me to pull/merge in a working change on this one when found.

arcadesdude commented 3 years ago

Thanks. Good to know this tool has some use. Send me some logs of those new HPs and I'll add to the default suggested list. Does the default uninstall for the new C2R office uninstall silently? If not I can try the link you sent about the 'DisplayLevel=False' argument. BRU already uses the OffScrub vbs and as far as I know that is still working. I haven't seen any new HP's in a while to test though so send over any logs you have (from c:\BRU) and let me know if it uninstalls silently already when you add that command line argument.

jduke-halls commented 3 years ago

Normally, we delete the BRU folder after the BRU is run. So on this next one, I have added the detection for Microsoft 365 to the special handlers to trigger the C2R Cleanup on "Microsoft 365" into BRU.

Line 874 if ( $Script:progslisttoremove -match "Microsoft\ Office|Microsoft\ 365" ) {

Line 1384 if ( $prog.Name -match "Microsoft\ Office|Microsoft\ 365" ) {

And added "Microsoft Office" to the $specialcasestoremove, as to hit the C2R cleanup, so lines 2100-2103 now read

        "VIP Access",
        "Microsoft Office", # Trial/OEM Versions of MS Office
        "Microsoft 365",
        "Office.Click-to-Run"

It will be run and I'll attach the BRU log when this is done.

jduke-halls commented 3 years ago

Well, Looks like the OffscrubC2R.vbs script did it after adding the Microsoft 365 detection from above. I triple checked everything on this one and my tech who copied the BRU to a Flash Drive didn't include the helpers directory.

/facedesk

I'll generate a pull request from this issue and make the change above.

jduke-halls commented 3 years ago

I forked the BRU and pushed my changes to that fork. Links below: Bloatware-Removal-Utility.ps1 Link to the commit (For diff etc)

arcadesdude commented 3 years ago

Thanks may take me a couple days to review but will likely approve after checking. If you still have any logs for new hp bloatware I'll take them too. Thanks!

jduke-halls commented 3 years ago

EDIT: Too many computers on the desk, copied the wrong one originally 10-May-2021-07-08.log is the proper log

Here is the log from the run on the computer where the C2R script ran successfully. Bloatware-Removal-10-May-2021-07-08.log

arcadesdude commented 3 years ago

Well, Looks like the OffscrubC2R.vbs script did it after adding the Microsoft 365 detection from above. I triple checked everything on this one and my tech who copied the BRU to a Flash Drive didn't include the helpers directory.

/facedesk

I'll generate a pull request from this issue and make the change above.

That's usually how it goes LOL! Your change looks good. Please submit a linked pull request.

Also note when running with the command line option -include you should use . to include everything after the word since it is in Regex at this point (instead of standard wildcard notation). So instead of -include "microsoft 365" you probably meant -include "microsoft 365.*" they both still matched so it's good though.

I'm glad the vbs from MS (OffScrub) still works to remove it. If it doesn't then that DisplayLevel=False command line argument you found on Reddit might be a good alternative or if the vbs ever stops working in the future.

Looking through the log -- thank you for submitting that btw -- So much HP bloatware still. I haven't seen an new HP in a while (mostly dealing with Lenovo's and Dell's these days) but I'm glad the regex matching of ^HP\ . is still matching most of the bloatware. Looks like I'll have to add HPWorkWell, myHP, and HPQuickDrop Windows Store app as well. I might change it to match ^HP. (no space) to pick up most of the new stuff...

jduke-halls commented 3 years ago

Merged Pull Request: #12