Uninstall the software which is installed in User context

Question

Hi Experts ,

I would like to uninstall application with the help of SCCM power shell script from 5000 machines which is installed in User context , can you please let me know how I can proceed with that ?
Below Command is not showing the application :
Get-WmiObject -Class Win32_Product | Select-Object -Property Name

But the same application is installed on user machine.

Answers ( 11 )

    1
    2020-06-10T17:49:28+05:30

    Hi All ,

    I found the uninstallation string for the application in Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall

    I created a small batch file and then deployed the application.

    Thanks all for your inputs it really helped me.

    This thread can be closed as solved 🙂

    Best answer
    0
    2020-06-02T20:06:14+05:30

    If you are sure that machine contains a reg information for the user hive, you can do a query to remove that application with user hive.

    U need to get the current logged on user in the machine and get the SID of that user, navigate to the reg path where uninstall key present for the user hive with SID.

    May be one more way is that we need to have a actual application that created earlier and use the same application for uninstall and deploy to user based deployment, this need to be test just a thought.

    0
    2020-06-02T18:22:10+05:30

    Hi,

    Do you have other deployment tool in your organisation like systrack?
    You can simply use uninstall string with silent switch is enough to remove the user based application on end user machines but the execution should be happened on current logon user context profile.

    Thanks.
    Karthikeyan

    0
    2020-06-02T18:03:53+05:30

    Thanks Karthikeyan for your detailed explanation ,I definitely learned the background behavior of SCCM

    But to complete the task , it will be great if you share any script which will uninstall the software in user context . so that I can try with group policy or schedule task.

    1
    2020-06-02T17:58:09+05:30

    Hi,

    Even if i share the powershell script or any other script to uninstall the application on user based profile. While deploying this script via sccm tool by default again it use system context to uninstall the application on user machines.

    SCCM by default use system context to install or uninstall any application on end user machines.

    Thanks
    Karthikeyan

    0
    2020-06-02T17:49:28+05:30

    Can you please recommend any script to uninstall this kind of software , so i can try to uninstall by using powershell function in SCCM or by using group policy we can remove.

    1
    2020-06-02T16:33:01+05:30

    Hi,

    As mentioned by Harjit. SCCM use system context to query the list of application installed information on client side using hardware inventory method. using HKLM and HKCU(system account) only collected via SCCM hardware inventory report. For user based profile installed applications sccm doesn’t have capable as of now.

    Thanks
    karthikeyan

    1
    2020-06-02T14:48:42+05:30

    ConfigMgr Hardware Inventory does not detect applications installed in user context.

    ConfigMgr inventory task uses the local system account to inventory software titles. With that said, only software listed within the HKLM or the HKCU for the local system account profile is inventoried and then displayed. When users install software within their user profile, it is stored within HKCU for that user. The local system account doesn’t have access to the other users’ HKCU profiles, so it can’t report on software titles that it cannot access.

    1
    2020-06-02T13:17:16+05:30

    Hi ,

    I am not able to see the app when i run the command : Get-WmiObject Win32Reg_AddRemovePrograms -Filter “DisplayName like ‘$App’” -ComputerName “$Com”.

    Application installation path is like this :
    C:\Users\admmattima\AppData\Local\Apps\2.0\A76D2MD7.Z11\2Q3KCXAA.915\mana…exe…..
    or C:\Users\admmattima\AppData\Local\Apps\2.0\A76D2MD7.Z11\2Q3KCXAA.915\oper…exe….

    Note : Application is visible in appwiz.cpl .

    1
    2020-06-02T10:17:19+05:30

    It also depends on how the application is developed for installation or installation.
    If the application is simply extracting files in a folder than you may not see more information.
    Nevertheless, I use below function to find application’s uninstall string.

    1. Start PowerShell with elevated priv.
    2. Copy below function and run the script, the function will get loaded in the shell.
    3. Then type following cmdlet: Get-Software -DisplayName “your app name”
    4. The result will show if there is any app registered.
    5. Also try using * as wildcard and go through the list once incase your app is registered with different name.

    ### START ###
    function Get-Software
    {
    param
    (
    [string]
    $DisplayName=’*’,
    [string]
    $UninstallString=’*’
    )
    $keys = ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*’,
    ‘HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*’
    Get-ItemProperty -Path $keys |
    Where-Object { $_.DisplayName } |
    Select-Object -Property DisplayName, DisplayVersion, UninstallString |
    Where-Object { $_.DisplayName -like $DisplayName } |
    Where-Object { $_.UninstallString -like $UninstallString }
    }
    ### END ###

    1
    2020-06-02T09:20:27+05:30

    Do you know any entries of the app in the following registry – HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    Also try

    ===============

    $App = Read-Host “Which Program do you want to find?”
    $Com = Read-Host “What is the name of the remote host?”

    $Search = Get-WmiObject Win32Reg_AddRemovePrograms -Filter “DisplayName like ‘$App'” -ComputerName “$Com”
    If ($Search -ne $null){
    Write-Host $Search.DisplayName
    }
    else
    {
    Write-Host “not found”
    }

    =====================

Leave an answer

Sorry, you do not have permission to answer to this question .