PowerCLI Reference

Get-CIVM

Synopsis

This cmdlet retrieves virtual machines in the cloud.

Syntax

Get-CIVM -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>]

Get-CIVM [[-Name] <String[]>] [-Org <Org[]>] [-OrgVdc <OrgVdc[]>] [-OrgVdcNetwork <OrgNetworkBase[]>] [-Server <CIServer[]>] [-Status <CIVAppStatus[]>] [-VApp <CIVApp[]>] [<CommonParameters>]

Related Commands

Online Version
Start-CIVM
Stop-CIVM
Suspend-CIVM
Start-CIVMGuest
Stop-CIVMGuest

Detailed Description

This cmdlet retrieves virtual machines in the cloud and filters them by the provided parameters.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the name of the cloud virtual machines you want to retrieve.falseFalse
IdString[]Specifies the IDs of the cloud virtual machines you want to retrieve.


Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
trueFalse
OrgOrg[]Specifies from which organizations you want to retrieve virtual machines.falseTrue (ByValue)
OrgVdcOrgVdc[]Specifies the organization vDCs for which you want to retrieve virtual machines.falseTrue (ByValue)
OrgVdcNetworkOrgNetworkBase[]Specifies the organization vDC networks to which the virtual machines are connected.falseTrue (ByValue)
ServerCIServer[]Specifies the cloud servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-CIServer.falseFalse
StatusCIVAppStatus[]Specifies the status of the virtual machines you want to retrieve.falseFalse
VAppCIVApp[]Specifies the vApps to which the virtual machines you want to retrieve belong.falseTrue (ByValue)

Return Type

Zero or more CIVM objects

Notes

Examples

-------------------------- Example 1 --------------------------

Get-CIVM

Gets all visible virtual machines for the current user.

-------------------------- Example 2 --------------------------

Get-CIVM -Name "MyVM"

Gets a single virtual machine by its name.

-------------------------- Example 3 --------------------------

Get-CIVApp -Name "*DB*"

Gets all virtual machines that match a defined string by name.

-------------------------- Example 4 --------------------------

Get-CIVM -ID $myVMId

Gets a virtual machine with a given ID.

-------------------------- Example 5 --------------------------

Get-CIVM -Org "MyOrganization"

Gets all visible virtual machines within an organization.

-------------------------- Example 6 --------------------------

Get-CIVM -OrgNetwork "OrgNetwork1"

Gets all visible virtual machines within an organization network.

-------------------------- Example 7 --------------------------

Get-OrgNetwork -Name "OrgNetwork1" | Get-CIVM

Gets all visible virtual machines within an organization network (pipeline).

-------------------------- Example 8 --------------------------

Get-CIVM -OrgVdc "MyOrgVDC1"

Gets all visible virtual machines within an organization's virtual datacenter.

-------------------------- Example 9 --------------------------

Get-OrgVdc -Name "OrgVdc1" | Get-CIVM

Get all visible virtual machines within an organization's virtual datacenter by using a pipeline syntax.

-------------------------- Example 10 --------------------------

Get-CIVM -VApp "MyVApp"

Gets virtual machines running a particular VApp.

-------------------------- Example 11 --------------------------

Get-CIVApp "MyVApp" | Get-CIVM

Gets virtual machines running a particular VApp (pipeline).

-------------------------- Example 12 --------------------------

Get-CIVM -Status "PoweredOn", "Suspended"

Gets virtual machines by status (all powered on and suspended VMs).


Copyright © VMware, Inc. All rights reserved.