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.

solved 0
Ketan Kamble 4 months 11 Answers 278 views Beginner 0

Answers ( 11 )

  1. Hi All ,

    I found the uninstallation string for the application in ComputerHKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionUninstall

    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
  2. 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.

  3. 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

  4. 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.

  5. 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

  6. 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.

  7. 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

  8. 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.

  9. 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:UsersadmmattimaAppDataLocalApps2.0A76D2MD7.Z112Q3KCXAA.915mana…exe…..
    or C:UsersadmmattimaAppDataLocalApps2.0A76D2MD7.Z112Q3KCXAA.915oper…exe….

    Note : Application is visible in appwiz.cpl .

  10. 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:SOFTWAREMicrosoftWindowsCurrentVersionUninstall*’,
    ‘HKLM:SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall*’
    Get-ItemProperty -Path $keys |
    Where-Object { $_.DisplayName } |
    Select-Object -Property DisplayName, DisplayVersion, UninstallString |
    Where-Object { $_.DisplayName -like $DisplayName } |
    Where-Object { $_.UninstallString -like $UninstallString }
    }
    ### END ###

  11. Do you know any entries of the app in the following registry – HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall

    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 a permission to answer to this question .