Cannot uninstall Teams machine wide installer

MasterBlaster 166 Reputation points
2024-02-13T14:03:42.67+00:00

Hi Team, Hope you are doing good. I have created a script to uninstall Teams from per user profile and also Teams machine wide installer, this we are doing as we have to deploy new Teams. Problem is that i am successful in iterating through all user profile and managed to get teams installed on per user basis, problem arises when i try to uninstall Teams machine wide installer. I would like to point out that this issue is reproducible when running the scripting under SYSTEM context either via Intune or via task scheduler. Running the script in User context will not remove Machine wide installer and when i try to uninstall it using SYSTEM context it returns an error code 1605. Looking forward to your response.

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,917 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,895 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,714 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,570 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,883 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Danish Gul Khattak 335 Reputation points
    2024-02-24T04:03:11.5933333+00:00

    The error code 1605 typically indicates that the product is not installed. In the context of uninstalling Teams machine-wide installer with SYSTEM privileges, it might be encountering challenges accessing the necessary registry entries or components. Here are some steps and considerations to help troubleshoot and resolve the issue:

    1. Registry Access: Ensure that your script, running under the SYSTEM context, has sufficient permissions to access and modify registry entries related to Teams machine-wide installer. Permissions might be a common issue when running scripts with SYSTEM privileges.
    2. Logging: Add logging to your script to capture more detailed information about the uninstallation process. This could help identify specific points of failure or if there are any unexpected issues during the uninstallation.
    3. Silent Uninstall: Confirm that your uninstallation command for Teams machine-wide installer is configured for silent or quiet uninstallation. This is important to avoid any user prompts or interruptions during the uninstallation process.
    4. Intune Configuration: If you're using Intune, check the configuration and deployment settings. Ensure that the SYSTEM context has the necessary permissions and that the deployment settings align with your uninstallation requirements.
    5. Error Handling: Implement error handling in your script to capture and display more detailed error messages. This can provide insights into why the uninstallation is failing.
    6. Intune Deployment User: In Intune, check the deployment settings to confirm the user context in which the script is running. Ensure that it is set to run in the SYSTEM context if that is your intended configuration.
    7. Testing with Other Tools: Consider testing the uninstallation with alternative tools or methods. This could include using PowerShell scripts, third-party uninstallation tools, or manual removal procedures to identify if the issue is specific to your script or a broader system-related problem.

    By addressing these considerations and incorporating more detailed logging, you should be able to pinpoint the cause of the 1605 error during the uninstallation of Teams machine-wide installer under the SYSTEM context.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.