Advertisement
Guest User

3CX remover

a guest
Mar 30th, 2023
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 delete all 3CXDesktopApp folders from the user profile directories and program files directories.
  9. $ListOfLocations = @(
  10.     "C:\Users\*\AppData\Local\Programs\3CXDesktopApp",
  11.     "C:\Program Files\3CXDesktopApp"
  12.     )
  13.  
  14. foreach ($Location in $ListOfLocations){
  15.     write-host "Searching for 3CX Desktop App folders at '$Location'..."
  16.     $FoundInstances = Get-Item -Path $Location -Directory -ErrorAction SilentlyContinue
  17.     foreach ($FoundInstance in $FoundInstances){
  18.         write-host "Found 3CX Desktop App Folder at '$FoundInstance', deleting it..."
  19.         Remove-Item -Path $FoundInstance.FullName -Recurse -Force
  20.     }
  21. }
  22.  
  23. #This section will create a file called "3cxremoved.txt" in the root of the C:\ drive.
  24. $FilePath = "C:\3cxremoved.txt"
  25. $Content = "3CX Desktop App has been removed from this computer."
  26. New-Item -Path $FilePath -ItemType File -Force
  27. Set-Content -Path $FilePath -Value $Content
Tags: 3cx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement