Desktop & web

Uninstalling RingCentral apps using a PowerShell script
on a Windows system | RingEX

Optimize your experience with RingCentral Video. Learn more.
 
Over time, user environments can become cluttered with multiple versions of the RingCentral app. Powershell commands provide a way to remove these legacy versions. Running this script as an administrator removes any system-wide installations of the RingCentral app, after which, the current app version can be installed. When an admin runs the script on a computer with multiple users, RingCentral will be uninstalled for all.
 
This article shows two scripts:

Download PowerShell script

This script cleans up the following apps running on a Windows operating system:
  • RingCentral Meetings app
  • RingCentral Meetings Outlook plugin
  • RingCentral Classic app
  • RingCentral app
  • RingCentral Phone

Usage notes

The script should be run while logged in as a system administrator. All previous versions of the RingCentral app and any shortcuts will be removed for all users. 
 
When running this script, RingEX will be unresponsive.

Legal notice

Please read this disclaimer carefully before using this script. This script is open-source and subject to the terms of the MIT license. 
 
This script is provided as a tool for IT Administrators to programatically remove legacy RingCentral Classic App from End Users’ devices.
 
We also highly recommend that you first test this script to ensure that it achieves the desired results.
 
RingCentral makes no representation as to the script containing any errors or bugs. Any bugs or errors in the script may produce an undesirable outcome. Additionally, any modification or unintentional change made by you may have undesirable effects. If you discover any issue with the script, you should immediately cease use and manage the removal of RingCentral Classic application manually. 
 
Your use of this software is undertaken at your own risk. To the full extent permitted under law, RingCentral will not be liable for any loss or damage of whatever nature (direct, indirect, consequential or other) caused by the use of this script.

Uninstalling Windows versions of RingCentral apps

Preliminary script

This preliminary script must be run prior to executing any of those that follow.
  • The first line ensures that any powershell errors will be captured in the log file in addition to being displayed in the powershell window.
  • The second line sets the location of the log file. It should be set to an area that exists on the user's local system.
  • The third line sets the date/time format to use in the log file.
  • The script then checks that it is running as an administrator, and stops if it isn't.
$ErrorActionPreference = "Stop"
$logfile = "C:\temp\$(gc env:computername)-remove-RCApps.log"
$dtFormat = 'dd-MMM-yyyy HH:mm:ss'
add-content $logfile -value "----------------------------------------------------------------------------------------------------"
add-content $logfile -value "$(Get-Date -Format $dtFormat) Attempting to remove RC apps"
$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
add-content $logfile -value "$(Get-Date -Format $dtFormat) Running in Administrator context: $isAdmin"
if (!$isAdmin){
    add-content $logfile -value "$(Get-Date -Format $dtFormat) Script must be executed as an administrator: powershell.exe -noprofile -executionpolicy Bypass -file `"admin.ps1`""
    exit(-5)
 

To stop any RingCentral applications that may be running

This part of the script stops any of the processes on the current computer system for any currently logged on users. RingCentral applications to which the administrator has access are removed.
get-process | where-object {$_.Company -like "*RingCentral*" -or $_.Path -like "*RingCentral*"} | stop-process -ErrorAction ignore -Force

To stop any RingCentral installed applications that the administrator can remove

foreach ($app in (Get-WmiObject -Class Win32_Product | Where-Object{$_.Vendor -like "*RingCentral*"})) {
    add-content $logfile -value "$(Get-Date -Format $dtFormat) Attempting to uninstall $($app)"
    try {
        $app.Uninstall() | Out-Null 
    } catch {
        add-content $logfile -value $_

To remove any system uninstall keys

This section of the script cleans the Uninstall registry keys to remove any entries for RingCentral applications. If the uninstall section includes an uninstaller, then the script attempts to use that before removing the registry key.
$paths = @("HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 
           "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall")
foreach($path in $paths) {
    if (test-path($path)) {
        $list = Get-ItemProperty "$path\*" | Where-Object {$_.DisplayName -like "*RingCentral*"} | Select-Object -Property PSPath, UninstallString
        foreach($regkey in $list) {
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Examining Registry Key $($regkey.PSpath)"
            try {
                $cmd = $regkey.UninstallString
                if ($cmd -like "msiexec.exe*") {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Uninstall string is using msiexec.exe"
                    if ($cmd -notlike "*/X*") { 
                        add-content $logfile -value "$(Get-Date -Format $dtFormat)     no /X flag - this isn't for uninstalling"
                        $cmd = "" 
                    } #don't do anything if it's not an uninstall
                    elseif ($cmd -notlike "*/qn*") { 
                        add-content $logfile -value "$(Get-Date -Format $dtFormat)     adding /qn flag to try and uninstall quietly"
                        $cmd = "$cmd /qn" 
                    } #don't display UI
                }
                if ($cmd) {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     executing $($cmd)"
                    cmd.exe /c "$($cmd)"
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     done"
                }
            } catch {
                add-content $logfile -value $_
            }
        }
        $list = Get-ItemProperty "$path\*" | Where-Object {$_.DisplayName -like "*RingCentral*"} | Select-Object -Property PSPath
        foreach($regkey in $list) {
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Removing Registry Key $($regkey.PSpath)"
            try {
                remove-item $regkey.PSPath -recurse -force
            } catch {
                add-content $logfile -value $_
            }
        }
    } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }
}

Add shortcut to HKEY_USERS

This section of the script adds a shortcut to the HKEY_USERS registry hive, and then sets variables for standard Windows locations.
New-PSDrive -PSProvider registry -Root HKEY_USERS        -Name HKU  | Out-Null
if (test-path(${Env:ProgramFiles(x86)})) { $pf86 = ${Env:ProgramFiles(x86)} }  else { $pf86 = "C:\Program Files (x86)" }
add-content $logfile -value "$(Get-Date -Format $dtFormat) Program Files (x86) location: $($pf86)"
if (test-path(${Env:ProgramFiles}))      { $pf = ${Env:ProgramFiles} }         else { $pf = "C:\Program Files" }
add-content $logfile -value "$(Get-Date -Format $dtFormat) Program Files location: $($pf)"
if (test-path(${Env:ProgramData}))       { $pd = ${Env:ProgramData} }          else { $pd = "C:\ProgramData" }
add-content $logfile -value "$(Get-Date -Format $dtFormat) ProgramData location: $($pd)"
if (test-path(${Env:PUBLIC}))            { $pub = ${Env:PUBLIC} }              else { $pub = "C:\Users\Public" }
add-content $logfile -value "$(Get-Date -Format $dtFormat) Public profile location: $($pub)"
if (test-path(${Env:SystemRoot}))        { $win = ${Env:SystemRoot} }          else { $win = "C:\Windows" }
add-content $logfile -value "$(Get-Date -Format $dtFormat) Windows root location: $($win)"

Populate the lists of items to remove

In this section, the script lets you set the brand to allow removal of various branded items. Set a collection of items to remove from HKEY_LOCAL_MACHINE and then remove each one if it exists.
 
To see the result of every test, uncomment the ##else statement. 
$Brand = "RingCentral"  #RingCentral/TELUS/ATT/Avaya/BT/Rainbow/Unify
add-content $logfile -value "$(Get-Date -Format $dtFormat) Brand set to: $($Brand)"
$HKLM = [System.Collections.ArrayList]@()
$HKLM.add("HKLM:\SOFTWARE\$Brand") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\.rcrecord") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\.zoomrc") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\MIME\Database\Content Type\application/x-rcmtg-launcher") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RCLauncher") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentralMeetingsRecording") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\rcapp") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\rcmobile") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\rcsp") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\rcuk") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\rcvdt") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentral.callto") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentral.fax") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentral.rcmobile") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentral.rcsp") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentral.rcuk") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\RingCentral.tel") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Classes\zoomrc") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\IM Providers\RCIM") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\InternetPrinters") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\Microsoft\Office\Outlook\Addins\RingCentralForOutlook") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\RingCentralForOutlook") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\RingCentralInternetFax") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\RingCentralMeetings") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\$Brand") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\.rcrecord") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\.zoomrc") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\MIME\Database\Content Type\application/x-rcmtg-launcher") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RCLauncher") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentralMeetingsRecording") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\rcapp") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\rcmobile") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\rcsp") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\rcuk") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\rcvdt") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentral.callto") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentral.fax") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentral.rcmobile") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentral.rcsp") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentral.rcuk") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\RingCentral.tel") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Classes\zoomrc") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\IM Providers\RCIM") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\InternetPrinters") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\Outlook\Addins\RingCentralForOutlook") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\RingCentralForOutlook") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\RingCentralInternetFax") | Out-Null
$HKLM.add("HKLM:\SOFTWARE\WOW6432Node\RingCentralMeetings") | Out-Null
foreach ($regkey in $HKLM) {
    try {
        if (test-path($regkey)) {
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Removing Registry Key $($regkey)"
            remove-item $regkey -recurse -force
        } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Registry Key $($regkey) not found" }
    } catch {
        add-content $logfile -value $_
    }
}

Set folders to be removed

This part of the script lets you set a collection of computer-level folders/files to be removed. This uses the variables set up in the Add shortcut to HKEY_Users section of the script for the standard Windows locations, and checking 64-bit and 32-bit locations.
 
Check whether the path exists and recursively force removal if it does.
 
Again, ##else can be uncommented to check every removal.
$MachineFolders = [System.Collections.ArrayList]@()
$MachineFolders.add("$pd\Glip") | Out-Null
$MachineFolders.add("$pd\Microsoft\Windows\Start Menu\Programs\*RingCentral*") | Out-Null
$MachineFolders.add("$pf86\$Brand\SoftPhoneApp") | Out-Null
$MachineFolders.add("$pf86\Common Files\RingCentral") | Out-Null
$MachineFolders.add("$pf86\Glip") | Out-Null
$MachineFolders.add("$pf86\RingCentral Classic Installer") | Out-Null
$MachineFolders.add("$pf86\RingCentral Installer") | Out-Null
$MachineFolders.add("$pf86\RingCentralForOutlook") | Out-Null
$MachineFolders.add("$pf86\RingCentralMeetings") | Out-Null
$MachineFolders.add("$pf\$Brand\SoftPhoneApp") | Out-Null
$MachineFolders.add("$pf\Common Files\RingCentral") | Out-Null
$MachineFolders.add("$pf\Glip") | Out-Null
$MachineFolders.add("$pf\RingCentral Classic Installer") | Out-Null
$MachineFolders.add("$pf\RingCentral Installer") | Out-Null
$MachineFolders.add("$pf\RingCentralForOutlook") | Out-Null
$MachineFolders.add("$pf\RingCentralMeetings") | Out-Null
$MachineFolders.add("$pub\Desktop\RingCentral*.lnk") | Out-Null
$MachineFolders.add("$win\Prefetch\*GLIP*.pf") | Out-Null
$MachineFolders.add("$win\Prefetch\*RINGCENTRAL*.pf") | Out-Null
$MachineFolders.add("$win\Prefetch\*SOFTPHONE*.pf") | Out-Null
foreach ($item in $MachineFolders) {
    try {
        if (test-path($item)) {
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Removing $($item)"
            remove-item $item -recurse -force
        } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }
    } catch {
        add-content $logfile -value $_
    }
}

Loop through HKLM key to remove RC entries

This part of the script reviews the specified paths, examining the property and value for mentions of RingCentral, and removing if it finds the string. Firewall rules are removed if they were set up by a RingCentral installer.
$paths = @("HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders",
           "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\ARP",
           "HKLM:\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules",
           "HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules")
foreach($path in $paths) {
    if (test-path($path)) {
        add-content $logfile -value "$(Get-Date -Format $dtFormat) Checking registry path: $($path)"
        Get-Item -Path $path | Select-Object -ExpandProperty Property | % {
            $propValue = (Get-ItemProperty -Path "$path" -Name "$_")."$_"
            if (($_ -like "*RingCentral*") -or ($propValue -like "*RingCentral*")) {
                try {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Removing property: $($_) containing value: $($propValue)"
                    Remove-ItemProperty -path "$path" -Name $_
                } catch {
                    add-content $logfile -value $_
                }
            }
        }
    } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }
}

Build list of items that need to be removed for each user profile

In this part of the script, you set up the collections of user keys to be examined for each profile. Use HKEY_USERS and match by the user's SID.
 
The users folders will look up the locations in the registry when working on removing RingCentral details for that user.
$HKU = [System.Collections.ArrayList]@()
$HKU.add("HKU:\%SID%\SOFTWARE\$Brand") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\584acf4c-ebc3-56fa-9cfd-586227f098ba") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\Clients\Internet Call\RingCentral for Windows") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\IM Providers\RCIM") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\Microsoft\Internet Explorer\ProtocolExecute\zoomrc") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\Microsoft\Internet Explorer\Zoom") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\rcapp_rcapp") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\zoomrc_zoomrc") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\MozillaPlugins\@ringcentral.com/RingCentralMeetingsPlugin") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\RingCentral Softphone") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\$Brand") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Classes\MIME\Database\Content Type\application/x-rcmtg-launcher") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Classes\rcapp") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Classes\rcmobile") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Classes\rcvdt") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Classes\zoomrc") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\IM Providers\RCIM") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Clients\Internet Call\RingCentral for Windows") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\ProtocolExecute\zoomrc") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Zoom") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\rcapp_rcapp") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\zoomrc_zoomrc") | Out-Null
$HKU.add("HKU:\%SID%\SOFTWARE\WOW6432Node\RingCentral Softphone") | Out-Null
$HKU.add("HKU:\%SID%_classes\.rcrecord") | Out-Null
$HKU.add("HKU:\%SID%_classes\.zoomrc") | Out-Null
$HKU.add("HKU:\%SID%_classes\MIME\Database\Content Type\application/x-rcmtg-launcher") | Out-Null
$HKU.add("HKU:\%SID%_classes\RCLauncher") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentralMeetingsRecording") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentralMeetingsRecording") | Out-Null
$HKU.add("HKU:\%SID%_classes\rcapp") | Out-Null
$HKU.add("HKU:\%SID%_classes\rcmobile") | Out-Null
$HKU.add("HKU:\%SID%_classes\rcsp") | Out-Null
$HKU.add("HKU:\%SID%_classes\rcuk") | Out-Null
$HKU.add("HKU:\%SID%_classes\rcvdt") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentral.callto") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentral.fax") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentral.rcmobile") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentral.rcsp") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentral.rcuk") | Out-Null
$HKU.add("HKU:\%SID%_classes\RingCentral.tel") | Out-Null
$HKU.add("HKU:\%SID%_classes\zoomrc") | Out-Null
 
$UserFolders = [System.Collections.ArrayList]@()
$UserFolders.add("%desktop%\RingCentral Classic.lnk") | Out-Null
$UserFolders.add("%desktop%\RingCentral Meetings.lnk") | Out-Null
$UserFolders.add("%desktop%\RingCentral.lnk") | Out-Null
$UserFolders.add("%local%\$Brand") | Out-Null
$UserFolders.add("%local%\$Brand\SoftPhoneApp") | Out-Null
$UserFolders.add("%local%\Glip") | Out-Null
$UserFolders.add("%local%\Programs\RingCentral") | Out-Null
$UserFolders.add("%local%\RingCentral") | Out-Null
$UserFolders.add("%local%\RingCentral\RingCentral Classic") | Out-Null
$UserFolders.add("%local%\RingCentral\RingCentral") | Out-Null
$UserFolders.add("%local%\SquirrelTemp") | Out-Null
$UserFolders.add("%local%\Temp\Glip Crashes") | Out-Null
$UserFolders.add("%local%\ringcentral-updater") | Out-Null
$UserFolders.add("%roaming%\.rc-persist") | Out-Null
$UserFolders.add("%roaming%\Glip") | Out-Null
$UserFolders.add("%roaming%\JabraSDK") | Out-Null
$UserFolders.add("%roaming%\Microsoft\Windows\Start Menu\Programs\RingCentral Meetings") | Out-Null
$UserFolders.add("%roaming%\Microsoft\Windows\Start Menu\Programs\RingCentral") | Out-Null
$UserFolders.add("%roaming%\Microsoft\Windows\Start Menu\Programs\RingCentral*.lnk") | Out-Null
$UserFolders.add("%roaming%\Microsoft\Windows\Start Menu\Programs\RingCentral\RingCentral Classic.lnk") | Out-Null
$UserFolders.add("%roaming%\Microsoft\Windows\Start Menu\Programs\Startup\RingCentral*.lnk") | Out-Null
$UserFolders.add("%roaming%\RingCentral") | Out-Null
$UserFolders.add("%roaming%\RingCentralMeetings") | Out-Null
$UserFolders.add("%roaming%\RingCentral\logs") | Out-Null
$UserFolders.add("%roaming%\ZoomSDK") | Out-Null
$UserFolders.add("%roaming%\com.ringcentral.rcoutlook") | Out-Null

For each user profile on the computer, remove registry keys and associated folders for each RingCentral application

In this part of the script, you will manually uninstall RingCentral applications for each user profile on the system.
 
Refer to a list of users from the registry and check which hives are loaded and which are not, including system profiles as some components may be installed there. The default profile is added if any settings have been applied for newly created users.
 
If the hive is not loaded (i.e. the user is not logged in) then the script loads the user's NTUSER.dat details and UsrClass.dat so that the registry keys can be updated.
 
The script also finds the locations of the user's desktop, appdata and local appdata folders to be able to remove the folders created by the EXE installations.
add-content $logfile -value "$(Get-Date -Format $dtFormat) Removing applications for all user profiles"
$ProfileList = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*' | Select-Object @{name="SID";expression={$_.PSChildName}}, @{name="UserProfile";expression={"$($_.ProfileImagePath)"}}, @{name="Username";expression={$_.ProfileImagePath -replace '^(.*[\\\/])', ''}}
$DefaultProfile = "" | Select-Object SID, UserProfile, Username
$DefaultProfile.SID = ".DEFAULT"
$DefaultProfile.UserProfile = "$pub\..\Default"
$DefaultProfile.UserName = "Default"
$ProfileList += $DefaultProfile
$LoadedHives = Get-ChildItem HKU:\ | Where-Object {$_.PSChildname -match $PatternSID} | Select-Object @{name="SID";expression={$_.PSChildName}}
$UnloadedHives = Compare-Object $ProfileList.SID $LoadedHives.SID | Select-Object @{name="SID";expression={$_.InputObject}}, UserHive, Username
foreach ($item in $ProfileList) {
    try {
        if ($item.SID -in $UnloadedHives.SID) {
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Loading profile $($item.username) - located at $($item.UserProfile)\ntuser.dat"
            reg load HKU\$($item.SID) "$($item.UserProfile)\ntuser.dat" | Out-Null
        } else { 
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Checking profile $($item.username)"
        }
        
        $folders = "HKU:\$($item.sid)\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
        $desktop = (Get-Item -Path $folders).GetValue("Desktop", "$($item.UserProfile)\Desktop", "DoNotExpandEnvironmentNames") -replace "%USERPROFILE%", $item.UserProfile
        add-content $logfile -value "$(Get-Date -Format $dtFormat)     User Desktop location: $($desktop)"
        $local = (Get-Item -Path $folders).GetValue("Local AppData", "$($item.UserProfile)\AppData\Local", "DoNotExpandEnvironmentNames") -replace "%USERPROFILE%", $item.UserProfile
        add-content $logfile -value "$(Get-Date -Format $dtFormat)     User Local AppData location: $($local)"
        $roaming = (Get-Item -Path $folders).GetValue("AppData", "$($item.UserProfile)\AppData\Roaming", "DoNotExpandEnvironmentNames") -replace "%USERPROFILE%", $item.UserProfile
        add-content $logfile -value "$(Get-Date -Format $dtFormat)     User AppData location: $($roaming)"
        if ($item.SID -in $UnloadedHives.SID) {
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Loading user classes for profile $($item.username) - located at $($local)\Microsoft\Windows\UsrClass.dat"
            reg load HKU\$($item.SID)_classes "$($local)\Microsoft\Windows\UsrClass.dat" | Out-Null
        }

Remove registry keys

Remove registry keys and the specified file system folders. Uncomment ##else where applicable to see every check made in the log file.
foreach ($regkey in $HKU) {
            try {
                $key = $regkey -replace "%SID%", $item.SID
                if (test-path($key)) {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Removing Registry Key $($key)"
                    remove-item $key -recurse -force
                } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat)     Registry Key $($key) not found" }
            } catch {
                add-content $logfile -value $_
            }
        }
        
        foreach ($path in $UserFolders) {
            $temp = (($path -replace "%roaming%", $roaming) -replace "%local%", $local) -replace "%desktop%", $desktop 
            try {
                if (test-path($temp)) {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Removing $($temp)"
                    remove-item $temp -recurse -force
                } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat)     Path $($temp) not found" }
            } catch {
                add-content $logfile -value $_
            }
        }

Remove any user uninstall keys

Remove any uninstall entries so the programs don't appear in add/remove programs. Also, remove from the Installer sections of the registry to ensure that reinstalling doesn't prompt the user to remove/repair the software.
     $paths = @("HKU:\$($item.sid)\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall", "HKU:\$($item.sid)\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
        foreach($path in $paths) {
            if (test-path($path)) {
                $list = Get-ItemProperty "$path\*" | Where-Object {$_.DisplayName -like "*RingCentral*"} | Select-Object -Property PSPath
                foreach($regkey in $list) {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Removing Uninstall Registry Key $($regkey.PSPath)"
                    try {
                        remove-item $regkey.PSPath -recurse -force
                    } catch {
                        add-content $logfile -value $_
                    }
                }
            } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }
        }

Remove any user install keys in the user hive and the user data part of the local computer

This part of the script checks the specified registry keys, removing the property if it or its value contains RingCentral. If the user wasn't logged in, then the loaded registry hives are unloaded.
        $paths = @("HKU:\$($item.sid)\SOFTWARE\WOW6432Node\Microsoft\Installer\Products", "HKU:\$($item.sid)\SOFTWARE\Microsoft\Installer\Products")
        foreach($path in $paths) {
            if (test-path($path)) {
                $list = Get-ItemProperty "$path\*" | Where-Object {$_.ProductName -like "*RingCentral*"} | Select-Object -Property PSPath
                foreach($regkey in $list) {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Removing Install Registry Key $($regkey.PSPath)"
                    try {
                        remove-item $regkey.PSPath -recurse -force
                    } catch {
                        add-content $logfile -value $_
                    }
                }
            } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }
        }
        $paths = @("HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Installer\UserData\$($item.sid)\Products", 
                   "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\$($item.sid)\Products")
        foreach($path in $paths) {
            if (test-path($path)) {
                $list = Get-ItemProperty "$path\*\*" | Where-Object {$_.Publisher -like "*RingCentral*"} | Select-Object -Property PSParentPath
                foreach($regkey in $list) {
                    add-content $logfile -value "$(Get-Date -Format $dtFormat)     Removing Install Registry Key $($regkey.PSParentPath)"
                    try {
                        remove-item $regkey.PSParentPath -recurse -force
                    } catch {
                        add-content $logfile -value $_
                    }
                }
            } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }

Loop through the keys and remove any RingCentral entries

$paths = @("HKU:\$($item.sid)_classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache", 
                   "HKU:\$($item.sid)\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FeatureUsage\AppBadgeUpdated", 
                   "HKU:\$($item.sid)\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\SHC")
        foreach($path in $paths) {
            if (test-path($path)) {
                add-content $logfile -value "$(Get-Date -Format $dtFormat)     Checking registry path: $($path)"
                Get-Item -Path $path | Select-Object -ExpandProperty Property | % {
                    $propValue = (Get-ItemProperty -Path "$path" -Name "$_")."$_"
                    if (($_ -like "*RingCentral*") -or ($propValue -like "*RingCentral*")) {
                        try {
                            add-content $logfile -value "$(Get-Date -Format $dtFormat)         Removing property: $($_) containing value: $($propValue)"
                            Remove-ItemProperty -path "$path" -Name $_
                        } catch {
                            add-content $logfile -value $_
                        }
                    }
                }
            } ##else { add-content $logfile -value "$(Get-Date -Format $dtFormat) Path $($item) not found" }
        }
        if ($item.SID -in $UnloadedHives.SID) {
            [gc]::Collect()
            add-content $logfile -value "$(Get-Date -Format $dtFormat) Unloading profile"
            reg unload HKU\$($item.SID) | Out-Null
            reg unload HKU\$($item.SID)_classes | Out-Null
        }
    } catch {
        add-content $logfile -value $_
    }
}

Reinstall applications

To reinstall applications, if desired, remove comment (#) prior to running, including the log file comment. Check to confirm that the path to the MSI file is correct.  
 
Note: The EXE files should not be deployed using this script, as doing so installs the application for the administrator account, not the user account.
add-content $logfile -value "$(Get-Date -Format $dtFormat) Installing required applications"
#add-content $logfile -value "$(Get-Date -Format $dtFormat)     Installing RingCentral MSI app quietly"
#cmd.exe /c 'MSIEXEC.EXE /i "RingCentral-x64.msi" /qn'
#add-content $logfile -value "$(Get-Date -Format $dtFormat)     Installing RingCentral Meetings MSI app quietly"
#cmd.exe /c 'MSIEXEC.EXE /i "RCMeetingsClientSetup.msi" /qn'
#add-content $logfile -value "$(Get-Date -Format $dtFormat)     Installing RingCentral Phone MSI app quietly"
#cmd.exe /c 'MSIEXEC.exe /i "RingCentral-Phone-21.1.0.msi" ALLUSERS=1 /qn'
add-content $logfile -value "$(Get-Date -Format $dtFormat) End of install script"

Uninstalling only the RingCentral Classic app

Over time, user environments can become cluttered with multiple versions of the RingCentral classic app. Powershell commands provide a way to remove these legacy versions. Running a script as administrator removes any system-wide installations of the RingCentral app, after which the current app version can be installed. When an admin runs the script on a computer with multiple users, RingCentral Classic will be uninstalled for all.

Usage notes

The script should be run while logged in as a system administrator. All previous versions of RingCentral Classic and any shortcuts will be removed for all users. Additionally, the script has an option to remove directories that should only be used when it is confirmed that no user is storing files in them.

To remove the folder used by RC Classic, remove the character from the four lines in the script that begin with -Force. There are four lines where this occurs. The second causes the script to look for a 32-bit installation on a 64-bit machine, the third and fourth lines remove the remaining Message folders inside users AppData directory).
 
When running this script, RingEX will be unresponsive.

Legal notice

Please read this disclaimer carefully before using this script. This script is open-source and subject to the terms of the MIT license.                                       
 
This script is provided as a tool for IT Administrators to programatically remove legacy RingCentral Classic App from End Users’ devices.
                                            
We also highly recommend that you first test this script to ensure that it achieves the desired results.             
 
RingCentral makes no representation as to the script containing any errors or bugs.  Any bugs or errors in the script may produce an undesirable outcome.  Additionally, any modification or unintentional change made by you may have undesirable effects. If you discover any issue with the script, you should immediately cease use and manage the removal of RingCentral Classic application manually.      
 
Your use of this software is undertaken at your own risk. To the full extent permitted under law, RingCentral will not be liable for any loss or damage of whatever nature (direct, indirect, consequential or other) caused by the use of this script.

Stop any RingCentral applications that may be running

This code attempts to stop the applications if they are currently running. If they aren't running, the script might produce an error generated from trying to stop a process that doesn’t exist. If this happens, ignore the error.
 
Note: RingEX app processes also stop during this script execution.
stop-process -ProcessName "RingCentral" -ErrorAction ignore
stop-process -ProcessName "RingCentral Classic" -ErrorAction ignore

To uninstall any RingCentral Classic MSI installed applications

This part of the script uses Windows Management Instrumentation (WMI) to check for installed products where the name is RingCentral Classic. For each occurrence found, WMI calls the uninstall routine for that product. A user who has installed the MSI applications has permission to remove them.
 
Any output generated is discarded.
 
The invocation of Get-WmiObject can be slow, typically requiring at least 20-30 seconds to return the list. Get-WmiObject is likely to take at least 20 seconds to execute on a machine.
foreach ($app in (Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -like "*RingCentral Classic*"})) {
$app.Uninstall() | Out-Null

To remove RingCentral Classic for every user on the computer

RingCentral Classic can be uninstalled for each user profile on a machine using this code. The uninstall string in the registry for RingCentralClassic allows an administrator to uninstall the application on behalf of the user.
$PatternSID = 'S-1-5-21-\d+-\d+\-\d+\-\d+$'
$ProfileList = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*' |
Where-Object {$_.PSChildName -match $PatternSID} |
Select  @{name="SID";expression={$_.PSChildName}}, @{name="ProfileImagePath";expression={$_.ProfileImagePath}},
@{name="UserHive";expression={"$($_.ProfileImagePath)\ntuser.dat"}},
@{name="Username";expression={$_.ProfileImagePath -replace '^(.*[\\\/])', ''}}
$LoadedHives = Get-ChildItem registry::HKEY_USERS | where-object {$_.PSChildname -match $PatternSID} |
Select @{name="SID";expression={$_.PSChildName}}
$UnloadedHives = Compare-Object $ProfileList.SID $LoadedHives.SID |
Select @{name="SID";expression={$_.InputObject}}, UserHive, Username
foreach ($item in $ProfileList) {
   if ($item.SID -in $UnloadedHives.SID) {
       reg load HKU\$($item.SID) $($item.UserHive) | Out-Null
   }

Load user profiles

This part of the script loads each user profile that exists on the current computer system in turn and checks whether there is an uninstall section for Glip. If there is, then it executes the uninstaller string and removes the item from the registry. Optionally, it can also remove the Glip folder from the user profile. To enable this option, uncomment the two Remove-Item lines by removing the # character at the beginning of the line. 
 
Once a user has been checked, the registry hive is unloaded again.
  $glip = "registry::HKEY_USERS\$($item.SID)\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Glip"
   if (test-path($glip)) {
       $uninstall = Get-ItemProperty -Path $glip
       $cmd = $uninstall.QuietUninstallString
       if (!$cmd) {
           $cmd = $uninstall.UninstallString
       }
       if ($cmd) {
           Invoke-Expression "& $cmd"
           Start-Sleep -Seconds 10
           Remove-Item $glip -ErrorAction SilentlyContinue
           #Remove-Item -Force -ErrorAction SilentlyContinue "$(Split-Path $cmd.substring(1, $cmd.indexof('"', 1)))" -Recurse
       }
   }

Optional statements

The statements in this part of the script are optional. They allow for the removal of the various directories in the user profile, if needed. To remove the folder and its contents, uncomment the line by removing the # symbol at the start of the line.
 
If you are unsure about removing these folders, they can be left in place. This is the safest approach as these folders are left behind when the official uninstaller is run. However, for users who want a fresh start before proceeding, these are the folders to delete.
 
If these folders are removed and a RingCentral Classic app is then installed, the user will need to re-enter emergency address details.
   $glip = "registry::HKEY_USERS\$($item.SID)\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Glip"
   if (test-path($glip)) {
       $uninstall = Get-ItemProperty -Path $glip
       $cmd = $uninstall.QuietUninstallString
       if (!$cmd) {
           $cmd = $uninstall.UninstallString
       }
       if ($cmd) {
           Invoke-Expression "& $cmd"
           Start-Sleep -Seconds 10
           Remove-Item $glip -ErrorAction SilentlyContinue
           #Remove-Item -Force -ErrorAction SilentlyContinue "$(Split-Path $cmd.substring(1, $cmd.indexof('"', 1)))" -Recurse
       }
   }
   if ($item.SID -in $UnloadedHives.SID) {
       [gc]::Collect()
       reg unload HKU\$($item.SID) | Out-Null
   }
 
   $AppDataLocalGlipPath="$($item.ProfileImagePath)\AppData\Local\Glip"
   $AppDataRoamingGlipPath="$($item.ProfileImagePath)\AppData\Roaming\Glip"
   if (test-path $AppDataLocalGlipPath) {
       #Remove-Item -Force $AppDataLocalGlipPath -Recurse -ErrorAction SilentlyContinue
   }
   if (test-path $AppDataRoamingGlipPath) {
       #Remove-Item -Force $AppDataRoamingGlipPath -Recurse -ErrorAction SilentlyContinue
   }
}
© 1999-2022 RingCentral, Inc. Todos os direitos reservados.
Thanks!
We've sent you a link, please check your phone!
Please allow a full minute between phone number submissions.
There was an issue with SMS sending. Please try again. If the issue persists, please contact support.