SOLVED

Removing McAfee live safe via intune

%3CLINGO-SUB%20id%3D%22lingo-sub-2272030%22%20slang%3D%22en-US%22%3ERemoving%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2272030%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWas%20wondering%20if%20someone%20can%20help!%20I%20have%20enrolled%20devices%20and%20all%20have%20mcafee%20live%20safe%20trial%20on%20which%26nbsp%3B%20I%20need%20to%20remove%2C%20as%20I%20have%20given%20these%20devices%20back%20to%20users%2C%20fresh%20start%20isnt%20possible.%20I%20have%20found%20this%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fchristianlehrer.com%2F%3Fp%3D359%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fchristianlehrer.com%2F%3Fp%3D359%3C%2FA%3E%26nbsp%3Bif%20I%20run%20the%20command%20%22%3CSPAN%3E.%5CMccleanup.exe%20-p%20StopServices%2CMFSY%2CPEF%2CMXD%2CCSP%2CSustainability%2CMOCP%2CMFP%2CAPPSTATS%2CAuth%2CEMproxy%2CFWdiver%2CHW%2CMAS%2CMAT%2CMBK%2CMCPR%2CMcProxy%2CMcSvcHost%2CVUL%2CMHN%2CMNA%2CMOBK%2CMPFP%2CMPFPCU%2CMPS%2CSHRED%2CMPSCU%2CMQC%2CMQCCU%2CMSAD%2CMSHR%2CMSK%2CMSKCU%2CMWL%2CNMC%2CRedirSvc%2CVS%2CREMEDIATION%2CMSC%2CYAP%2CTRUEKEY%2CLAM%2CPCB%2CSymlink%2CSafeConnect%2CMGS%2CWMIRemover%2CRESIDUE%20-v%20-s%22%20locally%20it%20works%20but%20once%20i%20follow%20the%20intune%20way%20of%20doing%20it%20I%20cant%20get%20it%20to%20work!%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EDoes%20anyone%20know%20how%20I%20can%20wrap%20the%20uninstall%20exe%20and%20a%20powershell%20script%20correctly%20to%20remove%20mcafee%20live%20safe%20or%20another%20way%20I%20can%20do%20this%20but%20has%20to%20be%20remote%20via%20intune.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%20in%20advance!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2272030%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Friday%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EConditional%20access%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGraph%20API%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMobile%20Application%20Management%20(MAM)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMobile%20Device%20Management%20(MDM)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESoftware%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2273932%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2273932%22%20slang%3D%22en-US%22%3EHI%2C%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20will%20need%20to%20create%20a%20win32%20app.%20You%20can%20do%20this%20by%20using%20the%20intunewinapputil%20tool%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fintune%2Fapps%2Fapps-win32-prepare%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fintune%2Fapps%2Fapps-win32-prepare%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E1.Create%20a%20folder%20and%20copy%20the%20mccleanup.exe%20to%20that%20folder.%3CBR%20%2F%3E2.Create%20a%20powershell%20script%20with%20the%20command%20in%20it%20you%20mentioned.%3CBR%20%2F%3E3.Make%20sure%20you%20get%20your%20install%20command%20and%20file%20requirement%20right%20in%20intune.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274268%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274268%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3Ein%20the%20link%20i%20shared%20the%20person%20uses%20%22%25~dp0Mccleanup.exe%20-p%20StopServices%2CMFSY%2CPEF%2CMXD%2CCSP%2CSustainability%2CMOCP%2CMFP%2CAPPSTATS%2CAuth%2CEMproxy%2CFWdiver%2CHW%2CMAS%2CMAT%2CMBK%2CMCPR%2CMcProxy%2CMcSvcHost%2CVUL%2CMHN%2CMNA%2CMOBK%2CMPFP%2CMPFPCU%2CMPS%2CSHRED%2CMPSCU%2CMQC%2CMQCCU%2CMSAD%2CMSHR%2CMSK%2CMSKCU%2CMWL%2CNMC%2CRedirSvc%2CVS%2CREMEDIATION%2CMSC%2CYAP%2CTRUEKEY%2CLAM%2CPCB%2CSymlink%2CSafeConnect%2CMGS%2CWMIRemover%2CRESIDUE%20-v%20-s%22%20for%20the%20.bat%20why%20would%20%25~dp0%20be%20needed%3F%20I%20try%20running%20this%20on%20the%20device%20which%20has%20mcafee%20live%20safe%20on%20and%20this%20doesnt%20work%20so%20I%20would%20assume%20this%20wouldnt%20work%20once%20put%20in%20intune%3F%3CBR%20%2F%3E%3CBR%20%2F%3EWould%20the%20install%2Funinstall%20command%20be%20the%20name%20of%20the%20.bat%20too%3F%20for%20instance%20Slient_uninstall.bat%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274279%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274279%22%20slang%3D%22en-US%22%3EIf%20the%20.exe%20is%20inside%20that%20folder%20you%20could%20create%20a%20simple%20powershell%20script%20with%20these%20contents%20in%20it%3A%3CBR%20%2F%3E.%5CMccleanup.exe%20-p%20and%20the%20other%20stuff%20%3A)%3C%2Fimg%3E%3CBR%20%2F%3E%3CBR%20%2F%3ECreate%20a%20win32app%20and%20select%20the%20instalscript%20as%20setup%3CBR%20%2F%3E%3CBR%20%2F%3EYour%20install%20command%20in%20intune%20would%20be%20powershell.exe%20-executionpolicy%20bypass%20-command%20%22.%5Cinstallscripts.ps1%22%3CBR%20%2F%3E%3CBR%20%2F%3EMaybe%20before%20you%20create%20the%20intunewin%20file%2C%20test%20it%20out%20on%20a%20device%20before%20you%20upload%20it%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274302%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274302%22%20slang%3D%22en-US%22%3EI%20will%20test%20the%20locally%20first%20before%20upload!%20thank%20you.%20If%20this%20does%20work%20locally%20for%20upload%20for%20intune%20what%20would%20the%20uninstall%20command%20be%3F%20and%20the%20detection%20rule%3F%20Any%20ideas%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274367%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274367%22%20slang%3D%22en-US%22%3EYou%20could%20%22fake%22%20the%20uninstall%20command%20as%20it%20is%20not%20required%2C%20just%20enter%20uninstall.cmd%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20detection%20rule%20you%20could%20add%20an%20extra%20command%20to%20the%20install%20script%20to%20create%20an%20additional%20file%20something%20like%20this%3A%3CBR%20%2F%3E%3CBR%20%2F%3ENew-Item%20-Path%20%22c%3A%5C%22%20-Name%20%22temp%22%20-ItemType%20%22directory%22%20-force%3CBR%20%2F%3E%24path%20%3D%20%22c%3A%5Ctemp%22%3CBR%20%2F%3ENew-Item%20-path%20%24path%20-name%20%22removeav.txt%22%20-ItemType%20file%20-force%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274403%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274403%22%20slang%3D%22en-US%22%3ESo%20the%20detection%20rule%20would%20be%20c%3A%5Ctemp%20(if%20I%20used%20temp%20as%20the%20folder%20like%20in%20your%20example%3F%20)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2329093%22%20slang%3D%22en-US%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2329093%22%20slang%3D%22en-US%22%3EHi%20AB21805.%20did%20you%20get%20it%20to%20work%3F%20Check%20the%20blog%20again..it%20has%20an%20update%20%3B)%3C%2Fimg%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHere's%20what%20I%20did%3A%3CBR%20%2F%3E%3CBR%20%2F%3Estep%201%3A%20IntuneWinAppUtil.exe%20-c%20C%3A%5Ctemp%5CRemoveMcAfee%5CMCPR%20-s%20mccleanup.exe%20-o%20C%3A%5Ctemp%5CRemoveMcAfee%5CMcAfeeSilentUninstall%3CBR%20%2F%3E%3CBR%20%2F%3EI'm%20wrapping%20the%20complete%20MCPR%20folder%20which%20also%20includes%20Silent_uninstall.bat%20as%20documented%20in%20the%20blog%20above.%3CBR%20%2F%3E%3CBR%20%2F%3ESTEP%202%3A%20Upload%20mccleanup.intunewin%20to%20Intune%3CBR%20%2F%3Einstall%20and%20uninstall%20command%20are%20Silent_uninstall.bat%3CBR%20%2F%3EYou%20need%20to%20add%20an%20extra%20requirement%20rule%20for%20installation%3A%20I%20added%20the%20reg%20key%20as%20documented%3CBR%20%2F%3EI%20also%20added%20the%20custom%20detection%20rule.%20Also%20a%20reg%20key%3CBR%20%2F%3EWait%20for%20it%20to%20install%20and%20remove%20McAfee.%20This%20can%20take%20a%20while.%20For%20me%20when%20testing%20it%20uninstalled%20McAfee%20completely%20after%20about%20an%20hour.%3CBR%20%2F%3EReboot%20and%20Windows%20Defender%20takes%20over%20again.%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps..%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2521304%22%20slang%3D%22es-ES%22%3ERe%3A%20Removing%20McAfee%20live%20safe%20via%20intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2521304%22%20slang%3D%22es-ES%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F132717%22%20target%3D%22_blank%22%3ESari%20%40Oktay%3C%2FA%3E%20Doubt%20the%20requirement%20rules%20and%20detection%20rules%20are%20still%20%3CSPAN%3E%20HKEY_LOCAL_MACHINE%20%5CSOFTWARE%5CMcAfee%20%3F%20And%20what%20is%20the%20registry%20key%20you%20mention%3F%20Thank%20you.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Contributor

Hi all, 

 

Was wondering if someone can help! I have enrolled devices and all have mcafee live safe trial on which  I need to remove, as I have given these devices back to users, fresh start isnt possible. I have found this: https://christianlehrer.com/?p=359 if I run the command ".\Mccleanup.exe -p StopServices,MFSY,PEF,MXD,CSP,Sustainability,MOCP,MFP,APPSTATS,Auth,EMproxy,FWdiver,HW,MAS,MAT,MBK,MCPR,McProxy,McSvcHost,VUL,MHN,MNA,MOBK,MPFP,MPFPCU,MPS,SHRED,MPSCU,MQC,MQCCU,MSAD,MSHR,MSK,MSKCU,MWL,NMC,RedirSvc,VS,REMEDIATION,MSC,YAP,TRUEKEY,LAM,PCB,Symlink,SafeConnect,MGS,WMIRemover,RESIDUE -v -s" locally it works but once i follow the intune way of doing it I cant get it to work! 

 

Does anyone know how I can wrap the uninstall exe and a powershell script correctly to remove mcafee live safe or another way I can do this but has to be remote via intune.

 

Thanks in advance!

8 Replies
HI,

You will need to create a win32 app. You can do this by using the intunewinapputil tool

https://docs.microsoft.com/en-us/mem/intune/apps/apps-win32-prepare

1.Create a folder and copy the mccleanup.exe to that folder.
2.Create a powershell script with the command in it you mentioned.
3.Make sure you get your install command and file requirement right in intune.
Hi,

in the link i shared the person uses "%~dp0Mccleanup.exe -p StopServices,MFSY,PEF,MXD,CSP,Sustainability,MOCP,MFP,APPSTATS,Auth,EMproxy,FWdiver,HW,MAS,MAT,MBK,MCPR,McProxy,McSvcHost,VUL,MHN,MNA,MOBK,MPFP,MPFPCU,MPS,SHRED,MPSCU,MQC,MQCCU,MSAD,MSHR,MSK,MSKCU,MWL,NMC,RedirSvc,VS,REMEDIATION,MSC,YAP,TRUEKEY,LAM,PCB,Symlink,SafeConnect,MGS,WMIRemover,RESIDUE -v -s" for the .bat why would %~dp0 be needed? I try running this on the device which has mcafee live safe on and this doesnt work so I would assume this wouldnt work once put in intune?

Would the install/uninstall command be the name of the .bat too? for instance Slient_uninstall.bat

If the .exe is inside that folder you could create a simple powershell script with these contents in it:
.\Mccleanup.exe -p and the other stuff :)

Create a win32app and select the instalscript as setup

Your install command in intune would be powershell.exe -executionpolicy bypass -command ".\installscripts.ps1"

Maybe before you create the intunewin file, test it out on a device before you upload it
I will test the locally first before upload! thank you. If this does work locally for upload for intune what would the uninstall command be? and the detection rule? Any ideas?
best response confirmed by AB21805 (Regular Contributor)
Solution
You could "fake" the uninstall command as it is not required, just enter uninstall.cmd

As detection rule you could add an extra command to the install script to create an additional file something like this:

New-Item -Path "c:\" -Name "temp" -ItemType "directory" -force
$path = "c:\temp"
New-Item -path $path -name "removeav.txt" -ItemType file -force
So the detection rule would be c:\temp (if I used temp as the folder like in your example? )
Hi AB21805. did you get it to work? Check the blog again..it has an update ;)

Here's what I did:

step 1: IntuneWinAppUtil.exe -c C:\temp\RemoveMcAfee\MCPR -s mccleanup.exe -o C:\temp\RemoveMcAfee\McAfeeSilentUninstall

I'm wrapping the complete MCPR folder which also includes Silent_uninstall.bat as documented in the blog above.

STEP 2: Upload mccleanup.intunewin to Intune
install and uninstall command are Silent_uninstall.bat
You need to add an extra requirement rule for installation: I added the reg key as documented
I also added the custom detection rule. Also a reg key
Wait for it to install and remove McAfee. This can take a while. For me when testing it uninstalled McAfee completely after about an hour.
Reboot and Windows Defender takes over again.

Hope this helps..

@Oktay SariDuda las reglas de requerimiento y reglas de deteccion siguen siendo  HKEY_LOCAL_MACHINE \SOFTWARE\McAfee ? Y cual es la clave de registro que mencionas? Gracias.