Get-SCVirtualMachine

Gets virtual machine objects.

Description

The Get-SCVirtualMachine cmdlet gets one or more virtual machine objects from the System Center Virtual Machine Manager (VMM) database. A virtual machine can be deployed on a virtual machine host or can be stored in the VMM library.

For more information about Get-SCVirtualMachine, type: "Get-Help Get-SCVirtualMachine -online".

Parameters

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

All

Required? false
Accept Pipeline Input? false
Position? named
Retrieves a full list of all subordinate objects independent of the parent object. For example, the command Get-SCVirtualDiskDrive -All retrieves all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

Cloud

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a private cloud object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

ComputerTier

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a computer tier object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

ID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the numerical identifier (as a globally unique identifier, or GUID) for a specific object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

Service

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM service object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

VMHost

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts. 

For more information about each type of host, type: "Get-Help Add-SCVMHost -detailed". See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Examples

1: Get all virtual machines and display information about each one.
PS C:\> Get-SCVirtualMachine -VMMServer "VMMServer01.Contoso.com"
This command gets all virtual machine objects on VMMServer01 and displays information about these virtual machine objects to the user.
2: Get all virtual machines and display information about specific properties.
PS C:\> Get-SCVirtualMachine -VMMServer "VMMServer01.Contoso.com" | Format-List -property Name, Owner, Description, HostName, OperatingSystem, CPUCount, Memory
This command gets all virtual machine objects on VMMServer01 and displays the values of the specified properties to the user.
3: Get a virtual machine by name that is stored on a specified library server.
PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> Get-SCVirtualMachine | where { $_.Name -eq "VM02" -and $_.LibraryServer -eq "LibraryServer01" } | select Name,LibraryServer,Status
The first command connects to VMMServer01.

The second command gets the virtual machine object named VM02 stored on LibraryServer01 and then displays the virtual machine name, the name of the library server, and the status of the virtual machine to the user.
4: Get all virtual machines on the specified host.
PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> Get-SCVirtualMachine -VMHost "VMHost01.Contoso.com"
The first command connects to VMMServer01.

The second command gets all virtual machine objects deployed on VMHost01 and displays information about these virtual machines to the user.

See Also