Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3966846
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:39:00+00:00 2026-05-20T03:39:00+00:00

We use WmiSet to do Wmi Queries on remote machines. It works very well

  • 0

We use WmiSet to do Wmi Queries on remote machines. It works very well in Delphi 2007 but is not currently available for Delphi XE.

I found some code to do Wmi Queries from a previous SO Question Use Wmi with Delphi. The code snippet provided in Answer No. 5 works perfectly well on my local machine, but I need to know if it is possible to execute the Wmi Query on a remote machine.

Even if I connect to the remote machine with my Administrator credentials, I get a EOleSysError: Access is denied exception.

Regards, Pieter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:39:01+00:00Added an answer on May 20, 2026 at 3:39 am

    Pieter. Before to connect to a remote machine using the WMI you must enable the DCOM access to the specified user in the remote machine.

    Read these articles to understand and fix problems connecting to remote machines using the WMI.

    • Securing a Remote WMI Connection
    • Connecting to WMI Remotely Starting with Windows Vista
    • Troubleshooting Error Code 80070005 - Access Denied (great page to find solution about connections problems)

    Additionally here i leave a more clear code to connect to the wmi in a remote machine. check the part where the EOleException exception is processed to get the error code and found the cause of the issue.

    program WMIRemote;
    
    {$APPTYPE CONSOLE}
    
    uses
      SysUtils,
      ActiveX,
      ComObj,
      Variants;
    
    procedure  GetWMIOSInfo(const RemoteMachine,User,Password : string);
    var
      FSWbemLocator : OLEVariant;
      FWMIService   : OLEVariant;
      FWbemObjectSet: OLEVariant;
      FWbemObject   : OLEVariant;
      oEnum         : IEnumvariant;
      iValue        : LongWord;
    begin;
      FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
      FWMIService   := FSWbemLocator.ConnectServer(RemoteMachine, 'root\CIMV2', User, Password);
      FWbemObjectSet:= FWMIService.ExecQuery('SELECT * FROM Win32_OperatingSystem','WQL',0);
      oEnum         := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant;
        while oEnum.Next(1, FWbemObject, iValue) = 0 do
        begin
            Writeln(FWbemObject.Name);
            //code
            FWbemObject:=Unassigned;
        end;
        FWbemObjectSet:=Unassigned;
    end;
    
    begin
     try
        CoInitialize(nil);
        try
          //GetWMIOSInfo('localhost','','');
          GetWMIOSInfo('192.168.52.2','Administrator','password');
        finally
          CoUninitialize;
        end;
     except
        on E:EOleException do
            Writeln(Format('Error Code %d ($%x) Msg : %s',[E.ErrorCode,E.ErrorCode, E.Message]));
    
        on E:Exception do
            Writeln(E.Classname, ':', E.Message);
     end;
     Readln;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use of gradient images is very common among developers for styling a page. Gradient
use strict; my $var = NULL; will raise an error of Bareword NULL not
Use Memcache php class to interact with the memcached. At the beginning all works
Use Selenium a lot, but wondering the folowing question Just a little bit curious,
Use case: I find a piece of code that I do not understand at
Use Case: Admin should be able to create user, and it should not attempt
Use case: we have some project meta-data files which we want tracked, but are
use a reapeter to display data, but sometimes the data is to big to
Use new MediaPlayer by Yahoo. Content parse automatic - greate, but I use ajax
Use of rails 3 recaptcha. In view _form.html.erb insert <%= recaptcha_tags %> But when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.