Previous Topic: dpmhv-ShowDirectories (Funclet) Command--Show all DirectoriesNext Topic: dpmhv-ShowLogicalDisks (Funclet) Command--Show all Logical Disks


dpmhv-ShowHosts (Funclet) Command--Show all Hyper-V Servers

The dpmhv-ShowHosts command displays all Hyper-V Servers.

This command has the following format:

dpmhv-showHosts 
[-detail]
[-retval] 
[-silent]
-detail

(Optional) Displays the details of the virtual networks (host networks).

-retval

Returns a value for further processing.

-silent

Specifies not to direct the output to the screen.

Return Value

The dpmhv-ShowHosts command returns an array of objects representing Hyper-V Servers. The property, "Name" is returned in the regular mode.

The following properties are returned in detail mode:

Example: Show all Hyper-V Servers

This example returns a list of Hyper-V Servers.

dpmhv-showHosts

Example: Show all Hyper-V Servers and VMs on a Host

This example displays a list of Hyper-V Servers and displays VMs on each host.

a = dpmhv-showHosts -retval -silent
    for each(h in a)
    {
      ?
      ? "Host:", h.Name
      dpmhv-showVMs -host (h.Name)
    }