Uninstall software on remote computers using WMIC

Recently, I wanted to install Nokia Ovi Suite to several computers in a company that started to have problems with their internet provider; it’s a third day when they do not have internet connection. So I thought it’s a good idea to show them how they can use their Nokia E72 phones to connect their laptops to internet.

Well, prior to installing Nokia Ovi Suite I had to uninstall old versions of Nokia PC Suite from 4 systems, remotely. I decided to do it using WMIC instead of ConfigMgr as the Nokia PC Suite was installed on small number of computers. After this, I can proceed with installing Ovi Suite using ConfigMgr. Till then, here is how I uninstalled PC Suite using WMIC.

  1. In a command prompt window, type Runas /user:YourUsername@UPNsuffix cmd.exe (or Runas /user:domain\username cmd.exe) where YourUsername is your domain admin username or any username with admin privileges on the remote computer and UPNsuffix is your UPN suffix. Let’s suppose I use [email protected]
  2. In the command prompt window type the password for user [email protected] and press Enter
  3. Type WMIC
  4. Now, list all Nokia software on a specific computer using the command /node:COMPUTERNAME product where vendor=”Nokia” get name, version
  5. Once we know the software name, we can uninstall specific product using the following command /node:COMPUTERNAME product where name=”Nokia PC Suite” call uninstall. You will see a message like Execute (\\COMPUTERNAME\ROOT\CIMV2:Win32_Product.IdentifyingNumber=”{225DB4AA-3CFF-47E8-B3C8-6DAD713E986E}”,Name=”Nokia PC Suite”,Version=”7.1.51.0″)->Uninstall() (Y/N/?)?
    Type Y and wait for the result.
  6. To make sure Ovi Suite will install successful, I’m going to uninstall all Nokia software (except the runtime) using the same command just replacing the software name.
  7. Now, I can proceed and install Nokia Ovi Suite 3.1.1.78 using ConfigMgr Software Distribution method. By the way, program’s command line for silent install is Nokia_Ovi_Suite_webinstaller_ALL.exe /SILENT=”1″

If vendor name contains spaces, use the following example: wmic product where vendor=”Microsoft Corporation” get name

Uninstall KB 2823324 using ConfigMgr

  1. Create a CMD file with the following content
    @echo off

    :: - - - - - Check if KB is installed - - - - - - - -

    systeminfo | findstr 2823324

    :: - - - - - If not installed (1), exit - - - - - - -

    IF %errorlevel% EQU 1 GOTO NOTFOUND

    GOTO FOUND

    :NOTFOUND

    Echo %date% - %time% KB 2823324 was not found. Exit. >> C:\Windows\Temp\Microsoft_Uninstall_Patch_KB2823324.log

    GOTO EXIT

    :: - - - - - If installed (0), uninstall - - - - - - -

    :FOUND

    Echo %date% - %time% KB 2823324 was found. Attempt uninstall. >> C:\Windows\Temp\Microsoft_Uninstall_Patch_KB2823324.log

    wusa.exe /uninstall /kb:2823324 /quiet /norestart /log:C:\Windows\Temp\Microsoft_Uninstall_Patch_KB2823324_WUSA.log

    Echo %date% - %time% KB 2823324 uninstall complete. Restart might be needed for operation to complete successfully. >> C:\Windows\Temp\Microsoft_Uninstall_Patch_KB2823324.log

    :EXIT

  2. Deploy this CMD file by creating a new package and program. Keep in mind that a restart is required to fully uninstall this patch.