Advertisement
Guest User

SCRIPT 1

a guest
Mar 30th, 2023
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.92 KB | Cybersecurity | 0 0
  1. #Credit to Reddit user piepsodj - https://www.reddit.com/r/msp/comments/125sxuo/comment/je6kugc/
  2. #This section will kill the 3CXDesktopApp process, if it is currently running....
  3. if (Get-Process -Name "3CXDesktopApp" -ErrorAction SilentlyContinue) {
  4.     write-host "Found the process running, killing it!"
  5.     Stop-Process -Name "3CXDesktopApp" -Force
  6. }
  7.  
  8. #This section will rename the 3CXDesktopApp.Exe and Update.exe to a different filename, so they won't get run automatically again.
  9. $ListOfLocations = @(
  10.     "C:\Users\*\AppData\Local\Programs\3CXDesktopApp",
  11.     "C:\Program Files\3CXDesktopApp"
  12.     )
  13.  
  14. foreach ($Location in $ListOfLocations){
  15.  
  16.     $FoundInstances = Get-Item -Path $Location -ErrorAction SilentlyContinue
  17.  
  18.     foreach ($FoundInstance in $FoundInstances){
  19.         write-host "Found 3CX Desktop folders at '$FoundInstance', Deleting folders..."
  20.         Remove-Item -Path $FoundInstance -Recurse
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement