Uninstall application

Muhammad Zeeshan 100 Reputation points
2024-03-25T14:16:52.51+00:00

I want to uninstall TightVNC software

for detection:

$app = Get-WmiObject -Class Win32_Product -Filter “Name = ‘TightVNC'”

if($app.Name -eq “TightVNC”)

{

Write-host “tightVNC found. Trigger Remediation script to uninstall”

Exit 1

}

else

{

Write-host “tightVNC not found. Computer is compliant”

Exit 0

}

For Remediation: $app = Get-WmiObject -Class Win32_Product -Filter “Name = ‘TightVNC'”

$app.Uninstall()

but its not work c may b first we neeed to stop services and process

and also if we delete some other application is their any general script to use

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,053 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZhoumingDuan-MSFT 13,085 Reputation points Microsoft Vendor
    2024-03-26T02:55:11.36+00:00

    @Muhammad Zeeshan,Thanks for posting in Q&A.

    From your description, I know you want to know why the uninstall remediation script did not work.

    Based on my research, if you want to uninstall an app, you should first stop it and its services, then you can uninstall it manually or using script. However, please be sure the command can uninstall the app properly on the device, and the detection script is correct then you can deploy it via Intune.

    Moreover, you can monitor your script packages and remediation status for a device.

    https://learn.microsoft.com/en-us/mem/intune/fundamentals/remediations#monitor-your-script-packages

    If there is any unclear, feel free to let me know.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.