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 6735449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:00:40+00:00 2026-05-26T11:00:40+00:00

Is there any component or class that allows me to get the status of

  • 0

Is there any component or class that allows me to get the status of all VMs running on Hyper-v? I want to be able to list all vms and their state (stopped, running, paused, etc.).

I know microsoft has WMI methods, but all the samples I got are for .Net and none for Delphi. I should be able to convert those classes do Delphi, but it would be easier if i could use something already for Delphi.

EDIT

I have a sample in C#:

/

/ define the information we want to query - in this case, just grab all properties of the object
ObjectQuery queryObj = new ObjectQuery("SELECT * FROM Msvm_ComputerSystem");

// object for storing WMI connection options
// pass the "user", "password" and "domain" from command-line
// don't hard-code these into the application!
ConnectionOptions connOpts = new ConnectionOptions();
connOpts.Username  = user;
connOpts.Authority = "ntlmdomain:" + domain;
connOpts.Password  = password;

// management scope object
ManagementScope manScope = new ManagementScope(@"\\RemoteSystem\root\virtualization", connOpts);

// connect and set up our search
ManagementObjectSearcher vmSearcher = new ManagementObjectSearcher(manScope, queryObj);
ManagementObjectCollection vmCollection = vmSearcher.Get();

// loop through the VMs
foreach (ManagementObject vm in vmCollection)
{
    // display VM details
    Console.WriteLine("\nName: {0}\nStatus: {1}\nDescription: {2}\n",
                      vm["ElementName"].ToString(),
                      vm["EnabledState"].ToString(),
                      vm["Description"].ToString());
}

I tried to run this on Visual Studio to see if it works so I can try to translate it to Delphi. But even though i change the username, domain and password I still got this error:

{"The RPC server is not available. (HRESULT: 0x800706BA)"}
  • 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-26T11:00:41+00:00Added an answer on May 26, 2026 at 11:00 am

    There’s free Delphi code for accessing WMI at Magenta Systems, in MagWMI. It comes with full source, including a demo app that lets you run WMI queries. It’s current web page (linked above) says it’s compatible with current Windows (and Delphi) versions.

    I don’t know if it specifically works with virtualization, but it will at least give you the start of using WMI from Delphi code. (EDIT: It appears that the demo is documented as only working on the local computer so that fewer parameters have to be passed, to make the demo more understandable. It still shows the basics of using WMI with Delphi, however, so it should get you on your way.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any free or commercial component written in .NET (no COM interop) that
I'm making a program that allows you to add any class file that extends
In my project there's a common base class that all client classes extend. This
Is there any .NET data structure/combination of classes that allows for byte data to
is there any Flex component displaying tag clouds ? (Each array item is composed
I need to get the name of class that represents the Java SWT/JFace UI
is there any way to create a custom css value for a component and
Is there any way to tell MigLayout to ignore a component's height? Here's a
Is there any way to adjust height and width of a custom component using
Are there any scheduling components, commercial or otherwise, for ASP.Net MVC? Our company currently

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.