4

We currently use WmiSet from Online Admin to run Wmi Queries and query registry settings on remote machines.

The problem is that it only supports Delphi up to RAD Studio 2007.

We are currently in the process of upgrading to Delphi XE and need to know if anybody knows of — or has — a more recent version of the WmiSet components or anything similar.

We have tried to contact the vendor but so far there have not been any replies on any of our queries.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Pieter van Wyk
  • 2,316
  • 9
  • 48
  • 65

2 Answers2

7

Pieter, some time ago i start a project called Delphi Wmi Class Generator this project creates full documented Object Pascal classes (compatible with delphi 7 to XE) to access the WMI.

check this code which uses the TWin32_BIOS class (created by the application) to access the Win32_BIOS wmi class in a remote machine.

uses
  SysUtils,
  uWmiDelphiClass in '..\..\uWmiDelphiClass.pas',
  uWin32_BIOS in '..\..\root_CIMV2\uWin32_BIOS.pas';

var
  RemoteBiosInfo : TWin32_BIOS;
  i              : integer;
begin
   try
     RemoteBiosInfo:=TWin32_BIOS.Create(False);
     try

       RemoteBiosInfo.WmiServer:='192.168.217.128';
       RemoteBiosInfo.WmiUser  :='Administrator';
       RemoteBiosInfo.WmiPass  :='password'; 
       RemoteBiosInfo.LoadWmiData;

       if RemoteBiosInfo.WmiConnected then  
       begin
         Writeln('Serial Number       '+RemoteBiosInfo.SerialNumber);
         Writeln('BuildNumber         '+RemoteBiosInfo.BuildNumber);
         if RemoteBiosInfo.BIOSVersion.Count>0 then
         Writeln('Version             '+RemoteBiosInfo.BIOSVersion[0]);
         Writeln('Identification Code '+RemoteBiosInfo.IdentificationCode);
         Writeln('Manufacturer        '+RemoteBiosInfo.Manufacturer);
         Writeln('SoftwareElementID   '+RemoteBiosInfo.SoftwareElementID);
         Writeln('Release Date        '+DateToStr(RemoteBiosInfo.ReleaseDate));
         Writeln('Install Date        '+DateToStr(RemoteBiosInfo.InstallDate));
         Writeln('Target S.O          '+GetTargetOperatingSystemAsString(RemoteBiosInfo.TargetOperatingSystem));
         Writeln('Soft. element state '+GetSoftwareElementStateAsString(RemoteBiosInfo.SoftwareElementState));

         Writeln('');
         Writeln('Bios Characteristics');
         Writeln('--------------------'); 
         for i:=Low(RemoteBiosInfo.BiosCharacteristics)  to High(RemoteBiosInfo.BiosCharacteristics) do
          Writeln(GetBiosCharacteristicsAsString(RemoteBiosInfo.BiosCharacteristics[i]));
       end
       else
       Writeln('No connected');
     finally
      RemoteBiosInfo.Free;
     end;
   except
    on E:Exception do
     Writeln(E.Classname, ': ', E.Message);
   end;

 Readln;
end.
RRUZ
  • 134,889
  • 20
  • 356
  • 483
2

converting the WMISet library to Unicode Delphi is not too difficult. I've done the conversion to Delphi 2009 and 2010, and the compiler points you towards those lines of code that need changing. If I find the time I'll prepare a "diff" between the original code and the changed one for UniCode Delphi and upload it.

Regards, Olaf

Olaf Hess
  • 1,453
  • 11
  • 18
  • Olaf. That would be most helpful. Thank you. – Pieter van Wyk Mar 04 '11 at 08:20
  • I've finally found the time to create the DIFF files and uploaded them to Torry.net: [link](http://www.torry.net/pages.php?id=243&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+TorrysDelphiPagesNewsComponents+%28Torry%27s+Delphi+Pages+News%3A+Components%29#940213). Please test thoroughly before deploying to production. – Olaf Hess Mar 24 '11 at 09:11
  • Olaf. Thank you very much for the diff files. Everything worked ok and we now have WMISet installed into Delphi XE. Regards. – Pieter van Wyk Mar 24 '11 at 16:48