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

Problem installing WSUS on a remote SQL server.

Today I again learned a lesson I knew for some time but was hoping that I can forget it. The lesson was about: “Trust anyone. Test for yourself.”

Having to install WSUS on a remote SQL 2005 that had WSUS database installed before, I asked one SQL guy if renaming the old WSUS database is enough to install a new WSUS DB. He said “yeah, sure!”. Ok then, I started installing WSUS.

Needless to say, installation failed:

There is a problem with the windows installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package.

Two hours of troubleshooting permission and connection problems, made me read all WSUS installation log files located in “X:\Users\username\AppData\Local\Temp”. One of the file was 1 KB size so it does not contain much info. Anyway, the file content was:

Changed database context to 'master'.
Msg 1802, Level 16, State 4, Server SQL-SERVER-NAME,  Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5170, Level 16, State 1, Server SQL-SERVER-NAME,  Line 2
Cannot create file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SUSDB.mdf' because it already exists. Change the file path or the file name, and retry the operation.
Changed database context to 'master'.

One specific line says it all… “Cannot create file … because it already exists”

I guess when doing something, you have to test for yourself everything. Lesson learned. Again.

Remote Server Admin Tools for Windows 7

Some time ago I used Admin Tools and RSAT for Vista and it saved my time from using remote desktop to log on to several servers. Now it is available (RTM, not RC or something…) for Windows 7 x86/x64.

Using RSAT for Win7, you can manage the following roles and features from Windows Server 2008 R2, 2008 and 2003:

After installing it, you can enable the roles and features you want to manage, by doing the following steps:

  1. Click Start, click Control Panel, and then click Programs.
  2. In the Programs and Features area, click Turn Windows features on or off.
  3. If you are prompted by User Account Control to enable the Windows Features dialog box to open, click Continue.
  4. In the Windows Features dialog box, expand Remote Server Administration Tools.
  5. Select the remote management tools that you want to install.
  6. Click OK.

Now you’ll find the tools in Administrative Tools menu.