Installation Terminal Session Raspbian Buster (Legacy)

Table of Contents

This page shows a terminal session that includes:

  • Install and compile of the legacy wmic command line binary
  • wmic testing

This is all performed on an existing Raspbery Pi running Raspbian Buster.
For this particular machine, there were no additional packages that needed to be installed in order to successfully compile wmic.
Some of the output has been collapsed because it is very large!
Some notes (not part of the original terminal session!) are in blue

Source Extraction

Extract the source (which you already downloaded from this site)

pi:/tmp# tar xzvf wmi-1.4.1.tar.gz

wmi-1.4.1/
wmi-1.4.1/config.log
wmi-1.4.1/config.mk


wmi-1.4.1/heimdal_build/err.h
wmi-1.4.1/heimdal_build/roken.h
wmi-1.4.1/pyinclude.py

Compiling

Now compile the source

pi:/tmp# cd wmi-1.4.1
pi:/tmp/wmi-1.4.1# make “CPP=gcc -E -ffreestanding”

cd Samba/source ; \
cp bin/winexe /bin ; \
cp bin/wmic /bin ; \
cp bin/shared/*async_wmi_lib.so.0* /lib/python
rm -rf /lib/python/pysamba
cp -r pysamba /lib/python

Even though there are many warnings and the entire seems to have errored out, it did actually compile and install wmic, which is what we wanted.

Testing

Show the wmic version

pi:/tmp/wmi-1.4.1# wmic –version

Version 1.4.1tp4-SVN-build-UNKNOWN

Run a generic wmic query

pi:/tmp/wmi-1.4.1# wmic ‘-U’ ‘USER%PASS’ ‘–namespace’ ‘root/cimv2’ ‘//HOST’ ‘Select BuildNumber,Caption,CreationClassName From Win32_OperatingSystem’

CLASS: Win32_OperatingSystem
BuildNumber|Caption|CreationClassName
19042|Microsoft Windows 10 Pro|Win32_OperatingSystem

Build number 19042 is Windows 10 Version 20H2

Updated: April 2021