11 Replies Latest reply on Mar 26, 2015 4:05 PM by young so

    Uninstall Windows RSCD Agent

    Jim Campbell

      What is the best generic way to uninstall the RSCD agent from Windows servers?  We have a mix of versions of agents - some were installed with the old executables with a silent response files and some with the new MSI installers.  Is there a single method that will work for uninstalling the agent?  We are not interested in retaining anything and just want to remove the agent and all log files/configuration files entirely on a few servers.

        • 1. Re: Uninstall Windows RSCD Agent
          Bill Robinson

          you can get the uuid from the uninstall registry key and i think call that w/ msiexec ?  i think that works even w/ the installshield ?

          • 2. Re: Uninstall Windows RSCD Agent
            Jim Campbell

            If i try msiexec /x with the value of the 'ProductGUID' regkey it says 'This action is only valid for products that are currently installed'

            • 3. Re: Uninstall Windows RSCD Agent
              Jim Campbell

              The "UninstallString" regkey value works but I can't figure out how to get it to run silently ( -q and -s don't seem to work )


              The string looks like ( on one server ) :

              "C:\Program Files\BMC Software\BladeLogic\8.1\RSCD\Uninstall\setup.exe" -runfromtemp -l0x0009 -removeonly

              • 4. Re: Re: Uninstall Windows RSCD Agent
                richard mcleod

                Heres a powershell i wrote -- i stripped out a bunch of other code from this, if it throws an error i'll just share the full script


                #Time to gather some data and set up variables
                $global:datetime = get-date
                #This determines os architecture
                $global:osarch = (get-wmiobject -class win32_operatingsystem -computername . -ea 0).osarchitecture
                #Get Windows directory from env variable
                $global:wdir = (get-childitem Env:windir).value
                #Setting the path of our rsc folder
                $global:rscpath = echo $($global:wdir + "\rsc")
                #Setting the msi path
                $global:temppath = "C:\temp\blinstall"
                #Known Install Paths
                $global:blinstallp1 = "C:\Program Files\BladeLogic\RSC"
                $global:blinstallp2 = "C:\Program Files\BMC BladeLogic\RSC"
                $global:blinstallp3 = "C:\Program Files\BMC Software\BladeLogic\RSCD"
                $global:blinstallp4 = "C:\Program Files\BMC Software\BladeLogic\8.0\RSCD"
                $global:blinstallp5 = "C:\Program Files\BMC Software\BladeLogic\8.1\RSCD"
                $global:blinstallp6 = "C:\Program Files\BMC Software\BladeLogic\8.1"
                $global:blinstallp7 = "C:\Program Files\BMC Software\BladeLogic\8.0"
                #Known Registry Paths
                $global:blregp1 = "HKLM:\SOFTWARE\BladeLogic\RSCD Agent"
                $global:blregp2 = "HKLM:\SOFTWARE\BMC BladeLogic\BMC BladeLogic RSCD Agent"
                $global:blregp3 = "HKLM:\SOFTWARE\BMC Software\BMC BladeLogic Server Automation RSCD Agent"
                $global:blregp4 = "HKLM:\SOFTWARE\BladeLogic\BladeLogic RSCD Agent"
                #Windows Uninstaller path
                $global:winuninstallregpath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
                $global:rscdSVCName = "RSCDsvc"
                $global:windowsInstallerSVCName = "MSIServer"
                function blremove {
                #first we need to check if the product is officially installed
                #Here we're looping through our known BladeLogic registry locations looking for the product code
                foreach ($rpath in $global:blregp1,$global:blregp2,$global:blregp3,$global:blregp4) {
                  if ((test-path $rpath) -And (get-itemproperty $rpath).productcode) {
                  $pCode = (get-itemproperty $rpath).productcode
                  echo $("Product Code found directly! " + $pCode)
                  elseif ((test-path $rpath) -And !(get-itemproperty $rpath).productcode) {
                  $rkeys = get-childitem $rpath
                  $rkeys | foreach-object {
                  $pCode = findProductKey($_.name -replace "HKEY_LOCAL_MACHINE", "HKLM:")
                  if ($pCode -And $pCode.startswith("{")) {
                  echo $("Product Code found! " + $pCode)
                  else {
                  echo $($_.name + " Does not contain a product code")
                  else {
                  echo $($rpath + " is already clean!")
                if ($pCode) {
                uninstallAgent $pCode
                else {
                echo "Good news, no need to scrub!"
                function stopRSCD {
                if ((get-service $global:rscdSVCName).status -eq 'Stopped') {
                    echo "The BladeLogic RSCD Service is stopped. Moving ahead with uninstall"
                else {
                    stop-service $global:rscdSVCName
                function uninstallAgent ($productCode) {
                if ($productCode -And $productCode.startswith("{")) {
                  if (((get-itemproperty -path $($global:winuninstallregpath + $productCode)).DisplayName).contains("RSCD")) {
                  echo "Uninstall Information found in the Windows Registry, proceeding with uninstall!"
                  uninstall-BladeLogicRSCD $productCode
                  else {
                  echo $("The product code that was found doesn't seem to belong to an RSCD install " + $productCode)
                function blshowhelp {
                echo "Thanks for accessing the help, here is what you need to know"
                echo "Accepted parameters are: remove, help"
                echo ""
                echo "remove: Will remove BladeLogic from the system, scrub will also be called here to ensure we're clean"
                echo "help: This again"
                echo ""
                function findProductKey ($keypath) {
                if (test-path $keypath) {
                  $discProductCode = (get-itemproperty -path $keypath).productcode
                  return $discProductCode
                  elseif (test-path $keypath -eq 'False') {
                  return "KEY DOES NOT EXIST"
                function checkTempPath {
                if (test-path $global:temppath) {
                  echo $($global:temppath + " exists! Moving on!")
                else {
                  echo $("Server is missing " + $global:temppath + ", lets create it!")
                  new-item -path $global:temppath -itemtype directory
                function uninstall-BladeLogicRSCD ($productCode) {
                #Prep log string
                $ulog = $($global:temppath + "\rscd_uninstall.log")
                #Uninstall BladeLogic
                if ($productCode) {
                  $umsiparams = $("/passive /norestart /x $productCode /log " + $ulog)
                  $uexitCode = (start-process -filepath "msiexec.exe" -ArgumentList $umsiparams -Wait -Passthru).ExitCode
                    if ($uexitCode -eq '0') { echo "BladeLogic RSCD Agent Uninstalled Successfully!" }
                    elseif ($uexitCode -eq '1603') { echo "Server is pending a reboot, please clear the reboot and try again!"; exit }
                  elseif ($uexitCode -eq '1601') { echo "Something is wrong with the Windows Installer service, Check with your System Administrator"; exit }
                    else { echo $("Something didn't go quite right, here is the exit code from msiexec: " + $uexitCode); exit }
                else {
                  echo "Missing product code argument!"
                $blop = $args[0]
                switch ($blop)
                  remove { blremove }
                  help { blshowhelp }
                  default { blshowhelp }
                • 5. Re: Uninstall Windows RSCD Agent
                  Jegavelan Sargunan

                  If you get "This action is only valid for products that are currently installed" you have used an unrecognized product or package code, and you must find the right one. Often this can be caused by using a package code instead of a product code to uninstall - a package code changes with every rebuild of an MSI file, and is the only guid you see when you view an msi file's property page. To find the product code you need to open the MSI. The product code is found in the Property table.

                  You can also find the product code by perusing the registry from this base key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall . Press F3 and search for your product name. (If it's a 32-bit installer on a 64-bit machine, it might be under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall instead).

                  • 6. Re: Uninstall Windows RSCD Agent
                    Jegavelan Sargunan

                    This will work msiexec.exe /qn /x {XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}

                    • 7. Re: Uninstall Windows RSCD Agent
                      young so

                      I have vbscript that numerates the uninstall key and executes the uninstall string using a case statement.  If you interested let me know.

                      • 8. Re: Uninstall Windows RSCD Agent
                        Lavanya Bobba

                        Young So

                        can you please upload the script here? or mail me

                        • 9. Re: Uninstall Windows RSCD Agent
                          young so

                          Please send me message via this site and I send you the script with document on how to use it.

                          • 10. Re: Uninstall Windows RSCD Agent
                            Lavanya Bobba

                            young so

                            I am unable to send direct message, can you mail me to lavanya.bobba@thehartford.com

                            • 11. Re: Uninstall Windows RSCD Agent
                              young so

                              I haven't fotgot.  I'll get it to you.