Click or drag to resize

VCenterGetMachines Method (String, String, String, Boolean, Boolean, ListNetwork)

Read vSphere dates and sets inventory lists. Gives a list of VMs

Namespace:  VMInfoFace
Assembly:  VMInfoFace (in VMInfoFace.dll) Version: 21.5.28.1 (21.5.28.1171)
Syntax
public static List<Machine> GetMachines(
	string pServer,
	string pUserName,
	string pPassword,
	bool pSummary,
	bool pStorageProfile,
	List<Network> pNetworks = null
)

Parameters

pServer
Type: SystemString
Hostname or IP address vCenter Server
pUserName
Type: SystemString
Username to login to vCenter Server
pPassword
Type: SystemString
Password to login to vCenter Server
pSummary
Type: SystemBoolean
Read summary
pStorageProfile
Type: SystemBoolean
Read storage profile
pNetworks (Optional)
Type: System.Collections.GenericListNetwork
Network configuration list for bandwidth

Return Value

Type: ListMachine
List of machine names
Remarks
This method call method SetLists(Inventory)
More details about reads data from vSphere centre and writes to data items see Inventory
Examples
This example read VM machine include field Details as summary of all properties and without network configuration so no sets NetworkBandwidth
// get vSphere server
VMInfoFace.VCenter.GetMachines(vSphereServer, UserName, Password, true);

// read VM machines
List<VMInfoFace.Data.Machine> Machines = VMInfoFace.VCenter.Machines;

// read Datacenters
List<VMInfoFace.Data.Datacenter> Datacenters = VMInfoFace.VCenter.Datacenters;

// read Folders
List<VMInfoFace.Data.Folder> Folders = VMInfoFace.VCenter.Folders;
See Also