This one removes Microsoft Edge from a secured environment post-Server 2019 upgrade.
In this example, we have an environment with Internet explorer removed from Server 2019. Then an in-place upgrade to Server 2022 put Microsoft Edge back onto the system.
Run the PowerShell cmdlet below:
$location = get-location
set-location ‘C:\Program Files (x86)\Microsoft\Edge\Application\110.0.1587.50\installer’
cmd.exe /c “.\setup.exe –uninstall –system-level –verbose-logging –force-uninstall”
set-location $location
This code will completely uninstall edge from the server. It is bringing it back into compliance.
The only thing that needs to change is the path to the exact version of edge “110.0.1587.50” This changes based on the version.
This doesn’t seem to work for me. I get below.
set-location ‘C:\Program Files (x86)\Microsoft\Edge\Application\111.0.1661.54\installer’
cmd.exe /c “.\setup.exe –uninstall –system-level –verbose-logging –force-uninstall”
cmd.exe : [4004:5372:0420/135300.033:2847312:ERROR:setup_main.cc(988)] Already installed version 111.0.1661.54 at system-level
conflicts with this one at user-level.
At line:2 char:1
+ cmd.exe /c “.\setup.exe –uninstall –system-level –verbose-logging –fo …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ([4004:5372:0420… at user-level.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
[4004:5372:0420/135300.049:2847328:ERROR:persistent_histogram_storage.cc(121)] Could not write “SetupMetrics” persistent histograms
to file as the storage directory does not exist.
The path changes like the wind with the edge installer just browse tot he c:\Program Files (x86)\Microsoft\Edge\Application\ location note the new location and update your code it will work.
Thanks,
Dave