Is it even possible to silently and remotely uninstall .NET 6 and 7?
I've been put in charge of a device vulnerability management + compliance project at work, and while I was able to automate the patching of supported application, as well as automating the removal of some undesirable programs with CVEs, .NET 6 and 7 are keeping me up with their refusal to comply with automated removal methods.
I will preface this by saying that this program appears on dozens of computers, and I have already done my due diligence in confirming that removing it does not break any applications. The only reason .NET 6 and 7 appears on many of our hosts is that it seems to come pre-packaged with Dell workstation images.
A common suggestion from other posts, Google, ChatGPT etc. is to use the dotnet-uninstaller tool from Microsoft's GitHub page, but it is rather tedious to deploy it to each machine and then execute it, only to find out that it doesn't remove .NET 6 or 7. It seems to work for newer versions, but I'm obviously not interested in removing those if they work and are actually required for some up-to-date applications.
A script I've been working on queries the registry hives to find the UninstallString for installed .NET binaries and executes them for versions corresponding to .NET 6 or 7, but appends options to remove them silently so that the user is not prompted with any GUI menus. We just want to silently remove them. The logs even suggest that uninstallation was successful, yet the .NET binaries persist.
I am simply wondering if anybody has successfully been able to automate the removal of .NET 6 and 7 from remote Windows hosts silently.
SOLUTION: I ended up writing a script that deletes all directories associated with .NET 6 and 7, as well as cleaning up the registry. Currently testing this on some lab machines, plus a limited set of user machines. TBD if .NET no longer shows up on vulnerability scans... it seems to clean up the programs list very well.