Troubleshooting issues with the "Uninstall Specific App by Name" Worklet

Troubleshooting issues with the "Uninstall Specific App by Name" Worklet

Having trouble uninstalling an application using the "Uninstall Specific App by Name" Worklet from the Automox Worklet Catalog? This guide will help you resolve common issues step-by-step.

Symptoms

You may encounter the following issues when attempting to uninstall an application:

  1. COMMAND TIMED OUT: The Activity Log shows this error.
  2. Evaluation Code Failure: The application is not detected as installed.
  3. Remediation Code Ineffectiveness: The application is not uninstalled successfully.

Steps to Resolution

1. Verify Application Name

Ensure that the application name matches exactly as it appears in Apps & Features in Windows 10:

  • Open Settings > Apps > Apps & Features.
  • Locate the application and confirm the name matches the one used in the worklet's script.

2. Test the Remediation Code Locally

To verify the Remediation Code:

  • Run the code on your local machine.
  • Note: Worklets execute as NT AUTHORITY/SYSTEM, so you may need to adjust registry paths. For instance:
    • Replace sysnative with syswow64 if appropriate.

Example Codes

Evaluation Code:

$scriptBlock = {

    $appName = ''

    $uninstReg = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall')

    $installed = @(Get-ChildItem $uninstReg -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {($_.DisplayName -like $appName)})

    if ($installed)

    {

        return 1

    }

    else

    {

        return 0

    }

}

 

Remediation Code:

$scriptBlock = {

    $appName = ''

    $exeCmd = '/S'

    $uninstReg = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall')

    $installed = @(Get-ChildItem $uninstReg -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {($_.DisplayName -like $appName)})

    foreach ($version in $installed)

    {

        $uninstString = $version.UninstallString

        Start-Process $uninstString -ArgumentList $exeCmd -Wait -PassThru

    }

}

3. Check the Registry Path

If the code doesn't work:

  1. Open RegEdit.
  2. Search for the application name.
  3. Confirm the registry path matches the one used in the worklet.

For example, Veritas NetBackup Client may require a unique uninstall method provided on its Support Site.

 

4. Check Uninstallation Support with Automox API

Use the is_uninstallable field in the GetDevicePackages API call to determine if the application supports uninstallation. Refer to the Automox API documentation for detailed instructions.

 

Additional Notes

  • Some applications, like Veritas NetBackup Client, have unique uninstall requirements and cannot be removed using standard methods.
  • For rollback options, refer to How to Roll Back an Installed Patch.
Was this article helpful?
0 out of 0 found this helpful