Documente Academic
Documente Profesional
Documente Cultură
Add-CIDatastore
Synopsis
This cmdlet adds one or more datastores to a provider virtual datacenter (vDC). Syntax Add-CIDatastore -Datastore <Datastore[]> [-ProviderVdc] <ProviderVdc> [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Get-CIDatastore Online version Detailed Description This cmdlet adds one or more datastores from a vCenter Server system to a provider virtual datacenter (vDC). Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ProviderVdc Confirm
ProviderVdc SwitchParameter
Specifies the provider vDC to which you want to add the datastore. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies one or more datastores from a vCenter Server system that you want to add to a provider vDC. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
false false
Datastore Server
Datastore[] CIServer[]
true false
SwitchParameter
false
false
One or more CIDatastore objects Notes You can run this cmdlet only against vCloud Director 1.5.x environments. Examples -------------- Example 1 -------------G e t D a t a s t o r eN a m e* c l o u d *|A d d C I D a t a s t o r eP r o v i d e r V d c' M y P r o v i d e r V d c ' Adds all datastores with names that contain "cloud" to the specified provider vDC.
Add-DeployRule
Synopsis
Adds one or more rules to the rule set. Syntax Add-DeployRule [-DeployRule] <DeployRule[]> [[-At] <UInt32>] [-NoActivate] [<CommonParameters>] Related Commands Get-DeployRule New-DeployRule Remove-DeployRule Detailed Description Adds one or more rules to the working rule set and then activates the working rule set. The rule can be added at a specific index with the "-At" option, otherwise it is added to the end. If you plan on making several changes to the rule set, you can pass the "-NoActivate" option to avoid activing the rule set after every change. A rule set is an ordered list of rules that determines what items, such as a host profile, should be associated with a host. For each type of item, AutoDeploy will find a matching rule and select the item specified in that rule. If more than one rule matches a host and the rules contain the same type of item, the item from the rule that comes first in the rule set will be used. This behaviour makes it possible to write a single generic rule that matches many hosts and then write more specific rules to override settings for specialized hosts. The working rule set can be used to test out changes to the rule set against hosts in vCenter Server. Once you are satisfied with the rules, you can activate the working rule set to control how any new hosts that are unknown to vCenter Server will be deployed. You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DeployRule At
DeployRule[] UInt32
Rule(s) to add to the rule set. You can pass a DeployRule object here or the name of the rule. Index in the rule set where you want to add the rule. The placement of the rule in the set determines its priority. Lower indexes have a higher priority. Specify this parameter to add the rule to the working rule set but not to the active rule set. By default, the working rule set is activated after the change.
true false
NoActivate
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
1/287
7/8/13
Return Type VMware.DeployAutomation.Types.DeployRuleSet Notes Examples -------------- Example 1 -------------C : \ P S >G e t D e p l o y R u l e" t e s t r u l e "|A d d D e p l o y R u l e
Get a rule named "testrule" and add it to the end of the rule set. -------------- Example 2 -------------C : \ P S >A d d D e p l o y R u l et e s t r u l eA t0 Add a rule named "testrule" to the beginning of the rule set.
Add-EsxSoftwareDepot
Synopsis
Syntax Add-EsxSoftwareDepot [-DepotUrl] <String[]> [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>] Related Commands Detailed Description Adds an ESX software depot or offline depot ZIP file to the current PowerCLI session. Use this cmdlet right after you start Image Builder by adding the Image Builder snap-in. The cmdlet imports metadata from the specified depots. You can then create new image profiles and generate ISOs from the image profiles and VIBs in the depots. The metadata from the depots is kept in memory until the PowerCLI session ends. When you run the cmdlet, Image Builder downloads and parses the metadata from the depot and analyzes the VIBs for dependencies. The depot will be added to the list of depots maintained in the implicit session variable $DefaultSoftwareDepots that stores all software depots (similar to $DefaultVIServers). If the software depot was previously added, metadata from the depot will be downloaded again. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DepotUrl
String[]
Either a string or an array of strings; each string represents the URL of a depot or a file path to an offline depot ZIP file. The offline depot ZIP file must have the .zip extension.
true
ActionPreference String
false false
---------- Example 1 ---------A d d E s x S o f t w a r e D e p o th t t p : / / w w w . v m w a r e . c o m / g o / E S X i / p a t c h e s / Connect to a depot. ---------- Example 2 ---------$ d e p o t=A d d E s x S o f t w a r e D e p o th t t p : / / w w w . v m w a r e . c o m / g o / E S X i / p a t c h e s / Connect to a depot, saving it to a variable.
Add-EsxSoftwarePackage
Synopsis
Syntax Add-EsxSoftwarePackage [-ImageProfile] <ImageProfile> [-SoftwarePackage] <SoftwarePackage[]> [-Force] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description Adds new VIBs to an image profile or updates existing VIBs in an image profile. For each package, if it is newer or older than an existing package in the profile, the existing package will be replaced. Image Builder performs all image profile validation tests on the modified image profile. The output of this cmdlet may be piped into any other cmdlet taking image profiles as input.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
2/287
7/8/13
Note that the image profile object that is passed in will have its VibList modified. Please see the New-EsxImageProfile cmdlet for details about persistence of image profiles. Modification is not possible if the ReadOnly property of an ImageProfile is true. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ImageProfile
ImageProfile
(pipeline input, prompt) Image profile to edit. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or the Name property of any ImageProfile object *ImageProfile object
true
SoftwarePackage
SoftwarePackage[]
(pipeline input, prompt) List of software packages to add to the profile. Takes one of the following forms: *Name of a VIB, as displayed in the Name column of GetEsxSoftwarePackage, or the Name property of any SoftwarePackage object. Image Builder selects the highest available version of the named package. *"<Name> <Version>", for specifying a specific version of a VIB. *SoftwarePackage object *GUID of the VIB (from the Guid property of a SoftwarePackage object) *A list containing a mix of any of the above If more than one vendor provides a package with the same name, then a non-terminating error results and the cmdlet skips that package.
true
Confirm Force
SwitchParameter SwitchParameter Installs packages that break extensibility rules such as standard file path. Also bypasses dependency checks on packages. Use this option with care. Because it bypasses standard validation checks, an invalid image profile might result.
false false
false false
---------- Example 1 ---------A d d E s x S o f t w a r e P a c k a g eI m a g e P r o f i l e" M yc u s t o mp r o f i l e "S o f t w a r e P a c k a g en e t b n x 2 Add a package by name to an image profile: ---------- Example 2 ---------A d d E s x S o f t w a r e P a c k a g eI m a g e P r o f i l e" M yc u s t o mp r o f i l e "S o f t w a r e P a c k a g e" n e t b n x 21 . 6 . 7 0 . 1 O E M 1 " Add a package of a specific name and version: ---------- Example 3 ---------N e w E s x I m a g e P r o f i l eC l o n e P r o f i l e" E S X 5 . 0 2 3 4 5 6 7 s t a n d a r d "N a m e" M yc u s t o mp r o f i l e "|\ A d d E s x S o f t w a r e P a c k a g en e t b n x 2 Clone an image profile, then add a package by name, in one line using pipelining:
Add-PassthroughDevice
Synopsis
This cmdlet attaches pass-through devices to the specified virtual machine. Syntax Add-PassthroughDevice [-VM] <VirtualMachine[]> [-PassthroughDevice] <PassThroughDevice[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-PassthroughDevice Remove-PassthroughDevice Detailed Description This cmdlet attaches pass-through devices to the specified virtual machine. Note that the value of the ControllerKey property of the returned device might not be up to date, if a new SCSI controller creation process is running in the background.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
3/287
7/8/13
Parameters
NA ME TYPE
VM PassthroughDevice Confirm
Specifies the virtual machine to which you want to attach the passthrough devices. Specifies the passthrough devices you want to add to the virtual machine. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more newly added PassthroughDevice objects Notes Passing PciPassthroughDevice objects to the Device parameter is supported o nly on servers that are vCenter Server 4.0 and ESX 4.0, and higher. Examples -------------- Example 1 -------------$ s c s i D e v i c e L i s t=G e t P a s s t h r o u g h D e v i c eV M H o s tH o s tT y p eS c s i A d d P a s s t h r o u g h D e v i c eV M$ v mP a s s t h r o u g h D e v i c e$ s c s i D e v i c e L i s t [ 0 ] Adds the first SCSI passthrough device of the Host host to the $vm virtual machine.
Add-VDSwitchPhysicalNetworkAdapter
Synopsis
This cmdlet adds host physical network adapters to a distributed switch. Syntax Add-VDSwitchPhysicalNetworkAdapter [-VMHostNetworkAdapter] <PhysicalNic[]> [-DistributedSwitch] <DistributedSwitch> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Remove-VDSwitchPhysicalNetworkAdapter Detailed Description This cmdlet adds host physical network adapters to a distributed switch. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the host physical network adapters that you want to add to the distributed switch. Specifies the distributed switch to which you want to add the host physical network adapter. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ v m h o s t N e t w o r k A d a p t e r=G e t V M H o s t" M y V M H o s t "|G e t V M H o s t N e t w o r k A d a p t e rP h y s i c a lN a m ev m n i c 2 G e t V D S w i t c h" M y V D S w i t c h "|A d d V D S w i t c h P h y s i c a l N e t w o r k A d a p t e rV M H o s t N e t w o r k A d a p t e r$ v m h o s t N e t w o r k A d a p t e r Retrieves the specified physical network adapter from the specified host and adds it to the specified distributed switch.
7/8/13
Add-VDSwitchVMHost
Synopsis
This cmdlet adds hosts to the specified distributed switch. Syntax Add-VDSwitchVMHost -VDSwitch <VDSwitch> -VMHost <VMHost[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Remove-VDSwitchVMHost Detailed Description This cmdlet adds hosts to the specified distributed switch. The physical network adapters of the hosts are not connected to the distributed switch. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies the distributed switch to which you want to add one or more hosts. Specifies the hosts that you want to add to the distributed switch. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
-------------- Example 1 -------------G e t V D S w i t c hN a m e" M y D i s t r i b u t e d S w i t c h "|A d d V D S w i t c h V M H o s tV M H o s t" V M H o s t 1 " ," V M H o s t 2 " Adds two hosts to the specified distributed switch.
Add-VMHost
Synopsis
This cmdlet adds a host to be managed by a vCenter Server instance. Syntax Add-VMHost [-Name] <String> [-Port <Int32>] [-Location] <VIContainer> [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-Force] [-RunAsync] [Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHost Move-VMHost Remove-VMHost Restart-VMHost Set-VMHost Start-VMHost Stop-VMHost Suspend-VMHost Detailed Description This cmdlet adds a host to be managed by a vCenter Server instance. The host is added to the datacenter or folder specified by the Location parameter. One of the User/Password and Credential parameters must be provided in order to authenticate with the host. If both are specified, the Credential parameter is used and the User and Password parameters are ignored. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the name of the host you want to add to a vCenter Server instance. Specifies a datacenter or folder where you want to place the host. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a PSCredential object that contains credentials for authenticating with the virtual machine host. Indicates that the cmdlet runs even if the authenticity of the host SSL certificate cannot be verified.
Credential Force
PSCredential SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
5/287
7/8/13
Password Port String Int32
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the user name you want to use for authenticating with the host. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Server
VIServer[]
false
false
String SwitchParameter
false false
false false
The newly added VMHost object Notes Add-VMHost works only if there is a connection to vCenter Server. Examples -------------- Example 1 -------------$ m y S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 A d d V M H o s tS e r v e r$ m y S e r v e rN a m eM y V M H o s t 1L o c a t i o nM y D a t a c e n t e r 1U s e rM y U s e r n a m e 1P a s s w o r dM y P a s s w o r d 1 Adds a VM host to a specified vCenter Server system and provides a username and password for authentication. -------------- Example 2 -------------$ m y C r e d e n t i a l s=G e t V I C r e d e n t i a l S t o r e I t e mF i l e" C : \ M y C r e d e n t i a l s . x m l " $ m y S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 A d d V M H o s tS e r v e r$ m y S e r v e rN a m eM y V M H o s t 1L o c a t i o nM y D a t a c e n t e r 1C r e d e n t i a l s$ m y C r e d e n t i a l s Adds a VM host to a vCenter Server system and specifies a PSCredential object that contains authentication credentials. -------------- Example 3 -------------$ m y C r e d e n t i a l s=G e t V I C r e d e n t i a l S t o r e I t e mF i l e" C : \ M y C r e d e n t i a l s . x m l " $ m y S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 A d d V M H o s tS e r v e r$ s e r v e rN a m eM y V M H o s t 1L o c a t i o nM y D a t a c e n t e r 1C r e d e n t i a l s$ m y C r e d e n t i a l sP o r tM y V M H o s t P o r t N u m b e r 1C o n f i r m : $ f a l s e Adds a VM host to a vCenter Server system without asking for confirmation and specifies a port on the host for connecting. -------------- Example 4 -------------$ m y C r e d e n t i a l s=G e t V I C r e d e n t i a l S t o r e I t e mF i l e" C : \ M y C r e d e n t i a l s . x m l " $ m y S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 A d d V M H o s tS e r v e r$ m y S e r v e rN a m eM y V M H o s t 1L o c a t i o nM y D a t a C e n t e r 1C r e d e n t i a l s$ m y C r e d e n t i a l sP o r tM y V M H o s t P o r t N u m b e r 1F o r c e Adds a VM host to a vCenter Server system even if the authenticity of the host SSL certificate cannot be verified.
Add-VmHostNtpServer
Synopsis
This cmdlet adds the specified NTP servers to the NTP server list of the specified hosts. Syntax Add-VmHostNtpServer [-NtpServer] <String[]> [-VMHost] <VMHost[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostNtpServer Remove-VMHostNtpServer Detailed Description This cmdlet adds the specified NTP servers to the NTP server list of the specified hosts. If a server is already in the list, a non-terminating error is generated and a duplicate is not created. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the domain name or the IP address of the NTP server you want to add to the host. Specifies a host to which you want to add the NTP server. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
6/287
7/8/13
for user confirmation. Server VIServer[]
SwitchParameter
false
false
Zero or more System.String objects Notes Examples -------------- Example 1 -------------A d d V m H o s t N t p S e r v e rN t p S e r v e r" n t p s e r v e r n a m e . c o m "V M H o s t$ v m h o s t Adds the NTP server with a domain name "ntp-server-name.com" to the virtual machine hosts stored in the $vmhost variable. -------------- Example 2 -------------A d d V m H o s t N t p S e r v e rN t p S e r v e r" 1 9 2 . 1 6 8 . 1 . 5 "V M H o s t( G e t V M H o s t ) Adds the NTP server with an IP address "192.168.1.5" to the virtual machine hosts pipelined through the Get-VMHost cmdlet.
Apply-DrsRecommendation
Synopsis
This cmdlet applies the specified DRS recommendations. Syntax Apply-DrsRecommendation [-DrsRecommendation] <DrsRecommendation[]> [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-DrsRecommendation Detailed Description This cmdlet applies the specified DRS recommendations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DrsRecommendation Confirm
DrsRecommendation[] SwitchParameter
Specifies the DRS recommendations you want to apply. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t D r s R e c o m m e n d a t i o nP r i o r i t y1 , 2|A p p l y D r s R e c o m m e n d a t i o n Retrieves and applies DRS recommendations with priorities 1 and 2. -------------- Example 2 -------------$ d r s=G e t D r s R e c o m m e n d a t i o nC l u s t e rC l u s t e r A p p l y D r s R e c o m m e n d a t i o nD r s R e c o m m e n d a t i o n$ d r sR u n A s y n c Retrieves the DRS recommendations from the Cluster cluster and applies them. The command returns without waiting for the task to complete.
Apply-ESXImageProfile
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 7/287
7/8/13
Associates the specified image profile with the specified ESXi system. Syntax Apply-ESXImageProfile [-ImageProfile] <ImageProfile> [-Entities] <VIObjectCore[]> [<CommonParameters>] Related Commands Get-ESXImageProfile Get-VMHost Detailed Description Associates the specified image profile with the specified ESXi system. Currently, the Entities parameter can point only to ESXi hosts. You must have the "AutoDeploy.Profile.Edit" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ImageProfile VIObjectCore[]
Image profile to associate with the specified ESXi host. Must be an ESXi host. Use the Get-VMHost PowerCLI cmdlet to find a host.
true true
-------------- Example 1 -------------C : \ P S >A p p l y E S X I m a g e P r o f i l e" M y I m a g e "" h 1 " , " h 2 " Associate the "MyImage" image profile with the hosts named "h1" and "h2". -------------- Example 2 -------------C : \ P S >$ i m g=G e t E S X I m a g e P r o f i l eN a m e" M y I m a g e " C : \ P S >A p p l y E S X I m a g e P r o f i l e$ i m g( G e t V M H o s t" h 1 " ) Associate an image profile with the host named "h1" using PowerCLI objects.
Apply-VMHostProfile
Synopsis
This cmdlet applies a host profile to the specified host or cluster. Syntax Apply-VMHostProfile [-Entity] <InventoryItem[]> [-Profile <VMHostProfile>] [-Variable <Hashtable>] [-AssociateOnly] [-ApplyOnly] [-RunAsync] [-Server <VIServer[]>] [WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Export-VMHostProfile Get-VMHostProfile Import-VMHostProfile New-VMHostProfile Remove-VMHostProfile Set-VMHostProfile Test-VMHostProfileCompliance Detailed Description This cmdlet applies a host profile to the specified host or cluster. The host or cluster must be in a maintenance mode. If no value is provided to the Profile parameter, the profile currently associated with the host or cluster is applied. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies hosts or clusters to which you want to apply the virtual machine host profile. Indicates whether to apply the host profile to the specified virtual machine host without associating it. Indicates whether to associate the host profile to the specified host or cluster without applying it. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the host profile you want to apply. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies a hash table object that provides values for the host profile required variables. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Profile RunAsync
VMHostProfile SwitchParameter
false false
Server
VIServer[]
false
false
Variable WhatIf
Hashtable SwitchParameter
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
8/287
7/8/13
Return Type
Zero or more VMHost or Cluster or System.Collections.Hashtable Notes If there are missing values for the required variables, a hash table with t he names of the required variables and the current or default values is ret urned. Otherwise, all directly affected host and cluster objects are return ed. If the cmdlet is run for a cluster with the AssociateOnly parameter set , only the cluster object is returned, but not its hosts. Examples -------------- Example 1 -------------A p p l y V M H o s t P r o f i l eA s s o c i a t e O n l yE n t i t y$ c l u s t e rP r o f i l e$ p r o f i l e Associates the specified profile to all hosts in the specified cluster. -------------- Example 2 -------------A p p l y V M H o s t P r o f i l eE n t i t y$ v m h o s tP r o f i l e$ p r o f i l e Associates and applies the specified profile to the specified host. -------------- Example 3 -------------G e t V M H o s t|A p p l y V M H o s t P r o f i l eA p p l y O n l yP r o f i l e$ p r o f i l e Applies the specified profile to all specified hosts. -------------- Example 4 -------------G e t V M H o s t|A p p l y V M H o s t P r o f i l eA s s o c i a t e O n l yp r o f i l e$ p r o f i l e Asscociates the specified profile to all specified hosts. -------------- Example 5 -------------A p p l y V M H o s t P r o f i l e$ v m h o s t Applies the associated host's profile to the host. -------------- Example 6 -------------$ r e q u i r e I n p u t=A p p l y V M H o s t P r o f i l e$ v m h o s tP r o f i l e$ p r o f i l e ; $ r e q u i r e I n p u t [ ' n e t w o r k . h o s t P o r t G r o u p [ " k e y v i m p r o f i l e h o s t H o s t P o r t g r o u p P r o f i l e V M k e r n e l " ] . i p C o n f i g . I p A d d r e s s P o l i c y . a d d r e s s ' ]=' 1 9 2 . 1 6 8 . 0 . 1 ' ; $ r e q u i r e I n p u t [ ' n e t w o r k . h o s t P o r t G r o u p [ " k e y v i m p r o f i l e h o s t H o s t P o r t g r o u p P r o f i l e V M k e r n e l " ] . i p C o n f i g . I p A d d r e s s P o l i c y . s u b n e t m a s k ' ]=' 2 5 5 . 2 5 5 . 2 5 5 . 0 ' ; A p p l y V M H o s t P r o f i l e$ v m h o s tP r o f i l e$ p r o f i l eV a r i a b l e$ r e q u i r e I n p u t ; Applies a profile to host but first assigns values to all required values.
Compare-EsxImageProfile
Synopsis
Syntax Compare-EsxImageProfile [-ReferenceProfile] <ImageProfile> [-ComparisonProfile] <ImageProfile> [-WarningAction <ActionPreference>] [-WarningVariable <String>] [WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description Returns an ImageProfileDiff object that specifies whether two profiles have the same VIB list and acceptance level. If two profiles are different, the ImageProfileDiff object specifies the differences. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ReferenceProfile
ImageProfile
(pipeline input, prompt) Specifies the reference image profile for comparison. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or the Name property of any ImageProfile object *ImageProfile object
true
ComparisonProfile
ImageProfile
(prompt) The image profile to compare against. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or the Name property of any ImageProfile object *ImageProfile object
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
9/287
7/8/13
WhatIf Return Type Notes Examples ---------- Example 1 ---------C o m p a r e E s x I m a g e P r o f i l e" P r o f i l e1 "" P r o f i l e2 " Compares Profile 1 with Profile 2. SwitchParameter
Connect-CIServer
Synopsis
This cmdlet establishes a connection to the specified servers. Syntax Connect-CIServer [-Server] <String[]> [-Org <String>] [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-Port <Int32>] [-NotDefault] [SaveCredentials] [-WhatIf] [-Confirm] [<CommonParameters>] Connect-CIServer [-Server] <String[]> [-SessionId] <String> [-Port <Int32>] [-NotDefault] [-WhatIf] [-Confirm] [<CommonParameters>] Connect-CIServer -Menu [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Disconnect-CIServer Detailed Description This cmdlet establishes a connection to the specified cloud servers. The cmdlet starts a new session or re-establishes a previous session with a cloud server using the specified parameters. If a connection to a server already exists, the cmdlet returns an object which represents the existing connection. When you attempt to connect to a server, the server checks for valid certificates. To set the default behavior of PowerCLI when no valid certificates are recognized, use the InvalidCertificateAction parameter of the Set-PowerCLIConfiguration cmdlet. For more information about invalid certificates, run 'Get-Help about_invalid_certificates'. PowerCLI for vCloud supports a list of default servers. If the target servers cannot be determined from the specified parameters, the cmdlet runs against the servers in the default server list. All default servers are kept in a global array variable called $DefaultCIServers. When you connect to a server, the server is added at the beginning of the array, unless the NotDefault parameter is specified. When you disconnect from a server, the server is removed from the $DefaultCIServers variable. You can modify the value of the $DefaultCIServers variable manually. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the IP or DNS addresses of the cloud servers you want to connect to. Specifies the ID of an existing cloud server session you want to reestablish. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a PSCredential object that contains credentials for authenticating with the server. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication". Indicates that you want to select a server from a list of recently connected servers. If Menu is set to $true, the cmdlet retrieves a list of the last visited servers and enters a nested command prompt, so that you can select a server from the list. Specifies that you do not want to save the specified servers as default servers. Specifies the name of the organization you want to manage. By default, it is the System organization to which you must connect to. The value of the Org parameter overrides the domain part of the value provided to the User parameter. Specifies the password you want to use for authenticating with the server. If the Credential parameter is also specified, this parameter is ignored. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication". Note: If the password contains special characters, enclose the entire string in single quotes (').
Credential
PSCredential
false
false
Menu
SwitchParameter
true
false
NotDefault Org
SwitchParameter String
false false
false false
Password
String
false
false
Specifies the port on the server you want to use for the connection. Indicates that you want to save the specified credentials in the local credential store. Specifies the user name you want to use for authenticating with the server. If the Credential parameter is also specified, this parameter is ignored. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication". Note: If the user name contains special characters, enclose the entire string in single quotes (').
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
10/287
7/8/13
One or more CIServer objects Notes Examples -------------- Example 1 --------------
C o n n e c t C I S e r v e rS e r v e rc l o u d . e x a m p l e . c o mU s e rO r g 1 A d m i nP a s s w o r dp a s sO r gO r g a n i z a t i o n 1 Connects as an organization user to the provided organization. -------------- Example 2 -------------C o n n e c t C I S e r v e rS e r v e rc l o u d . e x a m p l e . c o mU s e ra d m i nP a s s w o r dp a s s Connects as a system administrator to a system organization. -------------- Example 3 -------------C o n n e c t C I S e r v e rS e r v e rc l o u d . e x a m p l e . c o mO r gO r g a n i z a t i o n 1C r e d e n t i a l$ v a p p U s e r C r e d e n t i a l Connects to the provided organization by specifying a credential object. -------------- Example 4 -------------C o n n e c t C I S e r v e rS e r v e rc l o u d . e x a m p l e . c o mS e s s i o n I D$ s e s s i o n I D Connects to a server by providing a server session ID. -------------- Example 5 -------------C o n n e c t C I S e r v e rM e n u Connects to a server from the list of recently connected servers.
Connect-VIServer
Synopsis
This cmdlet establishes a connection to a vCenter Server system. Syntax Connect-VIServer [-Server] <String[]> [-Port <Int32>] [-Protocol <String>] [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-Session <String>] [NotDefault] [-SaveCredentials] [-AllLinked] [-Force] [<CommonParameters>] Connect-VIServer -Menu [<CommonParameters>] Related Commands Online version Disconnect-VIServer Detailed Description This cmdlet establishes a connection to a vCenter Server system. The cmdlet starts a new session or re-establishes a previous session with a vCenter Server system using the specified parameters. When you attempt to connect to a server, the server checks for valid certificates. To set the default behavior of vSphere PowerCLI when no valid certificates are recognized, use the InvalidCertificateAction parameter of the Set-PowerCLIConfiguration cmdlet. For more information about invalid certificates, run 'Get-Help about_invalid_certificates'. You can have more than one connections to the same server. To disconnect from a server, you need to close all active connections to this server. vSphere PowerCLI supports working with multiple default servers. If you select this option, every time when you connect to a different server using Connect-VIServer, the new server connection is stored in an array variable together with the previously connected servers, unless the NotDefault parameter is set. This variable is named $DefaultVIServers and its initial value is an empty array. When you run a cmdlet and the target servers cannot be determined from the specified parameters, the cmdlet runs against all servers stored in the array variable. To remove a server from the $DefaultVIServers variable, you can either use Disconnect-Server to close all active connections to the server, or modify the value of $DefaultVIServers manually. If you choose to work with a single default server, when you run a cmdlet and the target servers cannot be determined from the specified parameters, the cmdlet runs against the last connected server. This server is stored in the $defaultVIServer variable, which is updated every time you establish a new connection. To switch between single and multiple default servers working mode, use DefaultServerMode parameter of the Set-PowerCLIConfiguration cmdlet. Working with multiple default servers will be enabled by default in a future release. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Server
String[]
Specifies the IP address or the DNS name of the vSphere server to which you want to connect. You can also specify a server by providing its IPv6 address enclosed in square brackets, for example [fe80::250:56ff:feb0:74bd%4]. Indicates whether you want to connect to vCenter Server in linked mode. If you specify $true for the AllLinked parameter and the server to which you want to connect is a part of a federation vCenter Server, you'll be connected to all members of the linked vCenter Server. To use this option, PowerCLI must be configured to work in multiple servers connection mode. To configure PowerCLI to support multiple servers connection, specify Multiple for the DefaultVIServerMode parameter of the Set-PowerCLI Configuration cmdlet.
true
false
AllLinked
SwitchParameter
false
false
Credential
PSCredential
Specifies a PSCredential object that contains credentials for authenticating with the server. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication". Passing values to this parameter
false
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
11/287
7/8/13
Force
SwitchParameter
Suppresses all user interface prompts during the cmdlet execution. Currently these include 'Multiple default servers' and 'Invalid certificate action'. Indicates that you want to select a connection server from a list of recently connected servers. If Menu is set to $true, the cmdlet retrieves a list of the last visited servers and enters a nested command prompt, so that you can select a server from the list. Indicates that you do not want to include the server to which you connect into the $defaultVIServers variable. Specifies the password you want to use for authenticating with the server. If the Credential parameter is also specified, this parameter is ignored. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication". Note: If the password contains special characters, enclose the entire string in single quotes (').
false
false
Menu
SwitchParameter
true
false
NotDefault Password
SwitchParameter String
false false
false false
Specifies the port on the server you want to use for the connection. Specifies the internet protocol you want to use for the connection. It can be either http or https. Indicates that you want to save the specified credentials in the local credential store. Specifies the ID of an existing vCenter Server session you want to reestablish. Specifies the user name you want to use for authenticating with the server. If the Credential parameter is also specified, this parameter is ignored. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication". Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Note: If the user name contains special characters, enclose the entire string in single quotes (').
Return Type VIServer Notes When you connect to a server via Connect-ViServer you allocate resources on this server, and these resources remain opened until Disconnect-ViServer - Force is called on this connection. Closing the PowerCLI process does not c lose the server resources. Examples -------------- EXAMPLE 1 -------------C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5P r o t o c o lh t t p sU s e ra d m i nP a s s w o r dp a s s Connects to a vSphere server using the User and Password parameters. -------------- EXAMPLE 2 -------------C o n n e c t V I S e r v e rS e r v e rC r e d e n t i a l s$ m y C r e d e n t i a l s O b j e c tP o r t1 2 3 4 Connects to a vSphere server by using a credential object. -------------- Example 3 -------------C o n n e c t V I S e r v e r" S e r v e r "S e s s i o n I d$ s e s s i o n I d Connect by using a server session ID. Once you connect to a server, you can save the session ID - $serverObject.SessionId, so that you can restore the existing server connection instead of reconnecting. -------------- Example 4 -------------C o n n e c t V I S e r v e rS e r v e r Connect by using integrated authentication. In this case, the credentials you are logged on to your machine must be the same as those for the server. -------------- Example 5 -------------C o n n e c t V I S e r v e r" S e r v e r "U s e ru s e rP a s s w o r dp a s sS a v e C r e d e n t i a l s Connect to a server and save the credentials in the credential store. After the credentials are stored, you can connect to the server without specifying them. To get a previously saved credential store item, use the Get-VICredentialStoreItem cmdlet. -------------- Example 6 -------------C o n n e c t V I S e r v e rM e n u Connect to a server by choosing the server address from a list of previously connected servers. -------------- Example 7 -------------C o n n e c t V I S e r v e r" S e r v e r "A l l L i n k e d Connect to a vSphere server which is a part of a federation vCenter Server. This will Connect you to all vSphere servers in the federation as well.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
12/287
7/8/13
Copy-DatastoreItem
Synopsis
This cmdlet copies items between datastores and between a datastore and a local file system provider. Syntax Copy-DatastoreItem [-Item] <Object[]> [[-Destination] <Object>] [-Force] [-PassThru] [-Recurse] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet copies items between datastores and between a datastore and a local file system provider. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Item Destination
Object[] Object
Specifies the datastore item you want to copy. You can use a string to provide a relative path to the item in the current provider location. Specifies the destination where you want to copy the datastore item. You can use a string to specify a relative path to the destination object in the current provider location. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates whether to overwrite all items with the same name at the provided destination. Indicates that the cmdlet returns the copied item. Indicates that you want to copy not only the item, but its children items as well. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Confirm
SwitchParameter
false
false
$true
Zero or more FileInfo or DatastoreItem objects Notes Examples -------------- Example 1 -------------C o p y D a t a s t o r e I t e mv m s t o r e : \ D a t a c e n t e r \ S t o r a g e 1 \ M y V M \ *c : \ V M F o l d e r \ M y V M \ Copies the contents of a datastore folder in a local folder. -------------- Example 2 -------------C o p y D a t a s t o r e I t e mc : \ V M F o l d e r \ M y V M \ *v m s t o r e : \ D a t a c e n t e r \ S t o r a g e 1 \ N e w V M \F o r c e Copies the contents of a local folder into a datastore folder. If the destination folder does not exist, the Force parameter enforces its creation. -------------- Example 3 -------------C o p y D a t a s t o r e I t e mc : \ V M F o l d e r \ *v m s t o r e : \ D a t a c e n t e r \ S t o r a g e 1 \ V M s \F o r c eR e c u r s e Copies recursively the contents of a local folder into a datastore folder. -------------- Example 4 -------------C o p y D a t a s t o r e I t e mW i n d o w s . I S Ov m s t o r e : \ D a t a c e n t e r \ S t o r a g e 1 \ I S O F i l e s \ W i n X P S P 3 . i s o Copies a file into a datastore folder and changes the file name.
Copy-DeployRule
Synopsis
Clones an existing rule. Syntax Copy-DeployRule [-DeployRule] <DeployRule> [-Name <String>] [-AllHosts] [-ReplaceItem <VIObjectCore[]>] [-ReplacePattern <String[]>] [-NoUpdateRuleSet] [NoActivate] [<CommonParameters>] Related Commands New-DeployRule Get-ESXImageProfile Get-Cluster Get-Datacenter Get-Folder Get-VMHostProfile Detailed Description Clones an existing rule. If you specify -Name, the new rule is assigned the specified name. Otherwise, the cmdlet assigns a new name to the original and gives the clone the name of the original rule.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
13/287
7/8/13
Use the -ReplaceItem and -ReplacePattern options to replace individual items or patterns from the old rule. If the old rule was in the working rule set, the cmdlet replaces it with the new rule unless you specify the -NoUpdateRuleSet option. You must have the "AutoDeploy.Rule.Create" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Rule to copy. This parameter supports object-by-name, so you can pass the name of the rule. If you specify AllHosts, the rule is applied to all hosts. If -Name is specified, the cmdlet assigns the name to the new rule. Otherwise, the new rule keeps the old name and the old name is renamed. If specified, the cmdlet changes the rule and adds it to the working rule set, but does not activate the working rule set. If specified, the cmdlet changes the rule but does not add the changed rule to the working and active rule set. Allows you to make a copy and change individual items, for example the image profile the rule assigns. This parameter supports object-by-name, so you can pass the name of the item. Allows you to make a copy and change individual patterns, for example the set of hosts the rule applies to.
String[]
false
false
VMware.DeployAutomation.Types.DeployRule Notes Examples -------------- Example 1 -------------C : \ P S >C o p y D e p l o y R u l ed e f i m gR e p l a c e I t e m" M yN e wE S X i5 . 0 " Copies a rule previously retrieved with Get-DeployRule and replaces the image in that rule with the specified image. -------------- Example 2 -------------C : \ P S >$ i m g=G e t E S X I m a g e P r o f i l eN a m e" M yN e wE S X i5 . 0 " C : \ P S >C o p y D e p l o y R u l ed e f i m gR e p l a c e I t e m$ i m g Copies a rule previously retrieved with Get-DeployRule and replaces the image in that rule with the specified image.
Copy-HardDisk
Synopsis
Copies a virtual hard disk to another destination. Syntax Copy-HardDisk [-HardDisk] <HardDisk[]> [-DestinationPath] <String> [-DestinationStorageFormat <VirtualDiskStorageFormat>] [-Force] [-RunAsync] [-WhatIf] [Confirm] [<CommonParameters>] Related Commands Online version Get-HardDisk New-HardDisk Remove-HardDisk Set-HardDisk Move-HardDisk Detailed Description Copies a virtual hard disk to another destination specified by the DestinationPath parameter. DestinationPath must be a datastore path to the destination folder. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DestinationPath
String
Specifies the datastore path to the folder where you want to copy the hard disk. The datastore name is included in the path in square braces. Specifies the virtual hard disk you want to copy. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the type of the hard disk copy. The valid values are Thin, Thick, Thick2GB, and EagerZeroedThick. This parameter is only applicable when you are connected to an ESX/ESXi host. Indicates whether to overwrite all disks with the same name at the provided destination. Indicates that the command returns
true
false
HardDisk Confirm
HardDisk[] SwitchParameter
true false
DestinationStorageFormat
VirtualDiskStorageFormat
false
false
Force RunAsync
SwitchParameter SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
14/287
7/8/13
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type The copied HardDisk object Notes Supported only on ESX 4.0 and later. Examples -------------- Example 1 -------------G e t H a r d D i s kV M$ v m|C o p y H a r d D i s k" [ S t o r a g e 1 ] / " Retrieves the hard disks of a virtual machine and copies them into the storage1 root folder. -------------- Example 2 -------------C o p y H a r d D i s kH a r d D i s k$ h d dD e s t i n a t i o n P a t h" [ S t o r a g e 1 ]v m s / d i s k s "D e s t i n a t i o n S t o r a g e F o r m a tT h i c k Copies the $hdd hard disk to the "vms/disks"location on storage1 and changes the storage format of the destination disk to Thick.
Copy-VMGuestFile
Synopsis
This cmdlet copies files and folders from and to the guest OS of the specified virtual machines using VMware Tools. Syntax Copy-VMGuestFile [-Source] <String[]> [-Destination] <String> -LocalToGuest [-Force] [-VM] <VirtualMachine[]> [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [-GuestCredential <PSCredential>] [-GuestUser <String>] [-GuestPassword <SecureString>] [-ToolsWaitSecs <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Copy-VMGuestFile [-Source] <String[]> [-Destination] <String> -GuestToLocal [-Force] [-VM] <VirtualMachine[]> [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [-GuestCredential <PSCredential>] [-GuestUser <String>] [-GuestPassword <SecureString>] [-ToolsWaitSecs <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet copies files and folders from and to the guest OS of the specified virtual machines using VMware Tools. If a file with the same name exists in the destination directory, it is overwritten. Use the GuestUser and GuestPassword, or GuestCredential parameters to authenticate when connecting to the VMware Tools. To authenticate with the host, use the HostUser and HostPassword, or HostCredential parameters. SSPI is not supported. This cmdlet supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Modify privilege. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Source
String[]
Specifies the file you want to copy. If the file is on a virtual machine, specifies the absolute file path. Relative file paths are supported only when copying files from a local storage. Wildcards are allowed only at the end of the source path. If you are copying files from the guest operating system of a virtual machine to a local directory, the Source parameter supports wildcards only on vCenter Server 5.0 and later. Specifies the destination path where you want to copy the file. If the destination points to a virtual machine, specify the absolute file path. Relative destination paths are supported only when copying files to a local storage. Specifies the virtual machine where the file is located. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the non-existing directories in the specified destination path are automatically created. Specifies a PSCredential object that contains credentials for authenticating with the guest OS where the file to be copied is located. Specifies the password you want to use for authenticating with the guest OS where the file to be copied is located. Indicates that you want to copy a file from the guest operating system of the virtual machine to a local directory. Specifies the user name you want to use for authenticating with the guest OS where the file to be copied is located.
true
true (ByPropertyName)
Destination
String
true
false
VM Confirm
VirtualMachine[] SwitchParameter
true false
Force GuestCredential
SwitchParameter PSCredential
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
15/287
7/8/13
HostCredential PSCredential
HostPassword
SecureString
false
false
HostUser
String
false
false
LocalToGuest Server
SwitchParameter VIServer[]
true false
false false
$true
ToolsWaitSecs
Int32
false
false
20
SwitchParameter
false
false
-------------- Example 1 -------------C o p y V M G u e s t F i l eS o u r c ec : \ t e x t . t x tD e s t i n a t i o nc : \ t e m p \V MV MG u e s t T o L o c a lG u e s t U s e ru s e rG u e s t P a s s w o r dp a s s 2 Copies the text.txt file from the guest OS system to the local Temp directory. -------------- Example 2 -------------$ v m=G e t V MN a m eV M G e t I t e m" c : \ F o l d e r T o C o p y \ * . * "|C o p y V M G u e s t F i l eD e s t i n a t i o n" c : \ M y F o l d e r "V M$ v mL o c a l T o G u e s tG u e s t U s e rG u e s t P a s s w o r dp a s s 2 Copies files from a local machine to a guest operating system.
Disconnect-CIServer
Synopsis
This cmdlet disconnects the session from the specified cloud servers. Syntax Disconnect-CIServer [[-Server] <CIServer[]>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Connect-CIServer Detailed Description This cmdlet disconnects the session from the specified cloud servers. If no servers are provided to the Server parameter, the cmdlet disconnects the default servers. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Server Confirm
CIServer[] SwitchParameter
Specifies the cloud servers you want to disconnect from. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies that you want to remove all existing connections to the specified servers. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
Force
SwitchParameter
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
16/287
7/8/13
Disconnects all default servers. -------------- Example 2 -------------D i s c o n n e c t C I S e r v e r*C o n f i r m : $ f a l s e
Disconnects all default servers without asking for confirmation. -------------- Example 3 -------------D i s c o n n e c t C I S e r v e r$ s e r v e r 1F o r c eC o n f i r m : $ f a l s e Disconnects all server connections stored in $server1. -------------- Example 4 -------------$ s e r v e r 1 , $ s e r v e r 2|D i s c o n n e c t C I S e r v e rF o r c eC o n f i r m : $ f a l s e Disconnects all server connections stored in the $server1 and $server2 variables.
Disconnect-VIServer
Synopsis
This cmdlet closes the connection to a vCenter Server system. Syntax Disconnect-VIServer [[-Server] <VIServer[]>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Connect-VIServer Detailed Description This cmdlet closes the connection to a vCenter Server system. In PowerCLI, you can have multiple connections to a server. In order to disconnect from a server, you must close all active connections to it. By default, Disconnect-VIServer closes only the last connection to the specified server. To close all active connections to a server, use the Force parameter or run the cmdlet for each connection. When a server is disconnected, it is removed from the default servers list. For more information about default servers, see the description of Connect-VIServer. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Server Confirm
VIServer[] SwitchParameter
Specifies the vCenter Server systems you want to disconnect from. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to close all active connections to the specified server and disconnect from it. If the value is $false, the cmdlet closes only the last connection to the specified server and you must run Disconnect-VIServer for each active connection to this server in order to disconnect from it. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
Force
SwitchParameter
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ S e r v e r=C o n n e c t V I S e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 D i s c o n n e c t V I S e r v e rS e r v e r$ S e r v e r Connects to a server with an IP address 10.23.112.235 and saves the returned VIServer object in the $Server variable. Then disconnects from the specified server. -------------- Example 2 -------------D i s c o n n e c t V I S e r v e rS e r v e r$ g l o b a l : D e f a u l t V I S e r v e r sF o r c e Closes all connections to the default servers. -------------- Example 3 -------------D i s c o n n e c t V I S e r v e rS e r v e r*F o r c e Disconnects all server connections.
Dismount-Tools
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
17/287
7/8/13
Synopsis
This cmdlet dismounts the VMware Tools installer CD. Syntax Dismount-Tools [[-Guest] <VMGuest[]>] [<CommonParameters>] Dismount-Tools [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Update-Tools Mount-Tools Detailed Description This cmdlet dismounts the VMware Tools installer CD from one or more virtual machines operating systems specified by the VM and Guest parameters. To specify a server different from the default one, use the Server parameter. The virtual machines must be powered on. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Guest VM Server
Specifies the guest operating systems from which you want to remove the VMware Tools. Specifies the virtual machines from which you want to remove the VMware Tools. Specifies the vCenter Server instances on which the search for virtual machine names passed by the VM parameter is performed. If no value is given to this parameter, the search for the virtual machine names is performed on the default server.
Return Type None Notes Examples -------------- Example 1 -------------D i s m o u n t T o o l sV M Dismounts the VMware Tools from the VM virtual machine. The virtual machine must be powered on. -------------- Example 2 -------------G e t V M G u e s tV M|D i s m o u n t T o o l s Dismounts the VMware Tools from the virtual machine specified by its guest operating system. The virtual machine must be powered on.
Export-EsxImageProfile
Synopsis
Syntax Export-EsxImageProfile [-ImageProfile] <ImageProfile> [-FilePath] <String> -ExportToIso [-Force] [-NoSignatureCheck] [-RunAsync] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>] Export-EsxImageProfile [-ImageProfile] <ImageProfile> [-FilePath] <String> -ExportToBundle [-Force] [-NoSignatureCheck] [-RunAsync] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>] Related Commands Detailed Description Exports an Image Profile object as either an ESXi ISO image that can be booted up and used as an ESXi installer, or an offline depot ZIP file that contains metadata plus the VIB packages. In both cases, downloads the VIB binaries and validates the VIB signatures. You can perform the following tasks with the offline depot ZIP file: *Import the ZIP into VMware Update Manager for patch remediation *Download the ZIP to an ESXi host and used with esxcli for installation *Re-import the ZIP into ImageBuilder itself using Add-EsxSoftwareDepot You can specify either -ExportToIso or -ExportToBundle but not both. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ImageProfile
ImageProfile
(pipeline input, prompt) Specifies the image profile to export. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or the Name property of any ImageProfile object *ImageProfile object
true
FilePath
String
Required; specifies the destination for the ISO or the ZIP file path. Include the extension, either .iso or .zip. Offline depots must be named with .zip at the end. If the file already exists, it will not be overwritten unless -Force is specified.
true
false
ExportToBundle
SwitchParameter
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
18/287
7/8/13
ExportToIso Force NoSignatureCheck SwitchParameter SwitchParameter SwitchParameter
---------- Example 1 ---------E x p o r t E s x I m a g e P r o f i l eI m a g e P r o f i l e" E v a n ' sP r o f i l e "E x p o r t T o I s oF i l e P a t hc : \ i s o s \ e v a n s i s o . i s o Export an ISO image ---------- Example 2 ---------N e w E s x I m a g e P r o f i l eC l o n e P r o f i l e" E S X i 5 . 0 . 0 2 3 4 5 6 7 s t a n d a r d "N a m e" E v a n ' sP r o f i l e " A d d E s x S o f t w a r e P a c k a g eI m a g e P r o f i l e" E v a n ' sP r o f i l e "S o f t w a r e P a c k a g ec i s c o v e m v 1 4 0 E x p o r t E s x I m a g e P r o f i l eI m a g e P r o f i l e" E v a n ' sP r o f i l e "E x p o r t T o B u n d l eF i l e P a t hc : \ i s o s \ b a s e p l u s v e m . z i p Clone an image profile, add a software package, then export to offline bundle.
Export-VApp
Synopsis
This cmdlet exports a vApp or a single virtual machine to the specified destination. Syntax Export-VApp [[-Destination] <String>] [-VApp] <VApp[]> [-Name <String>] [-Force] [-Format <VAppStorageFormat>] [-CreateSeparateFolder] [-Description <String>] [Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Export-VApp [[-Destination] <String>] -VM <VirtualMachine[]> [-Name <String>] [-Force] [-Format <VAppStorageFormat>] [-CreateSeparateFolder] [-Description <String>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VApp Import-VApp New-VApp Remove-VApp Set-VApp Start-VApp Stop-VApp Move-VApp Detailed Description This cmdlet exports a vApp or a single virtual machine to the specified destination. If no destination is specified, the cmdlet creates a new folder in the current working directory and exports the vApp or the virtual machine to it. The name of the new folder is the same as the name of the vApp or the virtual machine as it appears in vCenter Server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Destination
String
Specifies a destination path to the file system location where you want to export the vApp or the virtual machine. If the value of the Destination parameter is a folder, the vApp or the virtual machine is exported to a container folder (OVF). If the destination is a file, the vApp or the virtual machine is exported in OVA format. Specifies the vApp that you want to export. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to create a separate folder for each vApp or virtual machine. Provides a description of the exported vApp or virtual machine. Indicates that the cmdlet overwrites the existing destination files and creates directories to complete the specified file path. Specifies the file format of the specified vApp or virtual machine. The default format is OVF. The valid values are OVF and OVA. Specifies a name for the exported vApp or virtual machine. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console.
false
false
VApp Confirm
VApp[] SwitchParameter
true false
Format
VAppStorageFormat
false
false
Name RunAsync
String SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
19/287
7/8/13
Server VIServer[]
VM WhatIf
VirtualMachine[] SwitchParameter
true false
Return Type Zero or more FileInfo objects Notes Examples -------------- Example 1 -------------G e t V A p pN a m e" M y V A p p * "|E x p o r t V A p pD e s t i n a t i o n" C : \ v a p p s \ " Retrieves all vApps whose names start with "MyVApp" and exports them to the specified path. -------------- Example 2 -------------$ m y V A p p=G e t V A p pN a m e" M y V A p p 1 " E x p o r t V A p pD e s t i n a t i o n" C : \ N e w F o l d e r \ "V A p p$ m y V A p pN a m e" E M a i l _ v A p p "F o r c e Exports the vApp in the $myVApp variable to the specified location and assigns a name to the folder. -------------- Example 3 -------------$ m y V A p p=G e t V A p pN a m e" M y V A p p 1 " E x p o r t V A p pv A p p$ m y V A p pD e s t i n a t i o n" C : \ v a p p s \ V a p p \ "F o r c eC r e a t e S e p a r a t e F o l d e r : $ f a l s e Exports the vApp in the $myVApp variable to the specified location without creating a separate folder for each virtual appliance. -------------- Example 4 -------------$ m y V A p p=G e t V A p pN a m e" M y V A p p 1 " E x p o r t V A p pv A p p$ m y V A p pD e s t i n a t i o n" C : \ v a p p s \ m y V a p p \ "F o r m a tO v a Exports a vApp in OVA format. -------------- Example 5 -------------G e t V MN a m eM y V M *|E x p o r t V A p pD e s t i n a t i o n" C : \ M y V M s \ " Retrieves all virtual machines whose names start with "MyVM" and exports them to the specified path. -------------- Example 6 -------------$ m y V M=N e w V MN a m eM y V M 1V M H o s tM y V M H o s t 1 E x p o r t V A p pD e s t i n a t i o n" C : \ M y V M s \ "V M$ m y V MF o r m a tO v a Creates a new virtual machine and exports it in OVA format. -------------- Example 7 -------------$ m y V M=N e w V MN a m e" M y V M 1 "V M H o s tM y V M H o s t 1 G e t V MN a m eM y V M|E x p o r t V A p pD e s t i n a t i o n" C : \ M y V M s \ " E x p o r t V A p pD e s t i n a t i o n" C : \ M y V M s \ "V M$ m y V MF o r c e Exports a virtual machine to the same path twice. The second time forces an override of the previously exported files.
Export-VDPortGroup
Synopsis
This cmdlet exports the configuration of a specified distributed port group to a specified .zip file. Syntax Export-VDPortGroup [-VDPortGroup] <VDPortgroup[]> [-Description <String>] [-Destination <String>] [-Force] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-VDPortgroup New-VDPortgroup Remove-VDPortgroup Set-VDPortgroup Detailed Description This cmdlet exports the configuration of a specified distributed port group to a specified .zip file. You can export only vSphere distributed port groups. Note: This cmdlet is supported only on vSphere 5.1 or later. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VDPortGroup
VDPortgroup[]
Specifies the distributed port group whose configuration you want to export.
true
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
20/287
7/8/13
Description Destination String String
Force
SwitchParameter
false
false
Server
VIServer[]
false
false
Return Type One FileInfo object that contains information about the exported .zip file Notes Examples -------------- Example 1 -------------G e t V D P o r t G r o u pN a m e' M y V D P o r t G r o u p '|E x p o r t V D P o r t G r o u pD e s t i n a t i o n' C : \ M y V D S w i t c h e s B a c k u p \ M y V D P o r t G r o u p _ 2 1 1 2 2 0 1 2 . z i p ' Exports the configuration of the specified port group to the specified file. -------------- Example 2 -------------$ m y P o r t G r o u p=G e t V D P o r t G r o u pN a m e' M y V D P o r t G r o u p ' E x p o r t V D P o r t G r o u pV D P o r t G r o u p$ m y P o r t G r o u pD e s t i n a t i o n' C : \ M y V D S w i t c h e s B a c k u p \ M y V D P o r t G r o u p B a c k u p . z i p 'F o r c e Exports the configuration of the specified port group to the specified file. If the MyVDSwitchesBackup directory does not exist, it is created. If the MyVDPortGroupBackup.zip file already exists in the specified location, it is overwritten.
Export-VDSwitch
Synopsis
This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file. Syntax Export-VDSwitch [-VDSwitch] <VDSwitch[]> [-WithoutPortGroups] [-Description <String>] [-Destination <String>] [-Force] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-VDSwitch New-VDSwitch Remove-VDSwitch Set-VDSwitch Detailed Description This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file. Note: This cmdlet is supported only on vCenter Server 5.1 or later. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the vSphere distributed switch whose configuration you want to export. Specifies a description for the exported vSphere distributed switch configuration. Specifies an absolute or a relative file path to the location where you want to export the vSphere distributed switch configuration. Indicates that if the specified destination file already exists, the existing file is overwritten. Any directories required to complete the specified file path are also created. Specifies the vCenter Server systems 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-VIServer. Indicates that the configuration of the vSphere distributed switch is exported without its port group configuration.
true (ByValue) false false [file system provider location]\[port group name][timestamp].backup.zip
Force
SwitchParameter
false
false
Server
VIServer[]
false
false
WithoutPortGroups
SwitchParameter
false
false
Return Type One FileInfo object that contains information about the exported .zip file Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
21/287
7/8/13
G e t V D S w i t c hN a m e' M y V D S w i t c h '|E x p o r t V D S w i t c hD e s c r i p t i o n" M yV D S w i t c hc o n f i g u r a t i o n "L o c a t i o n" c : \ m y V D S w i t c h C o n f i g . z i p " Exports the configuration of the specified vSphere distributed switch and its port groups to the specified file. -------------- Example 2 -------------G e t V D S w i t c hN a m e' M y V D S w i t c h '|E x p o r t V D S w i t c hD e s c r i p t i o n" M yV D S w i t c hc o n f i g u r a t i o n "L o c a t i o n" c : \ m y V D S w i t c h C o n f i g . z i p "W i t h o u t P o r t G r o u p sF o r c e Exports the configuration of the specified vSphere distributed switch and its port groups to the specified file. If the myVDSwitchConfig.zip file already exists, it is overwritten.
Export-VMHostProfile
Synopsis
This cmdlet exports the specified host profile to a file. Syntax Export-VMHostProfile [-FilePath] <String> [-Profile] <VMHostProfile> [-Force] [-Server <VIServer>] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Get-VMHostProfile Import-VMHostProfile Remove-VMHostProfile Set-VMHostProfile Test-VMHostProfileCompliance New-VMHostProfile Detailed Description This cmdlet exports the specified host profile to a file that is in the VMware profile format (.vpf). If the value of the Force parameter is $false and the destination file exists or the target parent directory does not exist, a terminating error is generated. If the value of the Force parameter is $true, the existing destination file is overwritten and directories are created to complete the specified file path. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the path to the file where you want to export the host profile. Specifies the host profile you want to export. Indicates that the cmdlet overwrites the existing destination files and creates directories to complete the specified file path. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more FileInfo objects Notes Examples -------------- Example 1 -------------$ p r o f i l e=( G e t V M H o s t P r o f i l eN a m eP r o f i l e) [ 0 ] E x p o r t V M H o s t P r o f i l eF i l e P a t he x p o r t . p r fP r o f i l e$ p r o f i l eF o r c e Exports the selected host profile to the export.prf file.
Format-VMHostDiskPartition
Synopsis
This cmdlet formats a new VMFS (Virtual Machine File System) on each of the specified host disk partitions. Syntax Format-VMHostDiskPartition [-VolumeName] <String> -VMHostDiskPartition <VMHostDiskPartition[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostDiskPartition Detailed Description This cmdlet formats a new VMFS (Virtual Machine File System) on each of the specified host disk partitions. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VolumeName Confirm
String SwitchParameter
Specifies a name for the new VMFS. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the
true false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
22/287
7/8/13
VMHostDiskPartition WhatIf VMHostDiskPartition[] SwitchParameter
Return Type Zero or more formatted VMHostDiskPartition objects Notes Examples -------------- Example 1 -------------G e t V M H o s tH o s t|G e t V M H o s t D i s k|G e t V M H o s t D i s k P a r t i t i o n|?{ . T y p ee q" N t f s " }|F o r m a t V M H o s t D i s k P a r t i t i o nV o l u m e N a m e" N e w S t o r a g e " Formats the NTFS disk partitions of a host.
Get-AdvancedSetting
Synopsis
This cmdlet retrieves the advanced settings for the specified entity. Syntax Get-AdvancedSetting [-Entity] <VIObject[]> [[-Name] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-AdvancedSetting Remove-AdvancedSetting Set-AdvancedSetting Detailed Description This cmdlet retrieves the advanced settings for the specified entity. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Entity
String[] VIObject[]
Specifies the names of the advanced settings you want to retrieve. Specifies the entities for which you want to retrieve the advanced settings. This parameter accepts VIServer, VirtualMachine, VMHost, DatastoreCluster, and Cluster objects. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
false true
Server
VIServer[]
false
false
Return Type Zero or more AdvancedSetting objects Notes Examples -------------- Example 1 -------------G e t A d v a n c e d S e t t i n gE n t i t y( G e t C l u s t e rN a m eC l u s t e r ) Retrieves the advanced settings of the cluster named Cluster. -------------- Example 2 -------------G e t A d v a n c e d S e t t i n gE n t i t y( G e t C l u s t e rN a m eC l u s t e r )N a m eS e t t i n g N a m e Retrieves the advanced setting named SettingName of the Cluster cluster. -------------- Example 3 -------------G e t A d v a n c e d S e t t i n gE n t i t yS e r v e rN a m e' * s m t p * ' Retrieve all smtp settings for the specified server.
Get-AlarmAction
Synopsis
This cmdlet retrieves the actions of the specified alarm definitions. Syntax Get-AlarmAction [[-AlarmDefinition] <AlarmDefinition[]>] [-ActionType <ActionType[]>] [-Server <VIServer[]>] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
23/287
7/8/13
Related Commands Online version Get-AlarmActionTrigger Get-AlarmDefinition New-AlarmAction New-AlarmActionTrigger Remove-AlarmAction Detailed Description
This cmdlet retrieves the actions of the specified alarm definitions. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the alarm definitions for which you want to retrieve the configured actions. Specifies the type of the alarm actions you want to retrieve. The valid values are SendEmail, ExecuteScript, and Send SNMP. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more AlarmAction objects Notes Examples -------------- Example 1 -------------G e t A l a r m D e f i n i t i o nN a m e" H o s tp r o c e s s o rs t a t u s "|G e t A l a r m A c t i o nA c t i o n T y p e" E x e c u t e S c r i p t " ," S e n d S N M P " ," S e n d E m a i l " Extract all PowerCLI supported alarm actions for the default alarm "Host processor status". -------------- Example 2 -------------G e t A l a r m A c t i o nA l a r m D e f i n i t i o n" H o s tp r o c e s s o rs t a t u s "A c t i o n T y p e" S e n d S N M P "S e r v e r' s e r v e rI P ' Extract the alarm actions for the default alarm "Host processor status" by specifying the alarm by name.
Get-AlarmActionTrigger
Synopsis
This cmdlet retrieves the actions that trigger the specified alarm actions. Syntax Get-AlarmActionTrigger [[-AlarmAction] <AlarmAction[]>] [<CommonParameters>] Related Commands Online version Get-AlarmAction Get-AlarmDefinition New-AlarmAction New-AlarmActionTrigger Remove-AlarmAction Remove-AlarmActionTrigger Detailed Description This cmdlet retrieves the actions that trigger the specified alarm actions. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AlarmAction[]
false
true (ByValue)
Zero or more AlarmActionTrigger objects Notes Examples -------------- Example 1 -------------G e t A l a r m A c t i o nA l a r m D e f i n i t i o n( G e t A l a r m D e f i n i t i o n|s e l e c tF i r s t1 )|G e t A l a r m A c t i o n T r i g g e r Retrieves the action triggers for the actions of the first returned alarm.
Get-AlarmDefinition
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
24/287
7/8/13
This cmdlet retrieves the available alarm definitions. Syntax
Get-AlarmDefinition [-Id <String[]>] [[-Name] <String[]>] [[-Entity] <VIObject[]>] [-Enabled [<Boolean>]] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-AlarmAction Get-AlarmActionTrigger New-AlarmAction New-AlarmActionTrigger Remove-AlarmAction Remove-AlarmActionTrigger Set-AlarmDefinition New-AlarmActionTrigger Detailed Description This cmdlet retrieves the available alarm definitions. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the alarms you want to retrieve. Filters the alarm definitions by the entities to which they are defined. This parameter accepts InventoryItem, Datastore, and DatastoreCluster objects. Indicates that you want to retrieve only the enabled alarm definitions. Specifies the IDs of the alarms you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Return Type Zero or more AlarmDefinition objects Notes Examples -------------- Example 1 -------------G e t A l a r m D e f i n i t i o nE n t i t y( G e t F o l d e rN o R e c u r s i o n )N a m e" H o s tc o n n e c t i o na n dp o w e rs t a t e "E n a b l e d : $ t r u e Retrieve the enabled alarms named "Host connection and power state" for the available folders. -------------- Example 2 -------------G e t A l a r m D e f i n i t i o nS e r v e rS e r v e r 1 ,S e r v e r 2 Retrieves the alarms for the specified servers.
Get-Annotation
Synopsis
This cmdlet retrieves annotations. Syntax Get-Annotation [[-CustomAttribute] <CustomAttribute[]>] [-Entity] <InventoryItem> [-Server <VIServer[]>] [<CommonParameters>] Get-Annotation [-Entity] <InventoryItem> [-Name <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-Annotation Get-CustomAttribute New-CustomAttribute Remove-CustomAttribute Set-CustomAttribute Detailed Description This cmdlet retrieves annotations. An annotation is a user-defined description field of one or more vSphere objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the entities whose annotations you want to retrieve. Specifies the custom attributes whose annotations you want to retrieve. Specifies the names of the annotations you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more Annotation objects Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
25/287
7/8/13
G e t C l u s t e rC l u s t e r|G e t A n n o t a t i o nC u s t o m A t t r i b u t eP h y s i c a l L o c a t i o n Retrieves the annotation of the PhysicalLocation custom attribute for Cluster.
Get-Catalog
Synopsis
This cmdlet retrieves the specified cloud catalogs. Syntax Get-Catalog [[-Name] <String[]>] [-Org <Org[]>] [-MyOrgOnly] [-Server <CIServer[]>] [<CommonParameters>] Get-Catalog -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves the specified cloud catalogs. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the cloud catalogs you want to retrieve. Specifies the IDs of the cloud catalogs you want to retrieve. Indicates that you want to retrieve catalogs only from the organization which is currently connected. Specifies the organizations from which you want to retrieve catalogs. 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.
Return Type Zero or more Catalog objects Notes Examples -------------- Example 1 -------------G e t C a t a l o g Gets all visible catalogs for the current user. -------------- Example 2 -------------G e t C a t a l o gN a m e" M y C a t a l o g 1 " Gets an existing catalog named "MyCatalog". -------------- Example 3 -------------G e t C a t a l o gI D$ c a t a l o g I d Gets a catalog with a given ID. -------------- Example 4 -------------G e t O r gN a m e" O r g a n i z a t i o n 1 "|G e t C a t a l o g Gets all visible catalogs for an organization. -------------- Example 5 -------------C o n n e c t C I S e r v e r$ i pN a m e$ n o n S y s A d m i n U s e rP a s s$ p a s s G e t C a t a l o gM y O r g O n l y Gets all catalogs from my organization.
Get-CDDrive
Synopsis
This cmdlet retrieves virtual CD drives. Syntax Get-CDDrive [-Id <String[]>] [-Server <VIServer[]>] [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [-Name <String[]>] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
26/287
7/8/13
Related Commands Online version New-CDDrive Remove-CDDrive Set-CDDrive Detailed Description
This cmdlet returns a set of virtual CD drives that belong to the virtual machines, templates, and snapshots specified by the VirtualMachine, Template, and Snapshot parameters. At least one of these parameters must be provided. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the virtual machines from which you want to retrieve virtual CD drives. Specifies the virtual machine templates from which you want to retrieve virtual CD drives. Specifies the snapshots from which you want to retrieve virtual CD drives. Specifies the IDs of the CD drives you want to retrieve. Specifies the names of the CD drives you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more CDDrive objects Notes Examples -------------- Example 1 -------------G e t V MN a m eV M|G e t C D D r i v e Connects to a vSphere server and retrieves the CD drive of the virtual machine named VM.
Get-CIAccessControlRule
Synopsis
This cmdlet retrieves access control rules. Syntax Get-CIAccessControlRule [[-Entity] <AccessControlledEntity[]>] [-AccessLevelAtLeast <AccessLevel>] [-User <CIObject[]>] [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version New-CIAccessControlRule Set-CIAccessControlRule Remove-CIAccessControlRule Detailed Description This cmdlet retrieves access control rules. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Entity
AccessControlledEntity[]
Specifies the entities for which you want to retrieve access control rules. This parameter accepts vApp and Catalog objects. Specifies the lowest access level for the access control rules that you want to retrieve. The cmdlet returns all objects with the specified access level and higher access levels, if any. 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. Specifies cloud users to retrieve the access control rules that apply for them. This parameter accepts CIUser and Org objects. When you pass an Org object to the parameter, the operation retrieves only access control rules that are set to apply for everyone in the organization.
false
true (ByValue)
AccessLevelAtLeast
AccessLevel
false
false
Server
CIServer[]
false
false
User
CIObject[]
false
false
Return Type Zero or more CIAccessControlRule objects Notes Examples -------------- Example 1 -------------G e t C I A c c e s s C o n t r o l R u l eE n t i t y' M y V A p p ' ,' M y C a t a l o g '
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
27/287
7/8/13
Retrieve all access control rules for the specified entities. -------------- Example 2 -------------G e t C I A c c e s s C o n t r o l R u l eU s e r' M y U s e r 1 ' ,' M y U s e r 2 '
Retrieve all access control rules that apply for the specified users. -------------- Example 3 -------------G e t C I A c c e s s C o n t r o l R u l eE n t i t y' M y C a t a l o g 'U s e r' M y U s e r ' Retrieve all access control rules set for the specified catalog and applying only for the specified user. -------------- Example 4 -------------G e t C I A c c e s s C o n t r o l R u l eA c c e s s L e v e l A t L e a s tR e a d W r i t e Retrieve all access control rules with "Read/Write" or "Full Control" access levels that apply for everyone in the MyOrg organization.
Get-CIDatastore
Synopsis
This cmdlet retrieves the datastores available on a cloud server. Syntax Get-CIDatastore [-Server <CIServer[]>] [[-Name] <String[]>] [-ProviderVdc <ProviderVdc[]>] [<CommonParameters>] Get-CIDatastore -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Add-CIDatastore Online version Detailed Description This cmdlet retrieves the datastores available on a cloud server. To specify a server different from the default one, use the Server parameter. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names for the datastores that you want to retrieve. Specifies the IDs of the datastores that you want to retrieve. Specifies the provider vDC for which you want to retrieve datastores. 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.
Return Type Zero or more CIDatastore objects Notes Examples -------------- Example 1 -------------G e t C I D a t a s t o r eN a m e" M y D a t a s t o r e * " Retrieves all datastores with names that start with "MyDatastore" from all available provider vDCs. -------------- Example 2 -------------G e t C I D a t a s t o r eN a m e* d a t a s t o r e *P r o v i d e r V D C" M y P r o v i d e r V D C 1 " ," M y P r o v i d e r V D C 2 " Retrieves all datastores with names that contain "datastore" from multiple provider vDCs.
Get-CINetworkAdapter
Synopsis
This cmdlet retrieves the virtual network adapters available on a vCloud Director server. Syntax Get-CINetworkAdapter [-Primary [<Boolean>]] [-Server <CIServer[]>] [-VM <CIVM[]>] [<CommonParameters>] Get-CINetworkAdapter [-Primary [<Boolean>]] [-Server <CIServer[]>] -VAppNetwork <CIVAppNetwork[]> [<CommonParameters>] Related Commands Online version Set-CINetworkAdapter Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
28/287
7/8/13
Parameters
NA ME TYPE DESCRIPTION
This cmdlet retrieves the virtual network adapters available on a vCloud Director server.
REQUIRED?
PIPELINE INPUT
Primary Server
Boolean CIServer[]
Indicates that you want to retrieve only primary virtual network adapters. 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. Specifies vApp networks to retrieve the virtual network adapters that are connected to them. Specifies the virtual machines whose virtual network adapters you want to retrieve.
false false
false false
CIVAppNetwork[] CIVM[]
true false
Zero or more CINetworkAdapter objects Notes Examples -------------- Example 1 -------------G e t C I V MN a m e' M y V M 1 '|G e t C I N e t w o r k A d a p t e r Retrieves all virtual network adapters for the MyVM1 virtual machine. -------------- Example 2 -------------G e t C I V a p p N e t w o r kN a m e' M y V A p p N e t w o r k 1 'V A p p' M y V a p p 1 '|G e t C I N e t w o r k A d a p t e r Retrieves all virtual network adapters for the specified vApp network. -------------- Example 3 -------------G e t V A p pN a m e' M y V a p p 1 '|G e t C I V M|G e t C I N e t w o r k A d a p t e rP r i m a r y Retrieves the primary virtual network adapters for all virtual machines in the specified vApp.
Get-CIRole
Synopsis
This cmdlet retrieves roles in the cloud. Syntax Get-CIRole [[-Name] <String[]>] [-User <CIUser[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-CIRole -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-CIUser Detailed Description This cmdlet retrieves roles in the cloud. You can filter the output by using the cmdlet parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Id Server
Specifies the names of the cloud roles you want to retrieve. Specifies the IDs of the cloud roles you want to retrieve. 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. Specifies cloud users to view their roles.
User
CIUser[]
false
true (ByValue)
Return Type Zero or more CIRole objects Notes Examples -------------- Example 1 -------------G e t C I R o l e Retrieves all roles that are visible to the current user. -------------- Example 2 -------------G e t C I U s e rN a m eU s e r|G e t C I R o l e Get the roles assigned to a cloud user. -------------- Example 3 -------------G e t C I R o l eN a m eR o l e
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
29/287
7/8/13
Gets a role by name. -------------- Example 4 -------------G e t C I R o l eI dr o l e I d Gets a role by Id.
Get-CIUser
Synopsis
This cmdlet retrieves cloud users. Syntax Get-CIUser [[-Name] <String[]>] [-Org <Org[]>] [-Role <CIRole[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-CIUser -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-CIRole Detailed Description This cmdlet retrieves cloud users. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the cloud users you want to retrieve. Specifies the IDs of the cloud users you want to retrieve. Specifies the organizations to which the users you want to retrieve belong. Specifies the roles of the users you want to retrieve. 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.
Return Type Zero or more CIUser objects Notes Retrieving a user's Org property returns $null if the user is a member of t he System organization. To ensure compatibility with future versions, all s cripts checking if a user is a member of the System organization must use t he following syntax: $user.Org -eq $null -or $user.Org.Name -like 'System' Examples -------------- Example 1 -------------G e t C I U s e rO r gO r g Gets a list of the users in the specified organization. -------------- Example 2 -------------G e t C I U s e rO r gO r g a n i z a t i o nR o l e" C a t a l o gA u t h o r " Gets a list of the organization users that have the "Catalog Author" role. -------------- Example 3 -------------G e t C I R o l e|G e t C I U s e r Gets the users with the provided roles. -------------- Example 4 -------------G e t C I U s e rU s e r * Gets a list of users with names that start with "User".
Get-CIVApp
Synopsis
This cmdlet retrieves virtual appliances in the cloud. Syntax Get-CIVApp [[-Name] <String[]>] [-Server <CIServer[]>] [-Org <Org[]>] [-OrgNetwork <OrgNetwork[]>] [-OrgVdc <OrgVdc[]>] [-Owner <CIUser[]>] [-Status <CIVAppStatus[]>] [<CommonParameters>] Get-CIVApp -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
30/287
7/8/13
Online version Get-CIVAppTemplate Import-CIVApp Import-CIVAppTempate Detailed Description
This cmdlet retrieves virtual appliances in the cloud. You cannot use the ID parameter with the other cmdlet parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the vApps you want to retrieve. Specifies the IDs of the vApps you want to retrieve. Specifies the organizations for which you want to retrieve vApps. Specifies the organization networks for which you want to retrieve vApps. Specifies the organization VDCs for which you want to retrieve vApps. Specifies the owners of the cloud vApps you want to retrieve. 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. Specifies the status of the vApps you want to retrieve.
false false true (ByValue) true (ByValue) true (ByValue) true (ByValue) false
CIVAppStatus[]
false
false
Zero or more CIVApp objects Notes Examples -------------- Example 1 -------------G e t C I V A p p Gets all visible VApps for the current user. -------------- Example 2 -------------G e t C I V A p pN a m e" M y V A p p 1 " Gets a single VApp named "MyVApp1". -------------- Example 3 -------------G e t C I V A p pI D$ C l o u d V A p p I d Gets a VApp with a given ID. -------------- Example 4 -------------$ m y O r g=G e t O r gN a m e" O r g a n i z a t i o n 1 " G e t C I V A p pO r g$ m y O r g Gets all visible VApps within an organization. -------------- Example 5 -------------G e t O r g N e t w o r kN a m e" O r g N e t w o r k 1 "|G e t C I V A p p Gets all visible VApps within an organization's network. -------------- Example 6 -------------G e t O r g V d cN a m e" O r g V d c 1 "|G e t C I V A p p Gets all visible VApps within an organization virtual datacenter using a pipeline syntax. -------------- Example 7 -------------G e t C I U s e rN a m e" C l o u d U s e r O r g 1 A d m i n 1 "|G e t C I V A p p Gets VApp by its owner using a pipeline syntax. -------------- Example 8 -------------G e t C I V A p pS t a t u s" P o w e r e d O n " Gets all VApps by their state.
Get-CIVAppNetwork
Synopsis
This cmdlet retrieves the vApp networks available on a vCloud Director server. Syntax
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
31/287
7/8/13
Get-CIVAppNetwork [[-Name] <String[]>] [-ConnectionType <CIVAppNetworkConnectionType[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-CIVAppNetwork -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Get-CIVAppNetwork [[-Name] <String[]>] [-ConnectionType <CIVAppNetworkConnectionType[]>] -VApp <CIVApp[]> [-Server <CIServer[]>] [<CommonParameters>] Get-CIVAppNetwork [[-Name] <String[]>] [-ConnectionType <CIVAppNetworkConnectionType[]>] -ParentOrgNetwork <OrgNetwork[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version New-CIVAppNetwork Remove-CIVAppNetwork Set-CIVAppNetwork Detailed Description This cmdlet retrieves the vApp networks available on a vCloud Director server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name ConnectionType
String[] CIVAppNetworkConnectionType[]
Specifies the names of the vApp networks you want to retrieve. Specifies the type of connectivity between the vApp networks you want to retrieve and their parent organization networks. This parameter accepts Direct, Fenced, Routed, and Isolated values. Specifies the IDs of the vApp networks that you want to retrieve. Specifies the parent organization networks of the vApp networks you want to retrieve. 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. Specifies the vApps for which you want to retrieve vApp networks.
false false
false false
Id ParentOrgNetwork Server
CIVApp[]
true
true (ByValue)
Zero or more CIVAppNetwork objects Notes Examples -------------- Example 1 -------------G e t C I V A p p N e t w o r kC o n n e c t i o n T y p eD i r e c t Retrieves all vApp networks that are directly connected to a parent organization network and are available to the user. -------------- Example 2 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' G e t C I V A p p N e t w o r kV A p p$ m y V A p p Retrieves all vApp networks for the specified vApp. -------------- Example 3 -------------$ p a r e n t O r g N e t w o r k=G e t O r g N e t w o r kN a m e' M y O r g N e t w o r k ' G e t C I V A p p N e t w o r kP a r e n t O r g N e t w o r k' M y O r g N e t w o r k ' Retrieves all vApp networks that are connected to the specified parent organization network.
Get-CIVAppStartRule
Synopsis
This cmdlet retrieves the start rules for virtual machines in a specified vApp. Syntax Get-CIVAppStartRule [-VApp] <CIVApp[]> [-VM <CIVM[]>] [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Set-CIVAppStartRule Detailed Description This cmdlet retrieves the start rules for virtual machines in a specified vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Server
CIVApp[] CIServer[]
Specifies the vApps whose start rules you want to retrieve. 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. Specifies the virtual machines for which to retrieve start rules.
true false
VM
CIVM[]
false
false
Return Type
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
32/287
7/8/13
Zero or more CIVAppStartRule objects Notes Examples -------------- Example 1 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' G e t C I V A p p S t a r t R u l eV A p p$ m y V A p p Retrieves all start rules for the specified vApp. -------------- Example 2 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' $ V M i n V A p p=G e t C I V M' M y V M 'V A p p$ m y V A p p $ m y V A p p|G e t C I V A p p S t a r t R u l eV M$ V M i n V A p p Retrieves start rules for the specified virtual machine.
Get-CIVAppTemplate
Synopsis
This cmdlet retrieves vApp templates. Syntax Get-CIVAppTemplate [[-Name] <String[]>] [-Catalog <Catalog[]>] [-Owner <CIUser[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-CIVAppTemplate -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-CIVApp Import-CIVApp Import-CIVAppTempate Detailed Description This cmdlet retrieves vApp templates. You can filter the list of the returned templates by name, ID, catalog, and owner. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the vApp templates you want to retrieve. Specifies the catalog from which you want to retrieve vApp templates. Specifies the IDs of the virtual appliance templates you want to retrieve. Specifies the owners of the vApp templates you want to retrieve. 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.
Return Type Zero or more CIVAppTemplate objects Notes Examples -------------- Example 1 -------------G e t C I V A p p T e m p l a t e Gets a list of all virtual appliance templates visible to you. -------------- Example 2 -------------G e t C I V A p p T e m p l a t eN a m eV A p p T e m p l a t e Gets the virtual appliance template named VAppTemplate. -------------- Example 3 -------------G e t C I V A p p T e m p l a t eI Dv A p p T e m p a l t e I d Get a vAppTemplate by Id. -------------- Example 4 -------------G e t C a t a l o gC a t a l o g 1|G e t C I V A p p T e m p l a t e Gets all virtual appliance templates in the catalog named Catalog1.
Get-CIView
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 33/287
7/8/13
Synopsis
This cmdlet retrieves cloud views by ID. Syntax Get-CIView [-CIObject] <CIObject[]> [-Server <CIServer[]>] [<CommonParameters>] Get-CIView -Id <String[]> [-ViewLevel <CIViewLevel>] [-Server <CIServer[]>] [<CommonParameters>] Get-CIView [-ViewLevel <CIViewLevel>] -SearchResult <CISearchResult[]> [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves cloud views objects. The cmdlet converts CIObject to Cloud view object. Supports getting views from CISearchResult objects returned by the Search-Cloud cmdlet. An Id property must be present in the CISearchResult objects. If an Id is specified, the result view is determined by the ViewType parameter. If ViewType is not passed, the cmdlet returns the most complete representation of the object visible to the user by using the following priority: Extension, Admin, User. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies cloud objects to retrieve their views. Specifies the IDs of the view object you want to retrieve. Specifies a CISearchResult object to get the corresponding view. 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. Specifies a Cloud object representation to be retrieved by object ID. Cloud objects may have an Extension, Admin or User representation that can be retrieved when passing an object ID. Providing a ViewLevel parameter explicitly requests the exact abstraction you want to retrieve.
ViewLevel
CIViewLevel
false
false
Return Type Zero or more View objects Notes Examples -------------- Example 1 -------------$ c a t a l o g=S e a r c h C l o u dQ u e r y T y p eC a t a l o gN a m eC a t a l o g 1|G e t C I V i e wV i e w L e v e lA d m i n Gets a cloud catalog Admin view using the search result returned by the Search-Cloud cmdlet. -------------- Example 2 -------------$ c a t a l o g I t e m=G e t C I V i e wI d$ c a t a l o g . C a t a l o g I t e m s . C a t a l o g I t e m [ 0 ] . H r e f Gets the first catalog item view using the Href property from an already retrieved catalog items collection. -------------- Example 3 -------------$ O r g=G e t O r gN a m eO r g a n i z a t i o n 1|G e t C I V i e w Gets a cloud organization view from the result returned by the Get-Org cmdlet. -------------- Example 4 -------------$ u s e r C a t a l o g=G e t C I V i e wI d$ c a t a l o g . I dV i e w L e v e lU s e r Gets the User cloud representation of the catalog.
Get-CIVM
Synopsis
This cmdlet retrieves virtual machines in the cloud. Syntax Get-CIVM [[-Name] <String[]>] [-Org <Org[]>] [-OrgNetwork <OrgNetwork[]>] [-OrgVdc <OrgVdc[]>] [-VApp <CIVApp[]>] [-Status <CIVAppStatus[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-CIVM -Id <String[]> [-Server <CIServer[]>] [<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
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name
String[]
Specifies the name of the cloud virtual machines you want to retrieve.
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
34/287
7/8/13
Id Org OrgNetwork OrgVdc Server String[] Org[] OrgNetwork[] OrgVdc[] CIServer[]
CIVAppStatus[] CIVApp[]
false false
Zero or more CIVM objects Notes Examples -------------- Example 1 -------------G e t C I V M Gets all visible virtual machines for the current user. -------------- Example 2 -------------G e t C I V MN a m e" M y V M " Gets a single virtual machine by its name. -------------- Example 3 -------------G e t C I V A p pN a m e" * D B * " Gets all virtual machines that match a defined string by name. -------------- Example 4 -------------G e t C I V MI D$ m y V M I d Gets a virtual machine with a given ID. -------------- Example 5 -------------G e t C I V MO r g" M y O r g a n i z a t i o n " Gets all visible virtual machines within an organization. -------------- Example 6 -------------G e t C I V MO r g N e t w o r k" O r g N e t w o r k 1 " Gets all visible virtual machines within an organization network. -------------- Example 7 -------------G e t O r g N e t w o r kN a m e" O r g N e t w o r k 1 "|G e t C I V M Gets all visible virtual machines within an organization network (pipeline). -------------- Example 8 -------------G e t C I V MO r g V d c" M y O r g V D C 1 " Gets all visible virtual machines within an organization's virtual datacenter. -------------- Example 9 -------------G e t O r g V d cN a m e" O r g V d c 1 "|G e t C I V M Get all visible virtual machines within an organization's virtual datacenter by using a pipeline syntax. -------------- Example 10 -------------G e t C I V MV A p p" M y V A p p " Gets virtual machines running a particular VApp. -------------- Example 11 -------------G e t C I V A p p" M y V A p p "|G e t C I V M Gets virtual machines running a particular VApp (pipeline). -------------- Example 12 -------------G e t C I V MS t a t u s" P o w e r e d O n " ," S u s p e n d e d " Gets virtual machines by status (all powered on and suspended VMs).
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
35/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Get-Cluster
Synopsis
This cmdlet retrieves the clusters available on a vCenter Server system. Syntax Get-Cluster [-VM <VirtualMachine[]>] [-VMHost <VMHost[]>] [-Location <VIContainer[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-Cluster -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Move-Cluster New-Cluster Remove-Cluster Set-Cluster Detailed Description This cmdlet retrieves the clusters available on a vCenter Server system. Returns a set of clusters that correspond to the filter criteria defined by the cmdlet parameters. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the clusters you want to retrieve. Specifies the IDs of the clusters you want to retrieve. Specifies vSphere container objects (such as folders, datacenters, and clusters) you want to search for clusters. Indicates that you want to disable the recursive behavior of the command. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies virtual machines to filter the clusters that contain at least one of them. Specifies hosts to filter the clusters that contain at least one of them.
VirtualMachine[] VMHost[]
false false
Zero or more Cluster objects Notes Examples -------------- Example 1 -------------G e t C l u s t e rL o c a t i o nF o l d e r Get a list of the available clusters in the Folder folder.
Get-CustomAttribute
Synopsis
This cmdlet retrieves custom attributes. Syntax Get-CustomAttribute [-Id <String[]>] [[-Name] <String[]>] [[-TargetType] <CustomAttributeTargetType[]>] [-Global] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-CustomAttribute Remove-CustomAttribute Set-CustomAttribute Get-Annotation Set-Annotation Detailed Description This cmdlet retrieves custom attributes. A custom attribute is a user-defined description field of one or more vSphere objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name TargetType
String[] CustomAttributeTargetType[]
Specifies the names of the custom attributes you want to retrieve. Specifies a target type to filter the custom attributes by the type of objects to which they can be applied. The valid values are VirtualMachine, ResourcePool, Folder, VMHost, Cluster, Datacenter, and $null. If the value is $null, the custom attribute is global and applies to all target types.
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
36/287
7/8/13
Global SwitchParameter
Id Server
String[] VIServer[]
false false
false false
Return Type Zero or more CustomAttribute objects Notes Examples -------------- Example 1 -------------G e t C u s t o m A t t r i b u t eG l o b a l Retrieves all global custom attributes. -------------- Example 2 -------------G e t C u s t o m A t t r i b u t eT a r g e t T y p e" V i r t u a l M a c h i n e " ," V M H o s t " Retrieves all custom attributes of type VirtualMachine and VMHost. -------------- Example 3 -------------G e t C u s t o m A t t r i b u t eN a m e" C r e a t i o n * "G l o b a l Retrieves only global custom attributes that match the specified name pattern.
Get-Datacenter
Synopsis
This cmdlet retrieves the datacenters available on a vCenter Server system. Syntax Get-Datacenter [-VM <VirtualMachine[]>] [-Cluster <Cluster[]>] [-VMHost <VMHost[]>] [-Location <VIContainer[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-Datacenter -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Move-Datacenter New-Datacenter Remove-Datacenter Set-Datacenter Detailed Description This cmdlet retrieves the datacenters available on a vCenter Server system. Returns a set of datacenters that correspond to the filter criteria defined by the cmdlet parameters. By default, the cmdlet searches recursively from any provided starting point. In this case, if the location is not explicitly specified, the search includes the root folder and all other inventory items on the root folder level. If the command runs with the NoRecursion parameter set to $true, and the location is not specified, only the root folder is searched and no datacenters are returned. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the datacenters you want to retrieve. Specifies clusters to filter the datacenters that contain at least one of them. Specifies the IDs of the datacenters you want to retrieve. Specifies vSphere container objects (such as folders) you want to search for datacenters. Indicates that you want to disable the recursive behavior of the command. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies virtual machines to filter the datacenters that contain at least one of them. Specifies hosts to filter the datacenters that contain at least one of them.
VirtualMachine[] VMHost[]
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
37/287
7/8/13
G e t D a t a c e n t e rN a m eD a t a c e n t e r *
Retrieves a list of all datacenters on the server, whose names begin with "Datacenter".
Get-Datastore
Synopsis
This cmdlet retrieves the datastores available on a vCenter Server system. Syntax Get-Datastore [-Server <VIServer[]>] [[-Name] <String[]>] [-Location <VIObject[]>] [-RelatedObject <DatastoreRelatedObjectBase[]>] [-Refresh] [<CommonParameters>] Get-Datastore [-Server <VIServer[]>] -Id <String[]> [-Refresh] [<CommonParameters>] Related Commands Online version New-Datastore Remove-Datastore Set-Datastore Move-Datastore Detailed Description This cmdlet retrieves the datastores available on a vCenter Server system. Returns a set of datastores that correspond to the filter criteria defined by the cmdlet parameters. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Id Location
Specifies the names of the datastores you want to retrieve. Specifies the IDs of the datastores you want to retrieve. Specifies vSphere container objects that you want to search for datastores. This parameter accepts Datacenter, Folder, and DatastoreCluster objects. Indicates that the cmdlet first refreshes the storage system information and then retrieves the specified datastores. Specifies objects to retrieve one or more Datastore objects that are related to them. This parameter accepts vSphere VirtualMachine, VMHost, Datacenter, DatastoreCluster, and Folder objects, and vCloud Datastore objects. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Refresh
SwitchParameter
false
false
RelatedObject
DatastoreRelatedObjectBase[]
false
true (ByValue)
Server
VIServer[]
false
false
Return Type Zero or more Datastore objects Notes Examples -------------- Example 1 -------------G e t V M H o s tN a m eV M H o s t 1 ,V M H o s t 2|G e t D a t a s t o r e Retrieves datastores from the VMHost1 and VMHost2 hosts. -------------- Example 2 -------------G e t D a t a s t o r eM a i n D a t a s t o r e *D a t a c e n t e rD a t a c e n t e r 1 Retrieves the datastores from the Datacenter1 datacenter that have names starting with MainDatastore. -------------- Example 3 -------------G e t D a t a s t o r eV M$ v m 1 ,$ v m 2 Gets the datastores for a specified array of virtual machines. -------------- Example 4 -------------G e t D a t a s t o r eV M H o s t$ s c r i p t : v m h o s t Refreshes the host storage system and get its datastores.
Get-DatastoreCluster
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 38/287
7/8/13
Synopsis
This cmdlet retrieves datastore clusters. Syntax Get-DatastoreCluster [-Id <String[]>] [[-Name] <String[]>] [-Location <VIContainer[]>] [-VM <VirtualMachine[]>] [-Template <Template[]>] [-Datastore <Datastore[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-DatastoreCluster Remove-DatastoreCluster Set-DatastoreCluster Detailed Description This cmdlet retrieves datastore clusters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the datastore clusters you want to retrieve. Filters the datastore clusters by the datastores located in them. Specifies the IDs of the datastore clusters you want to retrieve. Specifies the datacenters and folders from which you want to retrieve datastore clusters. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Filters the datastore clusters by the virtual machine templates located in them. Filters the datastore clusters by the virtual machines located in them.
Template[] VirtualMachine[]
false false
Zero or more DatastoreCluster objects Notes Examples -------------- Example 1 -------------G e t D a t a s t o r e C l u s t e r Retrieves all datastore clusters. -------------- Example 2 -------------G e t D a t a s t o r e C l u s t e rN a m eD a t a s t o r e C l u s t e r 1 Retrieves a datastore cluster by name. -------------- Example 3 -------------G e t V MN a m eW e b S e r v e r V M|G e t D a t a s t o r e C l u s t e r Retrieves datastore clusters through filtering by virtual machine.
Get-DeployRule
Synopsis
Gets a DeployRule object. Syntax Get-DeployRule [[-Name] <String[]>] [<CommonParameters>] Related Commands New-DeployRule Detailed Description Gets the DeployRule object with the specified name from the VMware Auto Deploy server. If no rule names are given, all visible rules are returned. Hidden rules start with a dot and can be retrieved by using a wildcard pattern that starts with a dot (e.g. '.example*'). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name
String[]
Name of the deploy rule to retrieve. Wildcard patterns can be used here to retrieve multiple rules at a time.
false
false
Return Type VMware.DeployAutomation.Types.DeployRule Notes Examples -------------- Example 1 -------------C : \ P S >$ r u l e=G e t D e p l o y R u l e" t e s t r u l e "
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
39/287
7/8/13
Copyright 1998 - 2011 VMware, Inc. All rights reserved.
Get-DeployRuleSet
Synopsis
Gets the current working rule set or the current active rule set. Syntax Get-DeployRuleSet [-Active] [-Working] [<CommonParameters>] Related Commands Add-DeployRule Remove-DeployRule Detailed Description Gets the current working rule set or the current active rule set. The active rule set governs how new hosts are to be deployed. The working set can be used to test out changes before making them active. By default, any cmdlets that change the rule set will immediately activate the change. However, you can pass the NoActivate parameter to the cmdlet to delay activation until Switch-ActiveDeployRuleSet is called on the working rule set. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
SwitchParameter SwitchParameter
Retrieve the active rule set. Retrieve the working rule set.
false false
false false
Get-DrsRecommendation
Synopsis
This cmdlet retrieves the available DRS recommendations from the provided clusters. Syntax Get-DrsRecommendation [[-Cluster] <Cluster[]>] [-Refresh] [-Priority <Int32[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Apply-DrsRecommendation Detailed Description This cmdlet retrieves the available DRS recommendations from the provided clusters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the clusters whose DRS recommendations you want to retrieve. Specifies the priority of the DRS recommendations you want to retrieve. The valid values range from 1 to 5. Indicates that you want the cmdlet to refresh the information about the DRS recommendations before retrieving it. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more DrsRecommendation objects Notes Examples -------------- Example 1 -------------G e t C l u s t e rC l u s t e r|G e t D r s R e c o m m e n d a t i o nP r i o r i t y4 , 5 Retrieves the DRS recommendations with priorities 4 and 5 from the Cluster cluster. -------------- Example 2 -------------G e t D r s R e c o m m e n d a t i o nC l u s t e rC l u s t e rR e f r e s h Refreshes and retrieves information about the DRS recommendations from the Cluster cluster.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
40/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Get-DrsRule
Synopsis
This cmdlet retrieves the list of DRS rules for the specified clusters. Syntax Get-DrsRule [[-Name] <String[]>] [-Cluster] <Cluster[]> [[-VM] <VirtualMachine[]>] [-Type <ResourceSchedulingRuleType[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-DrsRule [[-Name] <String[]>] [-Cluster] <Cluster[]> [[-VM] <VirtualMachine[]>] [-VMHost <VMHost[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-DrsRule Remove-DrsRule Set-DrsRule Detailed Description This cmdlet retrieves the list of DRS rules for the specified clusters. Each rule defines the virtual machines that can run on the same host (affinity rule) or must run on different hosts (anti-affinity). Note: To retrieve VMHostAffinity rules, you need to state this explicitly by using the Type or the VMHost parameter. Otherwise, this cmdlet returns VMAffinity and VMAntiAffinity rules. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Cluster VM
Specifies the name of the DRS rule you want to retrieve. Specifies the clusters for which you want to retrieve the DRS rules. Specifies virtual machines to filter the DRS rules that reference them. Passing values to this parameter through a pipeline is deprecated and will be removed in a future release. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the type of DRS rules you want to retrieve. This parameter accepts VMAntiAffinity, VMAffinity, and VMHostAffinity values. You cannot set this parameter, when the VMHost parameter is specified. Specifies VM hosts to filter the DRS rules that reference them. When this parameter is specified, the cmdlet returns only VMHostAffinity rules. You cannot set this parameter, when the Type parameter is specified.
Server
VIServer[]
false
false
Type
ResourceSchedulingRuleType[]
false
false
VMHost
VMHost[]
false
true (ByValue)
Return Type Zero or more DrsRule objects Notes Examples -------------- Example 1 -------------$ m y C l u s t e r=G e t C l u s t e rN a m e" M y C l u s t e r 1 " G e t D r s R u l eC l u s t e r$ m y C l u s t e rN a m e" * R u l e 1 * " Retrieves the DRS rules for the cluster stored in the $myCluster variable, whose names contain "Rule1". -------------- Example 2 -------------G e t C l u s t e rN a m e' M y C l u s t e r 1 '|G e t D r s R u l e Retrieves the virtual machine affinity and anti-affinity rules for the specified cluster by pipeline. -------------- Example 3 -------------$ m y V m 1=G e t V MN a m e' M y V m 1 ' $ m y C l u s t e r 1=G e t C l u s t e r' M y C l u s t e r 1 ' G e t D r s R u l eC l u s t e r$ m y C l u s t e r 1V M$ m y V m 1 Retrieves the virtual machine affinity and anti-affinity rules for the specified virtual machine in the specified cluster. -------------- Example 4 -------------G e t C l u s t e r' M y C l u s t e r 1 '|G e t D r s R u l eT y p eV M H o s t A f f i n i t y Retrieves virtual machine to host affinity rules for the specified cluster by pipeline. -------------- Example 5 -------------$ m y V M H o s t 1=G e t V M H o s tN a m e' M y V M H o s t 1 ' $ m y C l u s t e r 1=G e t C l u s t e rN a m e' M y C l u s t e r 1 ' G e t D r s R u l eC l u s t e r$ m y C l u s t e r 1V M H o s t$ m y V M H o s t 1 Retrieves virtual machine to host affinity rules for the specified host and cluster.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
41/287
7/8/13
Get-ErrorReport
Synopsis
This cmdlet collects debugging information in order to identify a problem in the work environment. Syntax Get-ErrorReport [-ProblemDescription] <String> [-ProblemScriptTimeoutSeconds] <Double> [[-Destination] <DirectoryInfo>] [-ProblemScript] <ScriptBlock> [DontIncludeServerLogs] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet collects debugging information in order to identify a problem in the work environment. The cmdlet runs a script that reproduces the problem and captures any relevant information in a single .zip file. Then, you can send the .zip file to the PowerCLI support for analysis. To generate an error report: 1. Isolate the problem into a simple script. 2. (Optional) Set the vCenter Server logging level to "Trivia". 3. Run Get-ErrorReport to generate the support bundle. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ProblemDescription ProblemScriptTimeoutSeconds
String Double
Provides a description of the problem you want to capture in the error report bundle. Specifies a time period in seconds for which you want to wait for the script to run before considering it non-responding. Specifies the directory where you want to save the error report. If no value is specified for this parameter, the error report is saved in the current file system location. Specifies the script that reproduces the error that you want to report. Indicates that you want no logs from vCenter Server to be included in the error report. Setting this option to $false might slow down the operation.
true true
false false
Destination
DirectoryInfo
false
false
ProblemScript DontIncludeServerLogs
ScriptBlock SwitchParameter
true false
Return Type Zero or more FileInfo objects Notes Examples -------------- Example 1 -------------$ s c r i p t={ C o n n e c t V I S e r v e r1 0 . 2 3 . 3 4 . 3 6 $ v a p p=G e t V A p p G e t V MV ML o c a t i o n$ v a p p }
$ s c r i p t|G e t E r r o r R e p o r tP r o b l e m S c r i p t T i m e o u t S e c o n d s1 0P r o b l e m D e s c r i p t i o n" N oV Mi sr e t u r n e d .T h e r ea r es e v e r a lV M si nt h i sv A p p .T h ev A p pi si naD R S e n a Saves the script that reproduces the error into a variable and passes the script to Get-ErrorReport. The command provides a problem description, a destination for storing the error report, and a time period after which the script is considered non-responding.
Get-EsxCli
Synopsis
This cmdlet exposes the ESXCLI functionality. Syntax Get-EsxCli -VMHost <VMHost[]> [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-EsxTop Detailed Description This cmdlet xposes the ESXCLI functionality. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Specifies hosts on which you want to expose the ESXCLI functionality.
false
true (ByValue)
VMHost
VMHost[]
true
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
42/287
7/8/13
Supported on ESX 4.0/vCenter Server 5.0 and later. Examples -------------- Example 1 --------------
$ e s x c l i=G e t E s x C l iS e r v e r$ g l o b a l : D e f a u l t V I S e r v e r Retrieves ESXCLI from the default ESX connection. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 2 -------------$ e s x c l i . s t o r a g e . n m p Gets a list of all available applications in the specified namespace. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 3 -------------$ e s x c l i . s t o r a g e . n m p . d e v i c e Gets a list of all available commands of the specified application. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 4 -------------$ e s x c l i . s t o r a g e . n m p . d e v i c e . l i s t ( $ n u l l ) Runs a command of an ESXCLI application by using the ESXCLI wrapper of PowerCLI. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 5 -------------$ e s x c l i . s t o r a g e . n m p . d e v i c e . s e t ( $ n u l l ," n a a . 6 0 0 6 0 1 6 0 b 0 4 0 2 0 0 0 f 0 3 6 5 5 7 1 2 a 1 2 d e 1 1 " ," V M W _ P S P _ M R U " ) Runs a command of an ESXCLI application by using the ESXCLI wrapper of PowerCli. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 6 -------------$ e s x c l i . T y p e M a n a g e r . Q u e r y M o I n s t a n c e s ( $ n u l l ) Gets a list of all available managed object instance descriptors. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 7 -------------$ m o T y p e I n f o=$ e s x c l i . T y p e M a n a g e r . Q u e r y T y p e I n f o ( " v i m . E s x C L I . s t o r a g e . n m p . d e v i c e " ) $ m o T y p e I n f o . m a n a g e d T y p e I n f o [ 0 ] . m e t h o d Gets information about the specified managed object type (vim.EsxCLI.storage.nmp.device) and methods. -------------- Example 8 -------------$ m o I n s t a n c e=$ e s x c l i . T y p e M a n a g e r . C r e a t e D y n a m i c M a n a g e d O b j e c t ( " h a c l i h a n d l e r s t o r a g e n m p d e v i c e " ) Creates a dynamic managed object for the specified managed object instance descriptor. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 9 -------------$ m o I n s t a n c e . I n v o k e O p e r a t i o n ( " l i s t " ,$ n u l l ) Calls a method without specifying parameters on a dynamic managed object. This example works only on vCenter Server 5.0/ESXi 5.0. -------------- Example 10 -------------$ m o I n s t a n c e . I n v o k e O p e r a t i o n ( " s e t " ,@ { " d e v i c e "=" n a a . 6 0 0 6 0 1 6 0 b 0 4 0 2 0 0 0 f 0 3 6 5 5 7 1 2 a 1 2 d e 1 1 " ;" p s p "=" V M W _ P S P _ M R U " } ) Calls a method with parameters on a dynamic managed object. The parameters of the method are specified as a hash table. This example works only on vCenter Server 5.0/ESXi 5.0.
Get-EsxImageProfile
Synopsis
Syntax Get-EsxImageProfile [[-Name] <String[]>] [[-Vendor] <String[]>] [[-AcceptanceLevel] <AcceptanceLevels[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description Lists the image profiles from software depots as well as image profiles created by the user. The output is in table form by default. Pass the image profile in the ImageProfile parameter to the New-EsxImageProfile, Export-EsxImageProfile, Set-EsxImageProfile, Add-EsxSoftwarePackage, Remove-EsxSoftwarePackage, and Compare-EsxImageProfile cmdlets in one of these ways: *Use the name of the image profile *Pipe the output of this cmdlet into the cmdlets See each cmdlet's examples for details. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name
String[]
Filters the output to list only image profiles whose Name field
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
43/287
7/8/13
Vendor
String[]
Filters the output to list only image profiles whose Vendor field matches one of the strings supplied. Wildcard characters are supported. Filters the output to list only image profiles whose AcceptanceLevel field matches one of the strings supplied. Must be one of the following values: *VMwareCertified *VMwareAccepted *PartnerSupported *CommunitySupported
false
false
AcceptanceLevel
AcceptanceLevels[]
false
false
---------- Example 1 ---------G e t E s x I m a g e P r o f i l e Display all image profiles from depots and all image profiles the user created during this PowerCLI session: ---------- Example 2 ---------G e t E s x I m a g e P r o f i l eN a m e" E S X 5 . 0 * " Display all ESX 5.0 profiles: ---------- Example 3 ---------G e t E s x I m a g e P r o f i l e|?{ $ _ . V e n d o rn e" V M w a r e " } Display all image profiles from vendors other than VMware: ---------- Example 4 ---------( G e t E s x I m a g e P r o f i l eN a m e" P r o f i l eA " ) . V i b L i s t List all the VIB packages from a particular image profile:
Get-EsxSoftwarePackage
Synopsis
Syntax Get-EsxSoftwarePackage [[-Name] <String[]>] [[-Version] <String[]>] [-Vendor <String[]>] [-AcceptanceLevel <AcceptanceLevels[]>] [-CreatedBefore <DateTime>] [CreatedAfter <DateTime>] [-Newest] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description Returns a list of SoftwarePackage (VIB) objects from all the connected depots, filtered by one or more options. The output is in table form by default. You can pass VIB package names and versions to the New-EsxImageProfile, Set-EsxImageProfile, Add-EsxSoftwarePackage, and Remove-EsxSoftwarePackage cmdlets via the SoftwarePackage parameter. The output of this cmdlet can also be piped into Add-EsxSoftwarePackage and Remove-EsxSoftwarePackage. See the examples under those cmdlets. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name
String[]
Filters the output to list only VIBs whose Name field matches one of the strings supplied. Wildcard characters are supported. Filters the output to list only VIBs whose Version field matches one of the strings supplied. Wildcard characters are supported. Filters the output to list only VIBs whose acceptance level matches one of the strings supplied. Must be one of the following values: * VMwareCertified * VMwareAccepted * PartnerSupported * CommunitySupported
false
false
Version
String[]
false
false
AcceptanceLevel
AcceptanceLevels[]
false
false
Confirm
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
44/287
7/8/13
Newest SwitchParameter
CreatedAfter
DateTime
false
false
CreatedBefore
DateTime
false
false
Vendor
String[]
false
false
---------- Example 1 ---------G e t E s x S o f t w a r e P a c k a g e List all the VIBs from all depots in table form: ---------- Example 2 ---------G e t E s x S o f t w a r e P a c k a g e|S o r t O b j e c tC r e a t i o n D a t e|F o r m a t T a b l eP r o p e r t yN a m e , V e r s i o n , V e n d o r List all the VIBs, sorted by date: ---------- Example 3 ---------G e t E s x S o f t w a r e P a c k a g eV e n d o r" V M w a r e " , " C i s c o "C r e a t e d A f t e r1 / 1 / 2 0 1 0 List all the VIBs from VMware and Cisco created after Jan 1, 2010: ---------- Example 4 ---------G e t E s x S o f t w a r e P a c k a g e|?{ $ _ . V e n d o rn e" V M w a r e " } List all the VIBs from vendors other than VMware ---------- Example 5 ---------G e t E s x S o f t w a r e P a c k a g eN a m e" e s x b a s e "V e r s i o n" 5 . 0 . 0 * " List all the base VIBs for the 5.0.0 release: ---------- Example 6 ---------$ v i b s=G e t E s x S o f t w a r e P a c k a g eN a m e" e s x b a s e "V e r s i o n" 5 . 0 . 0 * " Save the results of a VIB query for later:
Get-EsxTop
Synopsis
This cmdlet exposes the esxtop functionality. Syntax Get-EsxTop [[-CounterName] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-EsxTop [[-CounterName] <String[]>] -Counter [-Server <VIServer[]>] [<CommonParameters>] Get-EsxTop -TopologyInfo [[-Topology] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-EsxCli Detailed Description This cmdlet exposes the esxtop functionality. The default parameter set is CounterValues. The Counter parameter filters the specified statistics. To retrieve all available counters, use the CounterInfo parameter set. The properties of each counter are returned through the Fields property (an array) of the CounterInfo output object. You can also retrieve stats topologies using the TopogyInfo parameter set. This information contains either inventory data that does not change or a counter instance structure describing the relationship between different counter instances. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the name of the counter for which you want to retrieve information. Specifies the topologies for which you want to retrieve information. Indicates that you want to retrieve counters information.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
45/287
7/8/13
Server VIServer[]
SwitchParameter
true
false
Zero or more Counter, TopologyInfo, or CounterValue objects Notes Works only against ESX 4.0 or later. Examples -------------- Example 1 -------------G e t E s x T o pT o p o l o g y I n f o Retrieves the available topologies. -------------- Example 2 -------------G e t E s x T o pC o u n t e r Retrieves the available counters. -------------- Example 3 -------------$ v m=G e t V MV M $ g r o u p=G e t E s x T o pC o u n t e r N a m eS c h e d G r o u p|w h e r e{ $ _ . V M N a m ee q$ v m . N a m e } $ g r=G e t E s x T o pT o p o l o g y I n f oT o p o l o g yS c h e d G r o u p|% { $ _ . E n t r i e s }|w h e r e{ $ _ . G r o u p I de q$ g r o u p . G r o u p I D }
$ c p u I d s=@ ( ) $ g r . C p u C l i e n t|% { $ c p u I d s+ =$ _ . C P U C l i e n t I D } $ c p u S t a t s=G e t E s x T o pC o u n t e r N a m e' V C P U '|w h e r e{ $ c p u I d sc o n t a i n s$ _ . V C P U I D } $ c p u S t a t s|f l* Retrieves statistics for the virtual CPUs of the specified virtual machine.
Get-ExternalNetwork
Synopsis
This cmdlet retrieves cloud external networks. Syntax Get-ExternalNetwork [[-Name] <String[]>] [-VlanId <String[]>] [-ProviderVdc <ProviderVdc[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-ExternalNetwork -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves cloud external networks. You can filter the returned networks by name, ID, virtual LAN ID, and provider vDC. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the cloud external networks you want to retrieve. Specifies the IDs of the cloud external networks you want to retrieve. Retrieves only the external networks accessible by the specified provider Vdc. 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. Specifies the vLAnIDs of the cloud external networks you want to retrieve.
String[]
false
false
Zero or more ExternalNetwork objects Notes Examples -------------- Example 1 -------------G e t E x t e r n a l N e t w o r k Gets all available cloud external networks. You must be connected as a system administrator. -------------- Example 2 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
46/287
7/8/13
G e t E x t e r n a l N e t w o r kN a m eE x t N e t w o r kS e r v e r$ C I S e r v e r Gets an external network named ExtNetwork from provided server. You must be connected as a system administrator. -------------- Example 3 -------------G e t P r o v i d e r V d c" m y P r o v i d e r V D C "|G e t E x t e r n a l N e t w o r k Gets the external networks from the specified provider Vdc. You must be connected as a system administrator.
Get-FloppyDrive
Synopsis
This cmdlet retrieves the virtual floppy drives available on a vCenter Server system. Syntax Get-FloppyDrive [-Id <String[]>] [-Server <VIServer[]>] [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [-Name <String[]>] [<CommonParameters>] Related Commands Online version New-FloppyDrive Remove-FloppyDrive Set-FloppyDrive Detailed Description This cmdlet retrieves the virtual floppy drives available on a vCenter Server system. Returns a set of virtual floppy drives that belong to the virtual machines, templates, and snapshots specified by the VirtualMachine, Template, and Snapshot parameters. At least one of these parameters must be provided. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the virtual machines from which you want to retrieve virtual floppy drives. Specifies the templates from which you want to retrieve virtual CD drives. Specifies the snapshots from which you want to retrieve virtual CD drives. Specifies the IDs of the floppy drives you want to retrieve. Specifies the names of the floppy drives you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more FloppyDrive objects Notes Examples -------------- Example 1 -------------G e t F l o p p y D r i v eV MV M Retrieves the floppy drive of the virtual machine named VM.
Get-Folder
Synopsis
This cmdlet retrieves the folders available on a vCenter Server system. Syntax Get-Folder [-Location <VIContainer[]>] [-Type <FolderType[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-Folder -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-Folder Remove-Folder Set-Folder Move-Folder Detailed Description This cmdlet retrieves the folders available on a vCenter Server system. The cmdlet returns a set of folders that correspond to the filter criteria provided by the cmdlet parameters. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
47/287
7/8/13
Name Id Location NoRecursion Server String[] String[] VIContainer[] SwitchParameter VIServer[]
Type
FolderType[]
false
false
Return Type Zero or more Folder objects Notes Examples -------------- Example 1 -------------$ s e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 G e t F o l d e rS e r v e r$ s e r v e rN a m eF o l d e r Retrieves the folder named Folder on the server with IP address 10.23.112.235. -------------- Example 2 -------------G e t F o l d e rN o R e c u r s i o n Retrieves the root folder. -------------- Example 3 -------------G e t F o l d e rL o c a t i o n$ f o l d e r Gets all folders in the specified location. -------------- Example 4 -------------$ f o l d e r=G e t F o l d e r|S e l e c tf i r s t1 G e t F o l d e rI D$ f o l d e r . I D Gets a folder by ID. -------------- Example 5 -------------G e t F o l d e rT y p eN e t w o r k Gets all network folders.
Get-HAPrimaryVMHost
Synopsis
On vCenter Server 5.0 and later, this cmdlet retrieves the master host of the specified HA cluster. On vCenter Server versions earlier than 5.0, this cmdlet retrieves the primary HA (High-Availability) hosts for the specified clusters. Syntax Get-HAPrimaryVMHost [[-Cluster] <Cluster[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description On vCenter Server 5.0 and later, the cmdlet retrieves the master host of the specified HA cluster. On vCenter Server versions earlier than 5.0, the cmdlet retrieves the primary HA (High-Availability) hosts for the specified clusters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Cluster Server
Cluster[] VIServer[]
Specifies the clusters for which you want to retrieve the HA primary hosts. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
false false
Return Type Zero or more VMHost objects Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
48/287
7/8/13
G e t C l u s t e r|G e t H A P r i m a r y V M H o s t Retrieves the HA primary hosts of the available cluster. -------------- Example 2 -------------G e t H A P r i m a r y V M H o s tC l u s t e r
Get-HardDisk
Synopsis
This cmdlet retrieves the virtual hard disks available on a vCenter Server system. Syntax Get-HardDisk [-Id <String[]>] [-Path <DatastoreItem[]>] [-DiskType <DiskType[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-HardDisk [-Id <String[]>] -Datastore <Datastore[]> [-DatastorePath <String[]>] [-DiskType <DiskType[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-HardDisk [-Id <String[]>] [-DiskType <DiskType[]>] [-Server <VIServer[]>] [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [Name <String[]>] [<CommonParameters>] Related Commands Online version Copy-HardDisk New-HardDisk Remove-HardDisk Set-HardDisk Move-HardDisk Detailed Description This cmdlet returns the virtual hard disks available on a vCenter Server system. You can retrieve a hard disk by specifying the virtual machines, templates, or snapshots to which it belongs. If the hard disk is not attached to any virtual machines, templates, or snapshots, you can search for it in datastores or retrieve it by providing a datastore path to the file where the virtual hard disk is stored. In this case, you might not be able to derive disk type info, and the value of the DiskType property of the hard disk is Unknown. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the virtual machines from which you want to retrieve the hard disks. Specifies the virtual machine templates from which you want to retrieve the hard disks. Specifies the snapshots from which you want to retrieve the hard disks. Specifies the datastores or datastore clusters you want to search for hard disks. This parameter is required when retrieving a hard disk that is attached to no virtual machines, templates, or snapshots. Specifies datastore paths to the hard disks you want to retrieve. The paths must be in the following format: [datastore_name] <file_path>, where [datastore_name] is the name of the datastore in square brackets and <file_path> is a slash-delimited path from the root of the datastore to the virtual hard disk file. The cmdlet searches recursively the specified locations. To learn more about the Datastore Provider, in the vSphere PowerCLI service console, type: help about_vimdatastore
DatastorePath
String[]
false
false
DiskType
DiskType[]
Specifies the type of the hard disks you want to retrieve. The valid values are rawVirtual, rawPhysical, flat, and unknown. If the hard disk is not attached to any virtual machines, templates, or snapshots, you can retrieve it by providing a datastore path to the file where the virtual hard disk is stored. In this case, you might not be able to derive disk type info, and the value of the DiskType property of the hard disk is Unknown. Specifies the IDs of the hard disks you want to retrieve. Specifies the names of the SCSI hard disks you want to retrieve. Specifies the file paths to the virtual hard disks you want to retrieve. The cmdlet searches recursively the specified locations.
false
false
Id Name Path
false false false If in a datastore provider - the current path, else - null.
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
false
false
Return Type Zero or more HardDisk objects Notes Examples -------------- Example 1 -------------G e t H a r d D i s kV MV M Retrieves the hard disks of the virtual machine named VM.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
49/287
7/8/13
-------------- Example 2 -------------G e t H a r d D i s kV M$ v mD i s k T y p ef l a t
Retrieves the flat hard disks from the specified virtual machines. -------------- Example 3 -------------G e t H a r d D i s kD a t a s t o r e" S t o r a g e 1 "D a t a s t o r e P a t h" [ S t o r a g e 1 ]m y V M / " Retrieves the hard disks from the specified datastore and from the specified datastore path.
Get-Inventory
Synopsis
This cmdlet retrieves the inventory items available on a vCenter Server system. Syntax Get-Inventory [-Location <VIContainer[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-Inventory -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Move-Inventory Remove-Inventory Detailed Description This cmdlet retrieves the inventory items available on a vCenter Server system. The cmdlet returns a set of inventory items that correspond to the filter criteria specified by the provided parameters. To specify a server different from the default one, use the -Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the inventory objects you want to retrieve. Specifies the IDs of the inventory objects you want to retrieve. Specifies vSphere container objects (such as folders, datacenters, and clusters) you want to search for inventory items. Indicates that you want to disable the recursive behavior of the command. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more VIObject objects Notes Examples -------------- Example 1 -------------G e t I n v e n t o r yL o c a t i o nD a t a c e n t e rN a m e* P o o l Retrieves all inventory items in the Datacenter datacenter, whose names end with "Pool".
Get-IScsiHbaTarget
Synopsis
This cmdlet retrieves the available iSCSI HBA targets. Syntax Get-IScsiHbaTarget [[-IScsiHba] <IScsiHba[]>] [-Type <IScsiHbaTargetType[]>] [[-IPEndPoint] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-IScsiHbaTarget Remove-IScsiHbaTarget Set-IScsiHbaTarget Get-VMHostHba Set-VMHostHba Detailed Description This cmdlet retrieves the available iSCSI HBA targets. The cmdlet retrieves the configured targets (send and static) on the specified iSCSI storage adapters. If IPEndPoint is specified, filters the result by <Address>:<Port>. If no IScsiHba is provided - retrieves all targets from the entire inventory. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
IPEndPoint
String[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
50/287
7/8/13
IScsiHba Server IScsiHba[] VIServer[]
IScsiHbaTargetType[]
false
false
Zero or more IScsiHbaSendTarget or IScsiHbaStaticTarget objects Notes Examples -------------- Example 1 -------------G e t I S c s i H b a T a r g e tA d d r e s s" 1 0 . 2 3 . 8 4 . 7 3 "T y p eS e n d Retrieves the targets of type Send on the specified address.
Get-LicenseDataManager
Synopsis
Returns the vSphere LicenseDataManager objects for the specified vSphere servers. Syntax Get-LicenseDataManager [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description Returns the vSphere LicenseDataManager objects for the specified vSphere servers. LicenseDataManager allows for extending the vCenter Server inventory with license data associated with inventory nodes. The license data consists of VMware licensing material and takes the form of a list of {license type id, license key} pairs. The inventory nodes which can be associated with license data are individual hosts or host containers, such as clusters, datacenters and datacenter folders. Presence of such license data makes it possible to support automatic licensing when hosts are added to a particular host container entity. LicenseDataManager provides methods for retrieving, creating, modifying and removing associations between license data and inventory nodes. For more information about LicenseDataManager type: Get-Help about_licensedatamanager Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Server
VIServer[]
Specifies the vCenter servers on which 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-VIServer.
false
true (ByValue)
Return Type LicenseDataManager Notes Get-LicenseDataManager is supported only on servers that are vCenter Server 5.0 or higher. Examples -------------- Example 1 -------------C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ l i c e n s e D a t a M a n a g e r=G e t L i c e n s e D a t a M a n a g e r $ l i c e n s e D a t a M a n a g e r . Q u e r y E n t i t y L i c e n s e D a t a ( ) Retrieves all entity<->license data associations. -------------- Example 2 -------------$ v i S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ l i c e n s e D a t a M a n a g e r=G e t L i c e n s e D a t a M a n a g e rS e r v e r$ v i S e r v e r $ h o s t C o n t a i n e r=G e t D a t a c e n t e rN a m eD a t a c e n t e r 1 $ l i c e n s e D a t a M a n a g e r . Q u e r y A s s o c i a t e d L i c e n s e D a t a ( $ h o s t C o n t a i n e r . U i d ) Retrieves the license data associated with Datacenter1. -------------- Example 3 -------------$ v i S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ l i c e n s e D a t a M a n a g e r=G e t L i c e n s e D a t a M a n a g e rS e r v e r$ v i S e r v e r $ l i c e n s e D a t a=N e w O b j e c tV m w a r e . V i m A u t o m a t i o n . L i c e n s e . T y p e s . L i c e n s e D a t a $ l i c e n s e K e y E n t r y=N e w O b j e c tV m w a r e . V i m A u t o m a t i o n . L i c e n s e . T y p e s . L i c e n s e K e y E n t r y $ l i c e n s e K e y E n t r y . T y p e I d=" v m w a r e v s p h e r e "
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
51/287
7/8/13
$ l i c e n s e K e y E n t r y . L i c e n s e K e y=" 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 " $ l i c e n s e D a t a . L i c e n s e K e y s+ =$ l i c e n s e K e y E n t r y $ h o s t C o n t a i n e r=G e t D a t a c e n t e rN a m eD a t a c e n t e r 1 $ l i c e n s e D a t a M a n a g e r . U p d a t e A s s o c i a t e d L i c e n s e D a t a ( $ h o s t C o n t a i n e r . U i d ,$ l i c e n s e D a t a ) Associates new license data with Datacenter1. The license data holds single license key entry suitable for licensing vSphere hosts. -------------- Example 4 -------------$ v i S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ l i c e n s e D a t a M a n a g e r=G e t L i c e n s e D a t a M a n a g e rS e r v e r$ v i S e r v e r $ h o s t C o n t a i n e r=G e t D a t a c e n t e rN a m eD a t a c e n t e r 1 $ l i c e n s e D a t a M a n a g e r . U p d a t e A s s o c i a t e d L i c e n s e D a t a ( $ h o s t C o n t a i n e r . U i d ,$ n u l l ) Removes the license data (if any) associated with Datacenter1. -------------- Example 5 -------------$ v i S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ l i c e n s e D a t a M a n a g e r=G e t L i c e n s e D a t a M a n a g e rS e r v e r$ v i S e r v e r $ h o s t C o n t a i n e r=G e t D a t a c e n t e rN a m eD a t a c e n t e r 1 $ l i c e n s e D a t a M a n a g e r . Q u e r y E f f e c t i v e L i c e n s e D a t a ( $ h o s t C o n t a i n e r . U i d ) Retrieves the merged license data associated with Datacaneter1 and its host container predecessors (in the context of the inventory) (if such predecessors exist and if they are associated some license data). The data is merged in bottom-up fashion such that there is only one license key entry per type id (e.g. child license key entry for a license type id is with higher priority). The resulting merged license data is the effective data used for automatic licensing when vSphere host is added to Datacenter1. -------------- Example 6 -------------$ v i S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ l i c e n s e D a t a M a n a g e r=G e t L i c e n s e D a t a M a n a g e rS e r v e r$ v i S e r v e r $ h o s t C o n t a i n e r=G e t D a t a c e n t e rN a m eD a t a c e n t e r 1 $ l i c e n s e D a t a M a n a g e r . A p p l y A s s o c i a t e d L i c e n s e D a t a ( $ h o s t C o n t a i n e r . U i d ) Applies the merged license data associated with Datacaneter1 and its host container predecessors (using the same rules as in QueryEffectiveLicenseData($hostContainer.Uid)) to all hosts that reside in Datacenter1.
Get-Log
Synopsis
This cmdlet retrieves entries from vSphere logs. Syntax Get-Log [-Key] <String[]> [[-VMHost] <VMHost[]>] [[-StartLineNum] <Int32>] [[-NumLines] <Int32>] [-Server <VIServer[]>] [<CommonParameters>] Get-Log [[-VMHost] <VMHost[]>] [-Bundle] [-DestinationPath] <String> [-Server <VIServer[]>] [-RunAsync] [<CommonParameters>] Related Commands Online version Get-LogType Detailed Description This cmdlet retrieves entries from vSphere logs. Returns portions of the log files according to the criteria provided by the cmdlet parameters. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Key
String[]
Specifies the key identifier of the log file you want to retrieve. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies a local file path where you want to save the log bundle. Specifies the hosts for which you want to retrieve logs. If no value is given to this parameter, the command returns logs only for the default vCenter Server system. Specifies the start line number for reading from the logs. Specifies the number of the lines you want to retrieve from the logs. Indicates whether to retrieve a diagnostic bundle of logs from vCenter Server. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run
true
true (ByValue)
DestinationPath VMHost
String VMHost[]
true false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
52/287
7/8/13
Return Type Zero or more Log or LogBundle objects Notes Examples -------------- Example 1 -------------$ k e y s=G e t L o g T y p e G e t L o gK e y$ k e y s [ 0 ] Obtain the available keys. Obtains the first log file from the currently connected vCenter Server system. -------------- Example 2 -------------$ v m h o s t=G e t V M H o s tH o s t $ k e y L i s t=G e t L o g T y p eV M H o s t$ v m h o s t $ v m h o s t|G e t L o gK e y$ k e y L i s t [ 0 ]S t a r t L i n e N u m1N u m L i n e s1 0 0 Retrieve the first one hundred log lines for the specified host and key. -------------- Example 3 -------------G e t V M o s tH o s t|G e t L o gB u n d l eD e s t i n a t i o n P a t h" D : \ V M H o s t B u n d e L o g " Retrieve a bundle log for the specified host.
Get-LogType
Synopsis
This cmdlet retrieves information about the log types available on a virtual machine host. Syntax Get-LogType [[-VMHost] <VMHost[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-Log Detailed Description This cmdlet retrieves information about the log types available on a virtual machine host. If no virtual machine host is specified, the cmdlet retrieves the log types for the default vCenter Server system. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost
VMHost[]
Specifies the hosts you want to search for log types. If no value is given to this parameter, the command searches for logs only on the default vCenter Server system. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
false
true (ByValue)
Server
VIServer[]
false
false
Return Type Zero or more LogDescriptor objects Notes Examples -------------- Example 1 -------------$ v m h o s t=G e t V M H o s tS t a t e" C o n n e c t e d " G e t L o g t y p eV M H o s t$ v m h o s t Gets information about the available logs on the virtual machine hosts whose state is Connected.
Get-Media
Synopsis
This cmdlet retrieves cloud media. Syntax
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
53/287
7/8/13
Get-Media [[-Name] <String[]>] [-Catalog <Catalog[]>] [-Server <CIServer[]>] [-Owner <CIUser[]>] [<CommonParameters>] Get-Media -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves cloud media. You can filter the returned media by name, ID, catalog, and user. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the media devices you want to retrieve. Specifies the catalogs from which you want to retrieve media devices. Specifies the IDs of the media devices you want to retrieve. Specifies the owners of the cloud media you want to retrieve. 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.
Return Type Zero or more Media objects Notes Examples -------------- Example 1 -------------G e t M e d i aI D$ c l o u d M e d i a I d Retrieves the cloud media devices with the provided IDs. -------------- Example 2 -------------G e t M e d i aN a m ew i n d o w s 7 * Retrieves the cloud media devices with the provided names. -------------- Example 3 -------------G e t C a t a l o gN a m eC a t a l o g 1|G e t M e d i a Retrieves media from the cloud catalog named Catalog1.
Get-NetworkAdapter
Synopsis
This cmdlet retrieves the virtual network adapters available on a vCenter Server system. Syntax Get-NetworkAdapter [-Id <String[]>] [-Server <VIServer[]>] [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [-Name <String[]>] [<CommonParameters>] Get-NetworkAdapter -RelatedObject <NetworkAdapterRelatedObjectBase[]> [<CommonParameters>] Related Commands Online version New-NetworkAdapter Remove-NetworkAdapter Set-NetworkAdapter Detailed Description This cmdlet retrieves the virtual network adapters available on a vCenter Server system. The cmdlet returns a set of virtual network adapters assigned to the virtual machines, templates, and snapshots specified by the VirtualMachine, Template, and Snapshot parameters. At least one of these parameters must be provided. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the virtual machines from which you want to retrieve virtual network adapters. Specifies the templates from which you want to retrieve virtual network adapters. Specifies the snapshots from which you want to retrieve virtual network adapters. Specifies the IDs of the network adapters you want to retrieve. Specifies the names of the network adapters you want to retrieve. Specify an object to retrieve one or more network adapters that are related to the object. This parameter accepts standard and distributed port groups. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the
true (ByValue) true (ByValue) true (ByValue) false false true (ByValue)
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
54/287
7/8/13
Return Type Zero or more NetworkAdapter objects Notes Examples -------------- Example 1 -------------G e t N e t w o r k A d a p t e rV MM y V M
Retrieves the network adapters added to the the MyVM virtual machine. -------------- Example 2 -------------$ m y V D P o r t g r o u p=G e t V D P o r t G r o u pN a m e" M y V D P o r t G r o u p " $ m y N e t w o r k A d a p t e r s=G e t N e t w o r k A d a p t e rR e l a t e d O b j e c t$ m y V D P o r t g r o u p Retrieves all network adapters connected to the specified port group and stores them in the myNetworkAdapters variable.
Get-NetworkPool
Synopsis
This cmdlet retrieves the network pools available on a vCloud Director server. Syntax Get-NetworkPool [[-Name] <String[]>] [-ProviderVdc <ProviderVdc[]>] [-OrgVdc <OrgVdc[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-NetworkPool -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves the network pools available on a vCloud Director server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the network pools you want to retrieve. Specifies the IDs of the network pools you want to retrieve. Specifies organization virtual datacenters (vDCs) to retrieve the network pools assigned to the organization vDCs. Specifies provider virtual datacenters (vDCs) to filter network pools by. The operation retrieves only network pools that are available to the specified provider vDC. 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.
Server
CIServer[]
false
true (ByValue)
Return Type Zero or more NetworkPool objects Notes Examples -------------- Example 1 -------------G e t N e t w o r k P o o lN a m e' M y N e t w o r k P o o l 'O r g V d c' M y O r g V d c 'P r o v i d e r V d c' M y P r o v i d e r V d c ' Retrieve a network pool by specifying the Name, OrgVdc, and ProviderVdc filters. -------------- Example 2 -------------G e t N e t w o r k P o o lI d' M y N e t w o r k P o o l I d ' Retrieve a network pool by specifying its ID. -------------- Example 3 -------------G e t O r g V d c" M y O r g V d c * "|G e t N e t w o r k P o o l Retrieve all network pools that provide network resources for all organization virtual datacenters with names starting with MyOrgVdc. -------------- Example 4 -------------G e t O r g V d c" M y P r o v i d e r V d c * "|G e t N e t w o r k P o o l Retrieve all network pools in all provider virtual datacenters (vDCs) with names starting with MyProviderVdc.
7/8/13
Get-NicTeamingPolicy
Synopsis
This cmdlet retrieves the NIC teaming policies of the specified virtual switches and virtual port groups. Syntax Get-NicTeamingPolicy [-VirtualSwitch] <VirtualSwitch[]> [-Server <VIServer[]>] [<CommonParameters>] Get-NicTeamingPolicy [-VirtualPortGroup] <VirtualPortGroup[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-NicTeamingPolicy Detailed Description This cmdlet retrieves the NIC teaming policies of the specified virtual switches and virtual port groups. The NIC teaming policy determines how network traffic is distributed between adapters and how traffic is reorganized in case of adapter failure. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the port groups whose NIC teaming policy you want to retrieve. Specifies the virtual switches whose NIC teaming policy you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Return Type Zero or more NicTeamingVirtualSwitchPolicy or NicTeamingVirtualPortGroupPolicy objects Notes Examples -------------- Example 1 -------------G e t V i r t u a l P o r t G r o u pV M H o s t( G e t V M H o s t* . 1 2 8 )N a m eV i r t u a l *|G e t N i c T e a m i n g P o l i c y|f li s * For the specified virtual port groups, retrieves the Nic teaming policy settings whose names start with "is". -------------- Example 2 -------------G e t V i r t u a l S w i t c hV M H o s t( G e t V M H o s t* . 1 2 8 )N a m ev s w i t c h|G e t N i c T e a m i n g P o l i c y Retrieves the Nic teaming policy of the specified virtual switch.
Get-Org
Synopsis
This cmdlet retrieves cloud organizations. Syntax Get-Org [[-Name] <String[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-Org -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-OrgVdc Get-OrgNetwork Detailed Description This cmdlet retrieves cloud organizations. If you are connected as a cloud administrator, the cmdlet retrieves all organizations in the cloud. If you are connected as an organization user, the cmdlet retrieves your organization. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Id Server
Specifies the names of the cloud organizations you want to retrieve. Specifies the IDs of the cloud organization you want to retrieve. 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.
Return Type Zero or more Organization objects Notes Examples -------------- Example 1 -------------G e t O r gN a m eO r g a n i z a t i o n 1 Gets an organization by name. You must be connected as a cloud administrator.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
56/287
7/8/13
-------------- Example 2 -------------G e t O r gI D$ o r g a n i z a t i o n I d
Get-OrgNetwork
Synopsis
This cmdlet retrieves cloud organization networks. Syntax Get-OrgNetwork [[-Name] <String[]>] [-ExternalNetwork <ExternalNetwork[]>] [-Org <Org[]>] [-VM <CIVM[]>] [-NetworkPool <NetworkPool[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-OrgNetwork -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-Org Get-OrgVdc Detailed Description This cmdlet retrieves cloud organization networks. You can filter the output by using the cmdlet parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name ExternalNetwork
String[] ExternalNetwork[]
Specifies the names of the cloud organization networks you want to retrieve. Retrieves only the organization networks connected to the specified external networks. Note: This parameter is only available to Provider Administrators. Specifies the IDs of the cloud organization networks you want to retrieve. Retrieves only the organization networks that have been created from the specified pools. Note: This parameter is only available to Provider Administrators. Specifies the organizations for which you want to retrieve networks. 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. Retrieves only the networks to which the specified virtual machines are connected.
false false
Id NetworkPool
String[] NetworkPool[]
true false
Org Server
Org[] CIServer[]
false false
VM Return Type
CIVM[]
false
true (ByValue)
Zero or more OrgNetwork objects Notes Examples -------------- Example 1 -------------G e t O r g N e t w o r k Gets all visible organization networks for the current user. -------------- Example 2 -------------G e t O r g N e t w o r kN a m e" O r g N e t w o r k 1 " Gets an existing organization network named "OrgNetwork1". -------------- Example 3 -------------G e t O r g N e t w o r kI D$ o r g N e t w o r k 1 I d Gets an organization network with given ID. -------------- Example 4 -------------$ m y O r g=G e t O r gN a m e" O r g a n i z a t i o n 1 " G e t O r g N e t w o r kO r g$ m y O r g Gets all visible networks within an organization. -------------- Example 5 -------------$ m y E x t e r n a l N e t w o r k=G e t E x t e r n a l N e t w o r kN a m e" E x t e r n a l N e t w o r k 1 " G e t O r g N e t w o r kE x t e r n a l N e t w o r k$ m y E x t e r n a l N e t w o r k Gets all visible organization networks for an external network. -------------- Example 6 -------------$ m y N e t w o r k P o o l=G e t N e t w o r k P o o lN a m e' M y N e t w o r k P o o l '
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
57/287
7/8/13
G e t O r g N e t w o r kN e t w o r k P o o l$ m y N e t w o r k P o o l Gets all visible organization networks for a network pool. -------------- Example 7 -------------G e t C I V MN a m e" C l o u d V M 1 "|G e t O r g N e t w o r k Gets an organization network for a CIVM.
Get-OrgVdc
Synopsis
This cmdlet retrieves organization vDCs. Syntax Get-OrgVdc [[-Name] <String[]>] [-Org <Org[]>] [-ProviderVdc <ProviderVdc[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-OrgVdc -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-Org Get-OrgNetwork Detailed Description This cmdlet retrieves organization virtual datacenters (vDCs). You can filter the returned objects by using the cmdlet parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the organization vDCs you want to retrieve. Specifies the IDs of the organization vDCs you want to retrieve. Specifies the organizations for which you want to retrieve vDCs. Retrieves the organization vDCs which are part of the specified provider vDC. Note: This parameter is only available to Provider Administrators. 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.
Return Type Zero or more OrgVdc objects Notes Examples -------------- Example 1 -------------G e t O r g V d c Gets the cloud organization VDCs available to you. -------------- Example 2 -------------G e t O r g V d cN a m eO r g a n i z a t i o n 1 * Gets the organization VDCs with names starting with the specified string. -------------- Example 3 -------------G e t O r g V d cI DO r g a n i z a t i o n V d c I d Gets the cloud organization VDC with the provided Id. -------------- Example 4 -------------$ m y P r o v i d e r V d c=G e t P r o v i d e r V d cN a m e' M y P r o v i d e r 1 V d c ' G e t O r g V d cP r o v i d e r V d c$ m y P r o v i d e r V d c Gets all organization VDCs which are part of the specified provider VDC. -------------- Example 5 -------------G e t O r g V d cO r gO r g a n i z a t i o n 1 Retrieves all organization VDCs for the specified organizations. -------------- Example 6 -------------G e t O r gO r g a n i z a t i o n 1|G e t O r g V d cP r o v i d e r V d cP r o v i d e r 1 V d c Retrieves the organization VDCs for an organization which is a part of the provider VDC named Provider1Vdc.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
58/287
7/8/13
Get-OSCustomizationNicMapping
Synopsis
This cmdlet retrieves the configured NIC setting mappings for the specified OS customization specification. Syntax Get-OSCustomizationNicMapping [-OSCustomizationSpec] <OSCustomizationSpec[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-OSCustomizationNicMapping Set-OSCustomizationNicMapping Detailed Description This cmdlet retrieves the configured NIC setting mappings for the specified OS customization specification. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OSCustomizationSpec
OSCustomizationSpec[]
Specifies the OS customization specification for which you want to retrieve the NIC settings mapping. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
true
true (ByValue)
Server
VIServer[]
false
false
Return Type Zero or more OSCustomizationNicMapping objects Notes Examples -------------- Example 1 -------------$ s p e c 1=G e t O S C u s t o m i z a t i o n S p e c" t e s t " $ s p e c 2=G e t O S C u s t o m i z a t i o n S p e c" t e s t _ o l d " G e t O S C u s t o m i z a t i o n N i c M a p p i n gO S C u s t o m i z a t i o n S p e c$ s p e c 1 , $ s p e c 2 Retrieves the NIC mappings of the "test" and "test_old" OS customization specifications.
Get-OSCustomizationSpec
Synopsis
This cmdlet retrieves the OS customization specifications available on a vCenter Server system. Syntax Get-OSCustomizationSpec [[-Server] <VIServer[]>] [[-Name] <String[]>] [-Id <String[]>] [-Type <OSCustomizationSpecType>] [<CommonParameters>] Related Commands Online version New-OSCustomizationSpec Remove-OSCustomizationSpec Set-OSCustomizationSpec Detailed Description This cmdlet retrieves the OS customization specifications available on a vCenter Server system. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Server
String[] VIServer[]
Specifies the names of the OS customization specifications you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the IDs of the OS customization specifications you want to retrieve. Specifis the type of the OS customization specifications you want to retrieve. The valid values are Persistent and NonPersistent.
false false
false false
Id Type
String[] OSCustomizationSpecType
false false
false false
Return Type Zero or more OSCustomizationSpec objects Notes Examples -------------- Example 1 -------------G e t O S C u s t o m i z a t i o n S p e c" t e s t "
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
59/287
7/8/13
-------------- Example 2 --------------
N e w V MN a m eV MV M H o s tH o s tT e m p l a t eT e m p l a t eO S C u s t o m i z a t i o n S p e c$ s p e c Creates a new virtual machine from a template and configures it using a customization specification.
Get-PassthroughDevice
Synopsis
This cmdlet retrieves the pass-through devices available on the specified hosts, virtual machines, and templates. Syntax Get-PassthroughDevice [-VM <VirtualMachine[]>] [-VMHost <VMHost[]>] [-Template <Template[]>] [[-Type] <PassthroughDeviceType>] [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Add-PassthroughDevice Remove-PassthroughDevice Detailed Description This cmdlet retrieves the pass-through devices available on the specified hosts, virtual machines, and templates. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Type
String[] PassthroughDeviceType
Specifies the names of the pass-through devices you want to retrieve. Specifies the type of the pass-through devices you want to retrieve. The valid values are SCSI and PCI. PCI is supported only on vCenter Server 4.0 and ESX 4.0 and higher. Specifies the IDs of the pass-through devices you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the virtual machine templates for which you want to retrieve the pass-through devices. Specifies the virtual machines for which you want to retrieve the pass-through devices. Specifies the hosts for which you want to retrieve the passthrough devices.
false false
false false
Id Server
String[] VIServer[]
false false
false false
Template VM
Template[] VirtualMachine[]
false false
VMHost[]
false
true (ByValue)
Zero or more PassthroughDevice objects Notes Examples -------------- Example 1 -------------G e t P a s s t h r o u g h D e v i c eV M H o s tH o s tT y p eS c s i Retrieves the SCSI passthrough devices of the Host host.
Get-PowerCLIConfiguration
Synopsis
This cmdlet retrieves the vSphere PowerCLI proxy configuration and default servers policy. Syntax Get-PowerCLIConfiguration [-Scope <ConfigurationScope>] [<CommonParameters>] Related Commands Online version Set-PowerCLIConfiguration Detailed Description This cmdlet retrieves the vSphere PowerCLI proxy configuration and default servers policy. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Scope
ConfigurationScope
Specifies a scope to filter vSphere PowerCLI settings by. The parameter accepts Session, User, and All Users values.
false
false
Return Type
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
60/287
7/8/13
One or more PowerCLIConfiguration objects Notes Examples -------------- Example 1 -------------G e t P o w e r C L I C o n f i g u r a t i o n
Retrieves information about the vSphere PowerCLI configuration for every scope. -------------- Example 2 -------------G e t P o w e r C L I C o n f i g u r a t i o nS c o p eU s e r Retrieves information about the vSphere PowerCLI configuration for the User scope. -------------- Example 3 --------------
G e t P o w e r C L I C o n f i g u r a t i o nS c o p e( [ V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . C o n f i g u r a t i o n S c o p e ] : : S e s s i o nb o r[ V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . C o n f i g u r a t i o n S Retrieves information about the vSphere PowerCLI configuration for the User and Session scopes.
Get-PowerCLIVersion
Synopsis
This cmdlet retrieves the versions of the installed PowerCLI snapins. Syntax Get-PowerCLIVersion [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves the versions of the installed PowerCLI snapins. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Return Type One or more PowerCLIVersion objects Notes Examples -------------- Example 1 -------------G e t P o w e r C L I V e r s i o n Retrieves the version of vSphere PowerCLI. -------------- Example 2 -------------G e t P o w e r C L I V e r s i o n|s e l e c te x p a n dS n a p i n V e r s i o n s Lists the versions of additional PowerCLI snapins.
Get-ProviderVdc
Synopsis
This cmdlet retrieves the specified cloud provider vDCs. Syntax Get-ProviderVdc [[-Name] <String[]>] [-ExternalNetwork <ExternalNetwork[]>] [-OrgVdc <OrgVdc[]>] [-Server <CIServer[]>] [<CommonParameters>] Get-ProviderVdc -Id <String[]> [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Get-OrgVdc Detailed Description This cmdlet retrieves cloud provider virtual datacenters (vDCs). Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name ExternalNetwork
String[] ExternalNetwork[]
Specifies the names of the provider vDCs you want to retrieve. Specifies that you want to retrieve only the vDCs accessible by the provided external networks.
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
61/287
7/8/13
Id OrgVdc Server String[] OrgVdc[] CIServer[]
Return Type Zero or more ProviderVdc objects Notes Examples -------------- Example 1 -------------G e t O r g V d cO r g V d c|G e t P r o v i d e r V d c Gets the provider VDC for the specified organization VDC. -------------- Example 2 -------------G e t P r o v i d e r V d cN a m eP r o v i d e r V D CS e r v e rC I S e r v e r Gets the provider VDC named ProviderVDC from the specified server. -------------- Example 3 -------------G e t P r o v i d e r V d cI D" u r n : v c l o u d : p r o v i d e r v d c : e 8 7 e d 4 6 d 9 0 4 4 4 d 3 1 b 4 f 6 1 b c 9 6 9 5 f d 0 1 c " ," u r n : v c l o u d : p r o v i d e r v d c : 6 1 4 3 8 1 8 e 9 a 4 4 4 9 c 5 8 7 e d a b 0 d a c 8 d 9 7 4 6 " Gets provider VDCs by their IDs.
Get-ResourcePool
Synopsis
This cmdlet retrieves the resource pools available on a vCenter Server system. Syntax Get-ResourcePool [-VM <VirtualMachine[]>] [-Location <VIContainer[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-ResourcePool -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Get-ResourcePool -RelatedObject <ResourcePoolRelatedObjectBase[]> [<CommonParameters>] Related Commands Online version New-ResourcePool Remove-ResourcePool Set-ResourcePool Move-ResourcePool Detailed Description Retrieves the resource pools available on a vCenter Server system. The cmdlet returns a set of resource pools that correspond to the filter criteria provided by the cmdlet parameters. Virtual machine hosts have a hidden resource pool named Resources, which is a parent of all resource pools of the host. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Id Location
Specifies the names of the resource pools you want to retrieve. Specifies the IDs of the resource pools you want to retrieve. Specifies vSphere container objects (such as folders, datacenters, and clusters) you want to search for resource pools. Indicates that you want to disable the recursive behavior of the command. Specifies objects to retrieve one or more ResourcePool objects that are related to them. This parameter accepts ProviderVdc objects. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Specifies virtual machines to filter the resource pools that contain at least one of them.
NoRecursion RelatedObject
SwitchParameter ResourcePoolRelatedObjectBase[]
false true
Server
VIServer[]
false
false
VM Return Type
VirtualMachine[]
false
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
62/287
7/8/13
$ s e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 G e t R e s o u r c e P o o lS e r v e r$ s e r v e rV MV M
Retrieves information of the resource pool to which the virtual machine MS Win belongs.
Get-ScsiController
Synopsis
This cmdlet retrieves the virtual SCSI controllers assigned to the specified HardDisk, VirtualMachine, Template, and Snapshot objects. Syntax Get-ScsiController [-Id <String[]>] [-HardDisk <HardDisk[]>] [-Server <VIServer[]>] [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [-Name <String[]>] [<CommonParameters>] Related Commands Online version New-ScsiController Set-ScsiController Detailed Description This cmdlet retrieves the virtual SCSI controllers assigned to the specified HardDisk, VirtualMachine, Template, and Snapshot objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Filters the SCSI controllers by the virtual machines they belong to. Filters the SCSI controllers by the virtual machine templates they belong to. Filters the SCSI controllers by the snapshots they belong to. Filters the SCSI controllers by the hard disks they belong to. Specifies the IDs of the SCSI controllers you want to retrieve. Specifies the names of the SCSI controllers you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
true (ByValue) true (ByValue) true (ByValue) true (ByValue) false false false
Return Type Zero or more ScsiController objects Notes Examples -------------- Example 1 -------------G e t V MV M 1 ,V M 2|G e t S c s i C o n t r o l l e r Retrieves the SCSI controllers of the VM1 and VM2 virtual machines. -------------- Example 2 -------------G e t V MV M|G e t S n a p s h o tS n a p s h o t|G e t S c s i C o n t r o l l e r Retrieves the SCSI controllers of a virtual machine snapshot. -------------- Example 3 -------------$ d i s k=G e t V MV M|G e t H a r d D i s k|S e l e c tF i r s t2 G e t S c s i C o n t r o l l e rH a r d D i s k$ d i s k Retrieves the SCSI controllers of the first two hard disks of a virtual machine.
Get-ScsiLun
Synopsis
This cmdlet retrieves the SCSI devices available on the vCenter Server system. Syntax Get-ScsiLun Get-ScsiLun Get-ScsiLun Get-ScsiLun [[-CanonicalName] <String[]>] [-VmHost] <VMHost[]> [-Key <String[]>] [-LunType <String[]>] [-Server <VIServer[]>] [<CommonParameters>] -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] [[-CanonicalName] <String[]>] [-Hba] <Hba[]> [-Key <String[]>] [-LunType <String[]>] [-Server <VIServer[]>] [<CommonParameters>] [[-CanonicalName] <String[]>] [-Datastore] <Datastore[]> [-Key <String[]>] [-LunType <String[]>] [-Server <VIServer[]>] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
63/287
7/8/13
Set-ScsiLun Set-ScsiLunPath Detailed Description
This cmdlet retrieves the SCSI devices available on the vCenter Server system. Examples of SCSI logical unit objects include disks which may contain file system volumes or parts of volumes for the host or might serve as raw disks to a virtual machine. Other examples include SCSI passthrough devices that can be used by virtual machines. When retrieving ScsiLun objects by Datastore, the cmdlet returns a ScsiLun object for each host connected to the specified datastore. ScsiLun objects can be differed by their VMHost property. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the canonical name of the SCSI devices you want to retrieve. An example of a SCSI canonical name for Windows is "vmhba0:0:0:0". Specifies the datastores for which you want to retrieve the SCSI devices. This parameter is supported only for VMFS volumes. Specifies the storage adapters for which you want to retrieve the SCSI devices. Specifies the hosts from which you want to retrieve the virtual SCSI devices. Specifies the IDs of the SCSI devices that you want to retrieve. Specifies the linkable identifiers of the SCSI devices you want to retrieve. Specifies the type of the SCSI devices you want to retrieve. The following types are valid: cdrom communications disk enclosure mediaChanger opticalDevice printer processor scanner storageArrayController tape unknown worm
false true (ByValue) true (ByValue) true (ByValue) false false false
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
false
false
Return Type Zero or more ScsiLun objects Notes Examples -------------- Example 1 -------------G e t S c s i L u nV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0L u n T y p ed i s k Retrieves the SCSI devices of "disk" type for the virtual machine host with an IP address 10.23.123.100. -------------- Example 2 -------------G e t V M H o s t|G e t S c s i L u nC a n o n i c a l N a m e" n a a . * " Retrieves the SCSI devices with canonical names that starts with "naa." on the provided host. -------------- Example 3 -------------$ h b a=G e t V M H o s t|G e t V M H o s t H b aT y p eP a r a l l e l S c s i G e t S c s i L u nH b a$ h b aL u n T y p ed i s k Retrieves the SCSI devices of "disk" type for the specified HBA devices. -------------- Example 4 -------------G e t S c s i L u nD a t a s t o r eD a t a s t o r eK e y" k e y v i m . h o s t . S c s i D i s k * " For the Datastore datastore, retrieves the SCSI devices that have the specified linkable identifiers.
Get-ScsiLunPath
Synopsis
This cmdlet retrieves the list of vmhba paths to a specified SCSI device. Syntax Get-ScsiLunPath [[-Name] <String[]>] [-ScsiLun] <ScsiLun[]> [<CommonParameters>] Related Commands Online version Get-ScsiLun Set-ScsiLunPath Set-ScsiLun
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
64/287
7/8/13
Detailed Description
This cmdlet retrieves the list of vmhba paths to a specified SCSI device. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name ScsiLun
String[] ScsiLun[]
Specifies the name of the SCSI device whose vmhba paths you want to retrieve. Specifies the SCSI device whose vmhba paths you want to retrieve.
false true
Return Type Zero or more ScsiLunPath objects Notes Examples -------------- Example 1 -------------$ s c s i l u n=G e t S c s i L u nV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0L u n T y p ed i s k G e t S c s i L u n P a t h$ s c s i l u n Retrieves the vmhba path to the specified SCSI device.
Get-Snapshot
Synopsis
This cmdlet retrieves the virtual machine snapshots available on a vCenter Server system. Syntax Get-Snapshot [[-Name] <String[]>] [-Id <String[]>] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-Snapshot Remove-Snapshot Set-Snapshot Detailed Description This cmdlet returns information about the snapshots that correspond to the filter criteria provided by the Name and VM parameters. The disk size of the snapshots is retrieved only if you have the "Datastore/Browse datastore" privilege to the datastore where the shapshot is located. Otherwise, the following message is displayed: "Unable to populate snapshot size due to unsufficient permissions." Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM
VirtualMachine[]
Specifies the virtual machines whose snapshots you want to retrieve. The position of this parameter is deprecated and will be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions, specify the parameter by name. Specifies the names of the snapshots you want to retrieve. Specifies the IDs of the snapshots you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
true
true (ByValue)
Name Id Server
Return Type Zero or more Snapshot objects Notes Examples -------------- Example 1 -------------G e t S n a p s h o tV MV MN a m e' B e f o r eS e r v i c e P a c k2 ' Retrieves the snapshot named "Before ServicePack2" of the VM virtual machine.
Get-Stat
Synopsis
This cmdlet retrieves the statistical information available on a vCenter Server system. Syntax Get-Stat [-Entity] <VIObject[]> [-Common] [-Memory] [-Cpu] [-Disk] [-Network] [-Stat <String[]>] [-Start <DateTime>] [-Finish <DateTime>] [-MaxSamples <Int32>] [IntervalMins <Int32[]>] [-IntervalSecs <Int32[]>] [-Instance <String[]>] [-Realtime] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-StatType
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
65/287
7/8/13
Get-StatsInterval New-StatsInterval Remove-StatsInterval Set-StatsInterval Detailed Description
This cmdlet retrieves the statistical information available on a vCenter Server system for each provided entity. For example, if the CPU parameter is set to $true, collects the average CPU usage and the average CPU usagemhz counters as appropriate for each entity. If the Stats parameter is set to $true, collects all provided named stats counters. Counters are provided using a dotted notation of the form "counter group"."counter name"."rollup type". For example: "cpu.usage.min". The cmdlet uses the Start time, if provided, and the Finish time, if provided, along with the MaxSamples, if provided, to bound the data collection. If intervalSecs is provided, the closest matching available interval is used. For each statistics sample on the server, the cmdlet returns a Sample object. The Instance property of the Sample object shows the serial number of the device for which a statistics value is taken. If the Instance property is empty ("), this indicates that the statistics sample contains an average statistic value for all specified devices. If you are connected to a vCenter Server and Get-Stat is run for a host entity, the cmdlet returns only the statistics available on the vCenter Server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the objects (such as virtual machine, virtual machine host, resource pool, and so on) whose statistics you want to retrieve. Indicates whether the command collects common CPU, disk, memory and network statistics. Indicates whether the command collects common CPU statistics, such as the average CPU usage and average CPU usagemhz counters as appropriate for each entity. Indicates whether the command collects common disk statistics, such as the average disk usage, average disk read and average disk write counters as appropriate for each entity. Specifies the end of the time range for which you want to collect statistics. The valid format is dd/mm/yyyy. Specifies the Instance property of the statistics you want to retrieve. Specifies one or more intervals in minutes of the statistics samples you want to retrieve. The closest available statistics interval is taken. To retrieve statistics samples for all available intervals, pass *. If the IntervalMins parameter is not specified, the samples with the best sample rate are retrieved. A best sample rate is the highest sample rate, whose relevant period contains the relevant periods for all other sample rates. A relevant period is the period that starts no earlier than the oldest sample still retained, and is a subset of a query period specified by the user. Specifies one or more intervals in seconds of the statistics samples you want to retrieve. The closest available statistics interval is taken. To retrieve statistics samples for all available intervals, pass *. Specifies the maximum number of samples for each statistic. Indicates whether the command collects common memory statistics, such as the mem usage, mem vmmemctl, mem active and mem granted counters as appropriate for each entity. Indicates whether the command collects common network statistics, such as the average network usage, average network transmitted and average network received counters as appropriate for each entity. Indicates whether the command collects real time statistics. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the beginning of the time range for which you want to collect statistics. The valid format is dd/mm/yyyy. Specifies the identifiers of the statistics you want to retrieve. Counters are provided using a dotted notation of the form "counter group"."counter name"."rollup type". For example, "cpu.usage.min".
Disk
SwitchParameter
false
false
IntervalSecs
Int32[]
false
false
MaxSamples Memory
Int32 SwitchParameter
false false
false false
Network
SwitchParameter
false
false
Realtime Server
SwitchParameter VIServer[]
false false
false false
Start Stat
DateTime String[]
false false
false false
Return Type Zero or more LongSample or FloatSample objects Notes Samples are not generated for a virtual machine while it is powered off. Examples -------------- Example 1 -------------G e t S t a tE n t i t yV MS t a r t5 / 5 / 2 0 0 8F i n i s h7 / 1 0 / 2 0 0 8D i s kI n t e r v a l S e c s3 0 0 Prints the disk statistics for the specified time interval for the first virtual machine, retrieved by the Get-VM cmdlet. -------------- Example 2 -------------G e t S t a tE n t i t yH o s tC p uI n s t a n c e0 ," Retrieves the cumulative statistics for a multiprocessor host and the CPU statistics for the first processor. -------------- Example 3 -------------G e t V M H o s tN a m e" M y V M H o s t "|G e t S t a tN e t w o r kI n t e r v a l S e c s2 0 Retrieves the network usage statistics for the specified host for the specified time interval. -------------- Example 4 -------------G e t V MN a m e" M y V M "|G e t S t a tS t a t" m e m . u s a g e . a v e r a g e "S t a r tM y S t a r t D a t e T i m eF i n i s hM y F i n i s h D a t e T i m eM a x S a m p l e s1 0
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
66/287
7/8/13
Retrieves the average memory usage statistics for the specified virtual machine between the specified start and finish date and time. The maximum number of retrieved samples is limited to 10. -------------- Example 5 -------------G e t V MN a m e" M y V M "|G e t S t a tC P UM e m o r yR e a l t i m e Retrieves the real-time CPU and memory usage statistics for the specified virtual machine. -------------- Example 6 -------------G e t V M H o s tN a m e" M y V M H o s t "|G e t S t a tC o m m o n Retrieves the common statistics for the specified host. -------------- Example 7 -------------G e t S t a tE n t i t y" M y V M H o s t "D i s k Retrieves the disk usage statistics for the specified host.
Get-StatInterval
Synopsis
This cmdlet retrieves the available statistics intervals and filters them using the provided parameters. Syntax Get-StatInterval [[-Name] <String[]>] [[-SamplingPeriodSecs] <Int32[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-Stat Get-StatType New-StatInterval Remove-StatInterval Set-StatInterval Detailed Description This cmdlet retrieves the available statistics intervals and filters them using the provided parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name SamplingPeriodSecs
String[] Int32[]
Specifies the names of the statistics intervals you want to retrieve. Specifies the sampling period of the statistics intervals you want to retrieve. The sampling period is an integer that defines (in seconds) the interval of the statistics sample. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
false false
false false
Server
VIServer[]
false
true (ByValue)
Return Type Zero or more StatInterval objects Notes Examples -------------- Example 1 -------------G e t S t a t I n t e r v a l Retrieves the available statistics intervals.
Get-StatType
Synopsis
This cmdlet retrieves the available statistics types for a inventory object. Syntax Get-StatType [[-Name] <String[]>] [-Entity] <InventoryItem[]> [-Start <DateTime>] [-Finish <DateTime>] [-Interval <StatInterval[]>] [-Realtime] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-Stat Get-StatInterval New-StatInterval Remove-StatInterval Set-StatInterval Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
67/287
7/8/13
This cmdlet retrieves the available statistics types for a virtual machine, virtual machine host, cluster, or resource pool. Performance statistics types can be filtered by their names, start and finish times, and collection intervals. If the Realtime parameter is set, the Start and Finish parameters are ignored. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the statistics types you want to retrieve. Specifies clusters, virtual machine hosts, resource pools, or virtual machines, for which you want to retrieve the available statistics types. Specifies the end of the time range for which the statistics types you want to retrieve are collected. The valid format is dd/mm/yyyy. This value corresponds to the server time. When the finish time is omitted, the returned result includes up to the most recent statistics type. Specifies the interval at which the statistics types you want to retrieve are gathered. The interval can be specified by its name or by its sampling period in seconds. Indicates that you want to retrieve realtime statistics type as well. If this parameter is set, the Start and Finish parameters are ignored. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the beginning of the time range for which the statistics types you want to retrieve are collected. The valid format is dd/mm/yyyy. This value corresponds to the server time. When the start time is omitted, the returned statistics types start from the first available statistics type in the system.
Interval
StatInterval[]
false
false
Realtime Server
SwitchParameter VIServer[]
false false
false false
Start
DateTime
false
false
Return Type Zero or more System.String objects Notes Zero or more strings representing statistics types. Examples -------------- Example 1 -------------G e t S t a t T y p eE n t i t yV M Retrieves the statistics types collected for the VM virtual machine.
Get-Task
Synopsis
This cmdlet retrieves the tasks on a vCenter Server system. Syntax Get-Task [[-Status] <TaskState>] [-Server <VIConnection[]>] [<CommonParameters>] Get-Task -Id <String[]> [-Server <VIConnection[]>] [<CommonParameters>] Related Commands Online version Stop-Task Wait-Task Detailed Description This cmdlet retrieves the tasks on a vCenter Server system. The cmdlet retrieves information about the current or recent tasks. Use the Status parameter to filter tasks by their current status. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Status
TaskState
Specifies the status of the tasks you want to retrieve. The valid values are Error, Queued, Running, and Success. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies the IDs of the tasks that you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
false
true (ByValue)
Id Server
String[] VIConnection[]
true false
false false
Return Type Zero or more Task objects Notes Examples -------------- Example 1 -------------$ s e r v=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ t a s k=G e t T a s kS e r v e r$ s e r vS t a t u sE r r o r $ t a s k Retrieves information on all tasks on the server with IP address 10.23.112.235, whose state is "Error".
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
68/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Get-Template
Synopsis
This cmdlet retrieves the virtual machine templates available on a vCenter Server system. Syntax Get-Template [-Location <VIContainer[]>] [-Datastore <StorageResource[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-Template -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-Template Remove-Template Set-Template Detailed Description This cmdlet retrieves the virtual machine templates available on a vCenter Server system. The cmdlet returns a set of templates that correspond to the filter criteria defined by the cmdlet parameters. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the virtual machine templates you want to retrieve. Filters templates by the datastores or datastore clusters that they are stored on. Specifies the IDs of the virtual machine templates you want to retrieve. Specifies the vSphere container objects (such as folders, datacenters, and clusters) you want to search for templates. Indicates that you want to disable the recursive behavior of the command. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more Template objects Notes Examples -------------- Example 1 -------------G e t T e m p l a t eN a m eW e b *L o c a t i o nD a t a c e n t e r Retrieves all virtual machine templates in the Datacenter datacenter, whose names start with "Web".
Get-UsbDevice
Synopsis
This cmdlet retrieves the USB devices available on a vCenter Server system. Syntax Get-UsbDevice [-Id <String[]>] [-Server <VIServer[]>] [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [-Name <String[]>] [<CommonParameters>] Related Commands Online version Remove-UsbDevice Detailed Description This cmdlet retrieves the USB devices available on a vCenter Server system. The cmdlet returns a set of virtual USB devices assigned to the virtual machines, templates, and snapshots specified by the VirtualMachine, Template, and Snapshot parameters. At least one of these parameters must be provided. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the virtual machines whose virtual USB drives you want to retrieve. Specifies the virtual machine templates whose virtual USB drives you want to retrieve. Specifies the virtual machine snapshots whose virtual USB you want to retrieve. Supported only on vCenter Server 4.0 and ESX 4.0 and higher. Specifies the IDs of the USB devices you want to retrieve. Specifies the names of the USB devices you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
69/287
7/8/13
Return Type Zero or more UsbDevice objects Notes
The -Snapshot parameter is supported only on vCenter Server 4.0 and ESX 4.0 and higher. Examples -------------- Example 1 -------------G e t U s b D e v i c eV M( G e t V ML o c a t i o nH o s t ) Retrieves the USB devices attached to the virtual machines on the Host host.
Get-VApp
Synopsis
This cmdlet retrieves vApps. Syntax Get-VApp [-Location <VIContainer[]>] [[-Name] <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>] Get-VApp -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Export-VApp Import-VApp New-VApp Remove-VApp Set-VApp Start-VApp Stop-VApp Move-VApp Detailed Description This cmdlet retrieves vApps. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the vApps that you want to retrieve. Specifies the IDs of the vApps that you want to retrieve. Specifies Folder, Cluster, Datacenter, VMHost, and ResourcePool objects you want to search for vApps. Indicates that you want to disable the recursive behavior of the command. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more VApp objects Notes Examples -------------- Example 1 -------------G e t R e s o u r c e P o o lM y R e s o u r c e P o o l 1|G e t V A p pN o R e c u r s i o n Retrieves all the vApps in the ResourcePool resource pool with no recursion.
Get-VDPortgroup
Synopsis
This cmdlet retrieves distributed port groups. Syntax Get-VDPortgroup [[-Name] <String[]>] [-NetworkAdapter <NetworkAdapter[]>] [-VDSwitch <VDSwitch[]>] [-VMHostNetworkAdapter <HostVirtualNic[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VDPortgroup -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Get-VDPortgroup -RelatedObject <VDPortgroupRelatedObjectBase[]> [<CommonParameters>] Related Commands Online version New-VDPortgroup Remove-VDPortgroup Set-VDPortgroup Export-VDPortgroup
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
70/287
7/8/13
Detailed Description This cmdlet retrieves distributed port groups. Parameters
NA ME TYPE
DESCRIPTION
REQUIRED?
PIPELINE INPUT
Name Id NetworkAdapter
Specifies the names of the distributed port groups that you want to retrieve. Specifies the IDs of the distributed port groups that you want to retrieve. Specifies a virtual machine network adapter to retrieve the distributed port group to which the network adapter is connected. Specifies an object to retrieve one or more distributed port groups that are related to the object. This parameter accepts ExternalNetwork, OrgNetwork, and NetworkPool objects. Specify the vCenter Server systems 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 ConnectVIServer. Specifies a vSphere distributed switch to retrieve the distributed port groups that belong to the switch. Specifies a host virtual network adapter to retrieve the distributed port groups to which the network adapter is connected.
RelatedObject
VDPortgroupRelatedObjectBase[]
true
true (ByValue)
Server
VIServer[]
false
false
VDSwitch
VDSwitch[]
false
true (ByValue)
VMHostNetworkAdapter
HostVirtualNic[]
false
true (ByValue)
Return Type Zero or more VDPortgroup objects Notes Examples -------------- Example 1 -------------G e t V D P o r t G r o u pN a m e" M y V D P o r t G r o u p "V D S w i t c h" M y V D S w i t c h " Retrieves the distributed port group named "MyVDPortGroup" on the specified vSphere distributed switch. -------------- Example 2 -------------G e t O r g N e t w o r kN a m e" M y O r g N e t w o r k "|G e t V D P o r t G r o u p Retrieves the distributed port groups that are related to the specified organization network in the cloud. -------------- Example 3 -------------G e t N e t w o r k A d a p t e rN a m e" M y V M N e t w o r k A d a p t e r "|G e t V D P o r t G r o u p Retrieves the distributed port group to which the specified virtual machine network adapter is connected.
Get-VDSwitch
Synopsis
This cmdlet retrieves vSphere distributed switches. Syntax Get-VDSwitch [[-Name] <String[]>] [-Location <FolderContainer[]>] [-VMHost <VMHost[]>] [-VM <VirtualMachine[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VDSwitch -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Get-VDSwitch -RelatedObject <VDSwitchRelatedObjectBase[]> [<CommonParameters>] Related Commands Online version Remove-VDSwitch New-VDSwitch Set-VDSwitch Export-VDSwitch Detailed Description This cmdlet retrieves vSphere distributed switches. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Id Location
Specifies the names of the vSphere distributed switches that you want to retrieve. Specifies the IDs of the vSphere distributed switches that you want to retrieve. Specifies vCenter Server container objects that you want to search for vSphere distributed switches. This parameter accepts Datacenter and Folder objects.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
71/287
7/8/13
RelatedObject VDSwitchRelatedObjectBase[]
Server
VIServer[]
false
false
VirtualMachine[] VMHost[]
false false
Zero or more VDSwitch objects Notes Examples -------------- Example 1 -------------G e t D a t a c e n t e rN a m eM y D a t a c e n t e r|G e t V D S w i t c h Retrieves all vSphere distributed switches in the specified datacenter. -------------- Example 2 -------------G e t V M H o s tN a m eM y V M H o s t|G e t V D S w i t c h Retrieves all vSphere distributed switches to which the specified host is added. -------------- Example 3 -------------G e t V MN a m eM y V M|G e t V D S w i t c h Retrieves all vSphere distributed switches to which the specified virtual machine is connected.
Get-VIAccount
Synopsis
This cmdlet retrieves the accounts from the ESX/ESXi or vCenter Server. Syntax Get-VIAccount [-Group] [-User] [[-Name] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VIAccount [-Group] [-User] [[-Id] <String[]>] [-Domain <String>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-VMHostAccount Set-VMHostAccount Remove-VMHostAccount Detailed Description This cmdlet retrieves the accounts from the ESX/ESXi or vCenter Server. The Group and User switch parameters let you retrieve group and user accounts. By default, the cmdlet lists only user accounts. If the Domain parameter is specified, the cmdlet retrieves only the accounts on the specified AD domain. Otherwise, only local accounts are listed. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the IDs of the accounts you want to retrieve. Specifies the names of the accounts you want to retrieve. Specifies AD domains to search for accounts. Specifies that you want to retrieve only group accounts. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies that you want to retrieve only user accounts.
User
SwitchParameter
false
false
Return Type Zero or more VIAccount objects Notes Examples -------------- Example 1 -------------G e t V I A c c o u n tI dA d m i n i s t r a t o r Retrieve accounts by Id. -------------- Example 2 -------------G e t V I A c c o u n tG r o u p
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
72/287
7/8/13
Retrieve all group accounts. -------------- Example 3 -------------G e t V I A c c o u n tI dA d m i n i s t r a t o rD o m a i n" M S D o m a i n " Get all VIAccounts for specified ID and Domain. -------------- Example 4 -------------G e t V I A c c o u n tD o m a i n" M S D o m a i n " Retrieve all accounts for the specified domain.
Get-VICredentialStoreItem
Synopsis
This cmdlet retrieves the credential store items available on a vCenter Server system. Syntax Get-VICredentialStoreItem [[-Host] <String>] [[-User] <String>] [[-File] <String>] [<CommonParameters>] Related Commands Online version New-VICredentialStoreItem Remove-VICredentialStoreItem Detailed Description This cmdlet retrieves the credential store items that correspond to the filter criteria defined by the Host and User parameters. Both the Host and User parameters support wildcards. If none of the Host and User parameters are specified, all available credential store items are returned. If the Host and User parameters are specified without using wildcards, and no item is found, non-terminating errors are reported for the Host and User parameters. If no file is specified, items are retrieved from the default credential store file %APPDATA%\VMware\credstore\vicredentials.xml. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies hosts for which you want to retrieve credential store items. Specifies users for which you want to retrieve credential store items. Specifies a path to a file where the credential store items that you want to retrieve are saved.
Return Type Zero or more VICredentialStoreItem objects Notes Examples -------------- Example 1 -------------G e t V I C r e d e n t i a l S t o r e I t e mU s e ra d m i nH o s t1 9 2 . 1 6 8 . 1 . 1 0F i l e' c r e d e n t i a l s . x m l ' Retrieves the credentials for the 'admin' user on the specified host from a credential store file.
Get-VIEvent
Synopsis
This cmdlet retrieves information about the events on a vCenter Server system. Syntax Get-VIEvent [[-Entity] <VIObject[]>] [-Start <DateTime>] [-Finish <DateTime>] [-Username <String>] [-MaxSamples <Int32>] [-Types <EventCategory[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet retrieves information about the events on a vCenter Server system. An event is any action in the vCenter Server system or ESX/ESXi host. You can filter retrieved events by specifying arguments for the cmdlet parameters. Filters are additive. For example, when you specify the Entity, Start, and Finish parameters, GetVIEvent filters events both by the entity and the timestamp properties. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Entity Finish
VIObject[] DateTime
Specifies objects (such as virtual machine, virtual machine host, resource pool, and so on) for which you want to collect events. Specifies the end date of the events you want to retrieve. The valid formats are dd/mm/yyyy and mm/dd/yyyy, depending on the local machine regional settings. Specifies the maximum number of retrieved events. When you do not filter events by time period, the maximum number of retrieved events is set to 100 by default.
false false
MaxSamples
Int32
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
73/287
7/8/13
Server VIServer[]
Start
DateTime
false
false
EventCategory[] String
false false
false false
Zero or more VimApi.Event objects Notes Calling Get-VIEvent without any parameters might result in significant dela ys depending on the total number of events on the server. Get-VIEvent might return duplicates in the output. For example, if a virtua l machine is the child of both a parent and a child resource pools, it will be returned twice. This issue will be fixed in future releases of vSphere PowerCLI. Examples -------------- Example 1 -------------G e t V I E v e n tE n t i t yM y V M 1U s e r n a m ea d m i nT y p ee r r o rM a x S a m p l e s1 5 Retrieves a list of the last fifteen error events on the VM virtual machine for the user admin. -------------- Example 2 -------------C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 3 . 4 1 $ e v e n t s=G e t V I E v e n tM a x S a m p l e s1 0 0
f o r e a c h( $ e v e n ti n$ e v e n t s ){ i f ( $ e v e n t . f u l l F o r m a t t e d M e s s a g em a t c h" U s e r( . * ) @ \ b \ d { 1 , 3 } \ . \ d { 1 , 3 } \ . \ d { 1 , 3 } \ . \ d { 1 , 3 } \ bl o g g e di n " ){ W r i t e H o s t( " U s e r"+$ m a t Gathers information for the users that have logged in.
Get-View
Synopsis
This cmdlet returns the vSphere View objects that correspond to the specified search criteria. Syntax Get-View Get-View Get-View Get-View [-VIObject] <VIObject[]> [-Property <String[]>] [<CommonParameters>] [-Server <VIServer[]>] [-SearchRoot <ManagedObjectReference>] -ViewType <Type> [-Filter <Hashtable>] [-Property <String[]>] [<CommonParameters>] [-Server <VIServer[]>] [-Id] <ManagedObjectReference[]> [-Property <String[]>] [<CommonParameters>] [-Property <String[]>] -RelatedObject <ViewBaseMirroredObject[]> [<CommonParameters>]
Related Commands Online version Get-VIObjectByVIView Detailed Description This cmdlet returns the vSphere View objects that correspond to the specified search criteria. The cmdlet retrieves the vSphere View objects specified by their IDs or by their corresponding vSphere inventory objects (VIObject). A View object ID is a <type>-<value> string. For objects with constant names such as AlarmManager and ServiceInstance, the ID format is <type> (see the examples). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Id
ManagedObjectReference[]
Specifies the IDs of the View objects you want to retrieve. A view object ID is a <type>-<value> string. For objects with constant names such as AlarmManager and ServiceInstance, the ID format is <type> (see the examples). Specifies the vSphere managed object that corresponds to the View object you want to retrieve. When you pass VIServer, Get-View returns ServiceInstance. When the retrieved View object is a ServiceInstance, you cannot convert it to a VIObject with Get-VIObjectByVIView.
true
false
VIObject
VIObject[]
true
true (ByValue)
Filter
Hashtable
Specifies a hash of <name>-<value> pairs, where <name> represents the property value to test, and <value> represents a regex pattern the property must match. If more than one pair is present, all the patterns must match. Specifies the properties of the view object you want to retrieve. If no value is given, all properties are shown. Specifies view-related objects to retrieve their views. Specifies a starting point for the search (in the context of the inventory). Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the type of the View objects you want to retrieve.
false
false
ViewType
Type
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
74/287
7/8/13
Return Type Zero or more ViewBase objects Notes Examples -------------- Example 1 --------------
$ v m=G e t V i e wV i e w T y p eV i r t u a l M a c h i n eF i l t e r@ { " N a m e "=" V M " } $ v m h o s t V i e w=G e t V i e wI D$ v m . R u n t i m e . H o s t $ v m h o s t V i e w . S u m m a r y . R u n t i m e Gets the VM virtual machine using a filter by name, populates the view object and retrieves the runtime information. -------------- Example 2 -------------$ f o l d e r=G e t F o l d e rF o l d e r|G e t V i e w G e t V i e wS e a r c h R o o t$ f o l d e r . M o R e fV i e w T y p e" V i r t u a l M a c h i n e " Gets the view objects of virtual machines by specifying the root folder - MoRef. -------------- Example 3 -------------$ f o l d e r=G e t F o l d e rV M $ f o l d e r V i e w=G e t V i e w$ f o l d e rP r o p e r t y" [ V i r t u a l M a c h i n e ] C h i l d E n t i t y . N e t w o r k . * " $ f o l d e r V i e w . L i n k e d V i e w . C h i l d E n t i t y [ 0 ] . L i n k e d V i e w . N e t w o r k Gets the view of a folder by specifying for the Property parameter a property path, which leads to the networks of the virtual machines in the specified folder. Retrieves the first of the returned networks. -------------- Example 4 -------------C o n n e c t C I S e r v e rC l o u d S e r v e r 1 C o n n e c t V I S e r v e rV I S e r v e r 1 $ c l o u d E x t e r n a l N e t w o r k V i e w=G e t E x t e r n a l N e t w o r kE x t e r n a l N e t w o r k 1|G e t C I V i e w G e t V i e wR e l a t e d O b j e c t$ c l o u d E x t e r n a l N e t w o r k V i e w Gets the view of a vSphere object related to the specified Cloud object. In this case, gets the vSphere port group for the cloud external network.
Get-VIObjectByVIView
Synopsis
This cmdlet converts a vSphere View object to a VIObject. Syntax Get-VIObjectByVIView [-VIView] <ViewBase[]> [<CommonParameters>] Get-VIObjectByVIView [-Server <VIServer[]>] [-MORef] <ManagedObjectReference[]> [<CommonParameters>] Related Commands Online version Get-View Detailed Description This cmdlet converts a vSphere View object to a VIObject using the object ID provided by the MoRef parameter. If the View object is a ServiceInstance, you cannot convert it to a VIObject. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the managed object ID, obtained from a property of another managed object or a view. Specifies the vSphere .NET View object you want to convert to a vSphere PowerCLI object. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more VIObject objects Notes Examples -------------- Example 1 -------------$ v i e w=G e t V MV M|S t o p V M|G e t V i e w $ v m=G e t V I O b j e c t B y V I V i e w$ v i e w|S t a r t V M Gets the VM virtual machine, stops it, and gets its view object. Then, the command gets the virtual machine object using the Get-VIObjectByVIView cmdlet and
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
75/287
7/8/13
starts the VM virtual machine.
Get-VIPermission
Synopsis
This cmdlet retrieves the permissions defined on the specified inventory objects. Syntax Get-VIPermission [[-Entity] <VIObject[]>] [-Principal <VIAccount[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-VIPermission Remove-VIPermission Set-VIPermission Get-VIPrivilege Get-VIRole New-VIRole Remove-VIRole Set-VIRole Detailed Description This cmdlet retrieves the permissions defined on the specified inventory objects. If no inventory objects are specified, the cmdlet retrieves all permissions available on the server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the inventory items for which you want to retrieve permissions. Specifies the users and groups for which you want to retrieve permissions. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more Permission objects Notes You can specify permissions to a datastore only on vSphere 4.0 and later. Examples -------------- Example 1 -------------G e t V I P e r m i s s i o nE n t i t y( G e t D a t a c e n t e r )P r i n c i p a lA d m i n i s t r a t o r Retrieves the permissions of the Administrator user on the provided datacenters.
Get-VIPrivilege
Synopsis
This cmdlet retrieves the privilege groups and items for the provided servers. Syntax Get-VIPrivilege [-PrivilegeGroup] [-PrivilegeItem] [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VIPrivilege [[-Name] <String[]>] [-Role] <Role[]> [-Id <String[]>] [<CommonParameters>] Get-VIPrivilege [[-Name] <String[]>] [-Group] <PrivilegeGroup[]> [-Id <String[]>] [<CommonParameters>] Related Commands Online version Get-VIRole New-VIRole Remove-VIRole Set-VIRole Detailed Description This cmdlet retrieves the privilege groups and items for the provided servers. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the privileges you want to retrieve. Specifies the privilege group whose items you want to retrieve. Specifies the roles whose privileges you want to retrieve. Specifies the IDs of the privileges you want to retrieve. Indicates that you want to retrieve only the privilege groups and not the privilege items in them. Indicates that you want to retrieve only the privilege items and not the privilege groups.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
76/287
7/8/13
Server VIServer[]
Return Type Zero or more Privilege objects Notes Examples -------------- Example 1 -------------G e t V I P r i v i l e g eN a m e" H o s t * " Retrieves all privileges with names that start with "Host". -------------- Example 2 -------------G e t V I P r i v i l e g eP r i v i l e g e G r o u p Retrieves all privilege groups.
Get-VIProperty
Synopsis
This cmdlet retrieves extended object properties. Syntax Get-VIProperty [[-Name] <String[]>] [[-ObjectType] <String[]>] [-DeclaredOnly] [<CommonParameters>] Related Commands Online version Remove-VIProperty New-VIProperty Detailed Description This cmdlet retrieves the extended properties and filters them by using the provided cmdlet parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the extended properties you want to retrieve. Specifies the object types for which you want to retrieve extended properties. Indicates that you want to retrieve only the extended properties that have been directly defined for the specified object types.
Zero or more VIProperty objects Notes Examples -------------- Example 1 -------------G e t V I P r o p e r t yN a m e" p r o p e r t y * " Retrieve all custom properties that match the specified name pattern. -------------- Example 2 -------------G e t V I P r o p e r t yO b j e c t T y p e' V i r t u a l M a c h i n e ' Retrieve all custom properties for the specified object type. -------------- Example 3 -------------G e t V I P r o p e r t yO b j e c t T y p e' V i r t u a l M a c h i n e 'D e c l a r e d O n l y Retrieve all custom properties for the specified object type that are not inherited.
Get-VIRole
Synopsis
This cmdlet retrieves all roles defined on the provided servers. Syntax Get-VIRole [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
77/287
7/8/13
Related Commands Online version New-VIRole Remove-VIRole Set-VIRole Get-VIPrivilege Get-VIPermission New-VIPermission Remove-VIPermission Set-VIPermission Detailed Description
This cmdlet retrieves all roles defined on the provided servers. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Id Server
Specifies the names of the roles you want to retrieve. Specifies the IDs of the roles you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more Role objects Notes Examples -------------- Example 1 -------------G e t V I R o l eS e r v e r$ s e r v e rN a m e" A d m i n * " Retrieves all roles on the specified server with names that start with "Admin".
Get-VirtualPortGroup
Synopsis
This cmdlet retrieves the available port groups of hosts, virtual machines, and virtual switches. Syntax Get-VirtualPortGroup [[-VMHost] <VMHost[]>] [-VM <VirtualMachine[]>] [-VirtualSwitch <VirtualSwitchBase[]>] [-Name <String[]>] [-Datacenter <Datacenter[]>] [Standard] [-Distributed] [-Server <VIServer[]>] [<CommonParameters>] Get-VirtualPortGroup -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Get-VirtualPortGroup -RelatedObject <VirtualPortGroupRelatedObjectBase[]> [<CommonParameters>] Related Commands Online version New-VirtualPortGroup Remove-VirtualPortGroup Set-VirtualPortGroup Detailed Description This cmdlet retrieves the available port groups of hosts, virtual machines, and virtual switches. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost
VMHost[]
Specifies the hosts whose port groups you want to retrieve. The position of this parameter is deprecated and will be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions, specify the parameter by name. Filters the port groups of the virtual switches connected to hosts in the specified datacenters. Indicates that you want to retrieve the port groups for DistributedSwitch objects. This parameter is obsolete. To retrieve distributed port groups, use the Get-VDPortgroup cmdlet instead. Specifies the IDs of the port groups you want to retrieve. Specifies the names of the port groups you want to retrieve. Specifies objects to retrieve one or more VirtualPortGroup objects that are related to them. This parameter accepts vCloud NetworkPool, vCloud ExternalNetwork, and vCloud OrgNetwork objects. Note: In vCloud Director 5.1 environments, you cannot retrieve a distributed port group from an organization network backed by the distributed port group.
false
true (ByValue)
Datacenter
Datacenter[]
false
true (ByValue)
Distributed
SwitchParameter
false
false
Id Name RelatedObject
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
78/287
7/8/13
Indicates that you want to retrieve the port groups for VirtualSwitch objects. Specifies the virtual switches for which you want to retrieve their port groups. Specifies the virtual machines whose port groups you want to retrieve.
Zero or more VirtualPortGroup or DistributedPortGroup objects Notes This cmdlet retrieves standard port groups. Retrieving distributed port gro ups with this cmdlet is obsolete. Use the Get-VDPortgroup cmdlet instead. Examples -------------- Example 1 -------------G e t V i r t u a l P o r t g r o u pN a m e" V MN e t w o r k " Retrieves all port groups named "VM Network". -------------- Example 2 -------------$ m y V M H o s t=G e t V M H o s tN a m e" M y V M H o s t " G e t V i r t u a l P o r t G r o u pN a m e" V MN e t w o r k "V M H o s t$ m y V m H o s t Retrieves the port group named "VM Network" on the specified host. -------------- Example 3 -------------$ m y V M=G e t V MN a m e" M y V M " G e t V i r t u a l P o r t G r o u pV M$ m y V M Retrieves all port groups to which the specified virtual machine is connected. -------------- Example 4 -------------$ v i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s tM y V M H o s tN a m ev S w i t c h 0 G e t V i r t u a l P o r t G r o u pV i r t u a l S w i t c h$ v i r t u a l S w i t c h Retrieves all port groups which belong to the specified virtual switch.
Get-VirtualSwitch
Synopsis
This cmdlet retrieves the virtual switches associated with a virtual machine host or used by a virtual machine. Syntax Get-VirtualSwitch [[-VMHost] <VMHost[]>] [[-VM] <VirtualMachine[]>] [-Datacenter <Datacenter[]>] [-Name <String[]>] [-Standard] [-Distributed] [-Server <VIServer[]>] [<CommonParameters>] Get-VirtualSwitch -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Get-VirtualSwitch -RelatedObject <VirtualSwitchRelatedObjectBase[]> [<CommonParameters>] Related Commands Online version New-VirtualSwitch Remove-VirtualSwitch Set-VirtualSwitch Detailed Description This cmdlet retrieves the virtual switches associated with a virtual machine host or used by a virtual machine. At least one of the VMHost and VM parameters must be provided. The VM, VMHost, Name parameters do not accept string values through a pipeline because of collision. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost
VMHost[]
Specifies the hosts whose virtual switches you want to retrieve. The position of this parameter is deprecated and will be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions, specify the parameter by name. Specifies the virtual machines whose virtual switches you want to retrieve. Filters the virtual switches connected to hosts in the specified datacenters. Indicates that you want to retrieve only DistributedSwitch objects. This parameter is obsolete. To retrieve distributed switches, use the Get-VDSwitch cmdlet instead. Specifies the IDs of the virtual switches you want to retrieve. Specifies the names of the virtual switches you want to retrieve. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. The position of this
false
true (ByValue)
VM Datacenter Distributed
Id Name
String[] String[]
true false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
79/287
7/8/13
RelatedObject
VirtualSwitchRelatedObjectBase[]
Specifies objects to retrieve one or more VirtualSwitch objects that are related to them. This parameter accepts vCloud NetworkPool objects. Note: In vCloud Director 5.1 environments, you cannot retrieve a distributed switch from a network pool backed by the distributed switch.
true
true (ByValue)
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Indicates that you want to retrieve only VirtualSwitch objects.
false
false
SwitchParameter
false
false
Zero or more VirtualSwitchBase objects Notes This cmdlet retrieves standard switches. Retrieving distributed switches wi th this cmdlet is obsolete. Use the Get-VDSwitch cmdlet instead. Examples -------------- Example 1 -------------G e t V i r t u a l S w i t c hV MV M Retrieves the virtual switch used by the virtual machine named VM. -------------- Example 2 -------------G e t D a t a c e n t e rN a m e" M y D a t a c e n t e r "|G e t V i r t u a l S w i t c h Retrieves all virtual switches in the specified datacenter. -------------- Example 3 -------------G e t V M H o s tN a m e" M y V M H o s t "|G e t V i r t u a l S w i t c h Retrieves all virtual switches on the specified host. -------------- Example 4 -------------G e t V i r t u a l S w i t c hN a m e" v S w i t c h 0 " Retrieves all virtual switches named "vSwitch0".
Get-VM
Synopsis
This cmdlet retrieves the virtual machines on a vCenter Server system. Syntax Get-VM Get-VM Get-VM Get-VM [[-Name] <String[]>] [-Server <VIServer[]>] [-Datastore <StorageResource[]>] [-Location <VIContainer[]>] [-NoRecursion] [<CommonParameters>] [[-Name] <String[]>] [-Server <VIServer[]>] [-DistributedSwitch <DistributedSwitch[]>] [<CommonParameters>] [-Server <VIServer[]>] -Id <String[]> [<CommonParameters>] -RelatedObject <VmRelatedObjectBase[]> [<CommonParameters>]
Related Commands Online version Remove-VM New-VM Set-VM Move-VM Start-VM Stop-VM Suspend-VM Restart-VM Detailed Description This cmdlet retrieves the virtual machines on a vCenter Server system. Returns a set of virtual machines that correspond to the filter criteria provided by the cmdlet parameters. For virtual machines with multiple NICs and multiple IP addresses, the IPAddress property of the VMGuest object contains all IP addresses of the virtual machine. The IP at position 0 is the primary IP address. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Datastore
String[] StorageResource[]
Specifies the names of the virtual machines you want to retrieve. Specifies datastores or datastore clusters to filter the virtual machines associated with them. Passing values to this parameter through a pipeline is deprecated and will be removed in a future release. Filters the available virtual machines by the virtual switches they are connected to.
false false
DistributedSwitch
DistributedSwitch[]
false
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
80/287
7/8/13
Id Location String[] VIContainer[]
NoRecursion RelatedObject
SwitchParameter VmRelatedObjectBase[]
false true
Server
VIServer[]
false
false
Return Type Zero or more VirtualMachine objects Notes Examples -------------- Example 1 -------------G e t V MN a m eM y V M * Retrieves all virtual machines whose names starting with "MyVM". -------------- Example 2 -------------$ m y D a t a s t o r e=G e t D a t a s t o r eN a m e" M y D a t a s t o r e " G e t V MD a t a s t o r e$ m y D a t a s t o r e Retrieves all virtual machines that reside on the specified datastore. -------------- Example 3 -------------$ m y D a t a c e n t e r=G e t D a t a c e n t e rN a m e" M y D a t a c e n t e r " G e t V ML o c a t i o n$ m y D a t a c e n t e r Retrieves all virtual machines in the specified datacenter. -------------- Example 4 -------------$ m y V D S w i t c h=G e t V D S w i t c hN a m e" M y V D S w i t c h " G e t V MD i s t r i b u t e d S w i t c h$ m y V D S w i t c h Retrieves all virtual machines connected to the specified distributed switch.
Get-VMGuest
Synopsis
This cmdlet retrieves the guest operating systems of the specified virtual machines. Syntax Get-VMGuest [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Suspend-VMGuest Shutdown-VMGuest Restart-VMGuest Detailed Description This cmdlet retrieves the guest operating systems of the specified virtual machines. To specify a server different from the default one, use the Server parameter. When Get-VMGuest is run against a virtual machine that is just starting, the properties of the returned VMGuest object are not filled at one time. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Server
VirtualMachine[] VIServer[]
Specifies the virtual machines whose guest operating systems you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
true false
Return Type Zero or more VMGuest objects Notes Examples -------------- Example 1 -------------G e t V M G u e s tV MV M
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
81/287
7/8/13
Retrieves the guest OS of the virtual machine named VM.
Get-VMGuestNetworkInterface
Synopsis
This cmdlet etrieves information about the network configuration of the specified virtual machines or guests. Syntax Get-VMGuestNetworkInterface [-Name <String[]>] [[-VM] <VirtualMachine[]>] [-VMGuest <VMGuest[]>] [-Server <VIServer[]>] [-ToolsWaitSecs <Int32>] [GuestPassword <SecureString>] [-GuestUser <String>] [-GuestCredential <PSCredential>] [-HostPassword <SecureString>] [-HostUser <String>] [-HostCredential <PSCredential>] [<CommonParameters>] Related Commands Online version Set-VMGuestNetworkInterface Detailed Description This cmdlet retrieves information about the network configuration of the specified virtual machines or guests. This cmdlet supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM GuestCredential
VirtualMachine[] PSCredential
Specifies the virtual machines for which you want to retrieve the network configuration. Specifies a PSCredential object that contains credentials for authenticating with the guest OS. Do not use this parameter if the GuestUser and GuestPassword parameters are used. Specifies the password you want to use for authenticating with the guest OS. Specifies the user name you want to use for authenticating with the guest OS. Specifies a PSCredential object that contains credentials for authenticating with the host. Do not use this parameter if the HostUser and HostPassword parameters are used. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the user name you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the names of the guest network interfaces you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the time in seconds to wait for a response from the VMware Tools. If a non-positive value is provided, the system waits infinitely long time. Specifies the guest OS for which you want to retrieve the network configuration.
false false
HostPassword
SecureString
false
false
HostUser
String
false
false
Name Server
String[] VIServer[]
false false
false false
ToolsWaitSecs
Int32
false
false
VMGuest[]
false
true (ByValue)
Zero or more VMGuestNetworkInterface objects Notes This cmdlet is experimental and might be changed or removed in a future rel ease. Examples -------------- Example 1 -------------G e t V M G u e s t N e t w o r k I n t e r f a c eV M$ v mG u e s t U s e rU s e rG u e s t P a s s w o r dp a s s 2 Retrieves the guest network interface of the $vm virtual machine.
Get-VMGuestRoute
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 82/287
7/8/13
Synopsis
This cmdlet retrieves the routing configuration of the specified virtual machines or guests. Syntax Get-VMGuestRoute [[-VM] <VirtualMachine[]>] [-VMGuest <VMGuest[]>] [-Server <VIServer[]>] [-ToolsWaitSecs <Int32>] [-GuestPassword <SecureString>] [GuestUser <String>] [-GuestCredential <PSCredential>] [-HostPassword <SecureString>] [-HostUser <String>] [-HostCredential <PSCredential>] [<CommonParameters>] Related Commands Online version New-VMGuestRoute Remove-VMGuestRoute Detailed Description This cmdlet retrieves the routing configuration of the specified virtual machines or guests. This cmdlet supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM GuestCredential
VirtualMachine[] PSCredential
Specifies the virtual machines for which you want to retrieve the routing configuration. Specifies a PSCredential object that contains credentials for authenticating with the guest OS. Do not use this parameter if the GuestUser and GuestPassword parameters are used. Specifies the password you want to use for authenticating with the guest OS. Specifies the user name you want to use for authenticating with the guest OS. Specifies a PSCredential object that contains credentials for authenticating with the host. Do not use this parameter if the HostUser and HostPassword parameters are used. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the user name you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the time in seconds to wait for a response from the VMware Tools. If a non-positive value is provided, the system waits infinitely long time. Specifies the guest operating systems for which you want to retrieve the routing configuration.
false false
HostPassword
SecureString
false
false
HostUser
String
false
false
Server
VIServer[]
false
false
ToolsWaitSecs
Int32
false
false
VMGuest[]
false
true (ByValue)
Zero or more VMGuestRoute objects Notes This cmdlet is experimental and might be changed or removed in a future rel ease. Examples -------------- Example 1 -------------G e t V M G u e s t R o u t eV M$ v mG u e s t U s e rU s e rG u e s t P a s s w o r dp a s s 2 Retrieves the guest route of the $vm virtual machine.
Get-VMHost
Synopsis
This cmdlet retrieves the hosts on a vCenter Server system. Syntax Get-VMHost [[-Name] <String[]>] [-NoRecursion] [-Datastore <StorageResource[]>] [-State <VMHostState[]>] [-Location <VIContainer[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHost [[-Name] <String[]>] [-DistributedSwitch <DistributedSwitch[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHost [[-Name] <String[]>] [-NoRecursion] [-VM <VirtualMachine[]>] [-ResourcePool <ResourcePool[]>] [-Datastore <StorageResource[]>] [-Location <VIContainer[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHost -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
83/287
7/8/13
Related Commands Online version Add-VMHost Move-VMHost Remove-VMHost Restart-VMHost Set-VMHost Start-VMHost Stop-VMHost Suspend-VMHost Detailed Description
This cmdlet retrieves the hosts on a vCenter Server system. Returns a set of hosts that correspond to the filter criteria provided by the cmdlet parameters. To specify a server different from the default one, use the Server parameter. When working directly on an ESX host, the Name property of the returned VMHost object contains either the DNS name or the IP of the ESX host, depending on which of them was specified when connecting with Connect-VIServer. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Datastore
String[] StorageResource[]
Specifies the names of the hosts you want to retrieve. Specifies the datastores or datastore clusters to which the hosts that you want to retrieve are associated. Passing values to this parameter through a pipeline is deprecated and will be removed in a future release. Filters the available hosts by the virtual switches they are connected to. Specifies the IDs of the hosts you want to retrieve. Specifies the vSphere container objects (such as folders, datacenters, and clusters) you want to search for hosts. Indicates that you want to disable the recursive behavior of the command. Specifies resource pools associated with the hosts you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Specifies the state of the hosts you want to retrieve. The valid values are Connected, Disconnected, NotResponding, and Maintenance. Specifies virtual machines whose hosts you want to retrieve.
false false
State
VMHostState[]
false
false
VM Return Type
VirtualMachine[]
false
true (ByValue)
Zero or more VMHost objects Notes When working directly on an ESX host, the Name property of the returned VMH ost object contains either the DNS name or the IP of the ESX host, dependi ng on which of them was specified when connecting with Connect-VIServer. Examples -------------- Example 1 -------------G e t V M H o s tL o c a t i o nM y D a t a c e n t e r Retrieves all hosts in the specified datacenter. -------------- Example 2 -------------$ M y V M=G e t V MN a m eM y V M G e t V M H o s tV M$ M y V M Retrieves the host on which the specified virtual machine runs. -------------- Example 3 -------------$ m y V D S w i t c h=G e t V D S w i t c hN a m e" M y V D S w i t c h " G e t V M H o s tD i s t r i b u t e d S w i t c h$ m y V D S w i t c h Retrieves all hosts associated with the specified vSphere distributed switch.
Get-VMHostAccount
Synopsis
This cmdlet retrieves the host accounts available on a vCenter Server system. Syntax Get-VMHostAccount [-Group] [-User] [[-Id] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Remove-VMHostAccount New-VMHostAccount Set-VMHostAccount Detailed Description This cmdlet retrieves the host accounts available on a vCenter Server system. If both User and Group parameters are set to $true, in the list returned by the command,
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
84/287
7/8/13
group accounts come out on top. If none of the User and Group switch parameters are provided, the cmdlet retrieves only the user accounts. If the ID parameter is set, the cmdlet filters the host accounts by their IDs. To specify a server different from the default one, use the Server parameter. Note: The specified server must be an ESX/ESXi host. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Id Group Server
Specifies the IDs of the host accounts you want to retrieve. Indicates that you want to retrieve only group host accounts. Starting with ESXi 5.1, this parameter is not supported. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that you want to retrieve only user host accounts.
User
SwitchParameter
false
false
Return Type Zero or more HostAccount objects Notes Depending on what the user specified, the returned object can be of one of the child types: HostGroupAccount, HostUserAccount. Starting with ESXi 5.1, you cannot retrieve group host accounts. Examples -------------- Example 1 -------------G e t V M H o s t A c c o u n tG r o u p Retrieves the group accounts for the default ESX/ESXi host. Starting with ESXi 5.1, you cannot retrieve group accounts. -------------- Example 2 -------------$ m y S e r v e r 1=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ m y U s e r A c c o u n t 1=N e w V M H o s t A c c o u n tI DM y U s e r 1P a s s w o r dM y P a s s 1U s e r A c c o u n t G e t V M H o s t A c c o u n tS e r v e r$ m y S e r v e r 1I D$ m y U s e r A c c o u n t 1 . I dU s e r Retrieves a host account specified by an ID and an ESX/ESXi host. -------------- Example 3 -------------$ m y S e r v e r 1=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 $ m y G r o u p A c c o u n t 1=N e w V M H o s t A c c o u n tI DM y G r o u p 1P a s s w o r dM y P a s s w o r d 1G r o u p A c c o u n t G e t V M H o s t A c c o u n tS e r v e r$ m y S e r v e r 1I d$ m y G r o u p A c c o u n t . I dG r o u p Retrieves a group host account specified by an ID and an ESX/ESXi host. Starting with ESXi 5.1, you cannot retrieve group host accounts. -------------- Example 4 -------------$ m y S e r v e r 1=C o n n e c t V I S e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 G e t V M H o s t A c c o u n tS e r v e r$ m y S e r v e r 1U s e rG r o u p Retrieves all user and group accounts on a specified ESX/ESXi host. Starting with ESXi 5.1, you cannot retrieve group host accounts.
Get-VMHostAdvancedConfiguration
Synopsis
This cmdlet retrieves the advanced configuration of the hosts. Syntax Get-VMHostAdvancedConfiguration [[-Name] <String[]>] [-VMHost] <VMHost[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostAdvancedConfiguration Detailed Description This cmdlet is deprecated. Use Get-AdvancedSetting instead. This cmdlet retrieves the advanced configuration of the hosts. For each of the specified hosts, the cmdlet returns a hash table mapping the names of the settings to the corresponding values. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the host configuration settings you want to retrieve. Specifies the hosts for which you want to retrieve the configuration settings. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Return Type Zero or more System.Collections.Hashtable objects Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
85/287
7/8/13
G e t V M H o s t A d v a n c e d C o n f i g u r a t i o nV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0N a m en e t * t c p * Retrieves the virtual machine host advanced configuration settings, whose names contain "net" and "tcp".
Get-VMHostAttributes
Synopsis
Gets the identifying attributes of a host. Syntax Get-VMHostAttributes [-VMHost] <VMHost> [<CommonParameters>] Related Commands Get-VMHost Detailed Description Gets the identifying attributes of a host. These are the attributes that the rules will match against. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost
VMHost
Host to get the attributes for. Use Get-VMHost to retrieve the host object associated with a host name.
true
true (ByValue)
Return Type Notes Examples -------------- Example 1 -------------C : \ P S >G e t V M H o s t A t t r i b u t e sm y h o s t " i p v 4 "" 1 9 2 . 1 6 8 . 1 . 1 " " v e n d o r "" V M w a r e " Retrieves the identifying attributes for the host named myhost. -------------- Example 2 -------------C : \ P S >G e t V M h o s t" m y h o s t "|G e t V M H o s t A t t r i b u t e s " i p v 4 "" 1 9 2 . 1 6 8 . 1 . 1 " " v e n d o r "" V M w a r e " Retrieves the identifying attributes for the host named myhost.
Get-VMHostAuthentication
Synopsis
This cmdlet retrieves authentication information for the specified hosts. Syntax Get-VMHostAuthentication [[-VMHost] <VMHost[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHostAuthentication -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostAuthentication Detailed Description This cmdlet retrieves authentication information for the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Id Server
Specifies the hosts for which you want to retrieve authentication information. Specifies the IDs of the host authentication information that you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Return Type Zero or more VMHostAuthentication objects Notes Supported only on ESX Server 4.1 and later.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
86/287
7/8/13
Examples -------------- Example 1 -------------$ v m h o s t|G e t V M H o s t A u t h e n t i c a t i o n Retrieve authentication information for the specified host.
Get-VMHostAvailableTimeZone
Synopsis
This cmdlet retrieves the time zones available on the specified host. Syntax Get-VMHostAvailableTimeZone [-VMHost] <VMHost[]> [[-Name] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHost Detailed Description This cmdlet retrieves the time zones available on the specified host. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the available time zones you want to retrieve. Specifies the host for which you want to retrieve the available time zones. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Return Type Zero or more VMHostTimeZone objects Notes Examples -------------- Example 1 -------------G e t V M H o s t A v a i l a b l e T i m e Z o n eN a m eP a c i f i c *V M H o s t1 0 . 2 3 . 1 1 2 . 1 9 Retrieves the Pacific time zones available on the specified host.
Get-VMHostDiagnosticPartition
Synopsis
This cmdlet retrieves a list of the diagnostic partitions on the specified hosts. Syntax Get-VMHostDiagnosticPartition [-VMHost] <VMHost[]> [-All] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostDiagnosticPartition Detailed Description This cmdlet retrieves a list of the diagnostic partitions on the specified hosts. The list is ordered by the partitions preference. Local diagnostic partitions are more preferable than shared diagnostic partitions because multiple servers cannot share the same partition. The most preferred diagnostic partition is first in the list. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the hosts for which you want to retrieve diagnostic partitions. Indicates that you want to retrieve all diagnostic partitions on the specified hosts. By default, only the active partitions are retrieved. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more VMHostDiagnosticPartition objects Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
87/287
7/8/13
Get-VMHostDisk
Synopsis
This cmdlet retrieves information about the specified SCSI LUN disk. Syntax Get-VMHostDisk [[-VMHost] <VMHost[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHostDisk -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Get-VMHostDisk [[-ScsiLun] <ScsiLun[]>] [<CommonParameters>] Related Commands Online version Get-VMHostDiskPartition Detailed Description This cmdlet retrieves information about the specified SCSI LUN disk. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the SCSI LUN for which you want to retrieve information. Specifies hosts to retrieve the hard disks attached to them. Specifies the IDs of the SCSI LUN disks that you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Return Type Zero or more VMHostDisk objects Notes Examples -------------- Example 1 -------------G e t V M H o s t D i s kV M H o s t$ v m h o s t Retrieves the disks of the specified host. -------------- Example 2 -------------$ v m h o s t|G e t V M H o s t H b aT y p eF i b r e C h a n n e l|G e t S c s i L u n|G e t V M H o s t D i s k Retrieves the host disks only for LUNs that are of FibreChannel type.
Get-VMHostDiskPartition
Synopsis
This cmdlet retrieves the partitions of a host disk (LUN). Syntax Get-VMHostDiskPartition [[-VMHostDisk] <VMHostDisk[]>] [<CommonParameters>] Get-VMHostDiskPartition -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-VMHostDisk Format-VMHostDiskPartition Detailed Description This cmdlet retrieves the partitions of a host disk (LUN). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHostDisk Id Server
Specifies the host disk for which you want to retrieve the partitions. Specifies the IDs of the host disk partitions that you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
88/287
7/8/13
Notes Examples -------------- Example 1 --------------
G e t V M H o s tH o s t|G e t V M H o s t D i s k|G e t V M H o s t D i s k P a r t i t i o n|?{ . T y p ee q" N t f s " }|F o r m a t V M H o s t D i s k P a r t i t i o nV o l u m e N a m e" N e w S t o r a g e " Formats the NTFS disk partitions of a host.
Get-VMHostFirewallDefaultPolicy
Synopsis
This cmdlet retrieves the firewall default policy of the specified hosts. Syntax Get-VMHostFirewallDefaultPolicy [-VMHost] <VMHost[]> [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostFirewallDefaultPolicy Detailed Description This cmdlet retrieves the firewall default policy of the specified hosts. The firewall policy determines whether the outgoing and incoming connections are allowed. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the hosts whose firewall default policy you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
true false
Return Type Zero or more VMHostFirewallDefaultPolicy objects Notes Firewall management functionality is not supported on ESX 3i. Examples -------------- Example 1 -------------G e t V M H o s t F i r e w a l l D e f a u l t P o l i c yV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0 Retrieves the default firewall policy of the virtual machine host with an IP address 10.23.123.100.
Get-VMHostFirewallException
Synopsis
This cmdlet retrieves the exceptions from the firewall policy on the specified hosts. Syntax Get-VMHostFirewallException [[-Name] <String[]>] [-VMHost] <VMHost[]> [-Port <Int32[]>] [-Enabled [<Boolean>]] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostFirewallException Detailed Description This cmdlet retrieves the exceptions from the firewall policy on the specified hosts. The exceptions can be filtered using the VMHost, Name, Port, and Enabled parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the firewall exceptions you want to retrieve. Specifies the hosts for which you want to retrieve firewall exceptions. Indicates whether you want to retrieve only the enabled hosts firewall exceptions. Specifies the number of the port for which you want to retrieve the firewall exceptions. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
89/287
7/8/13
Notes
Firewall management functionality is not supported on ESX 3i. Examples -------------- Example 1 -------------G e t V M H o s tN a m eV M H o s t 1|G e t V M H o s t F i r e w a l l E x c e p t i o nE n a b l e d : $ t r u e Retrieves the enabled firewall exceptions of a host named VMHost1. -------------- Example 2 -------------G e t V M H o s t F i r e w a l l E x c e p t i o n" S S HS e r v e r " ," S S HC l i e n t "V M H o s t$ v m h o s t Retrieves the firewall exceptions for the SSH server and client for the virtual machine host $vmhost. -------------- Example 3 -------------G e t V M H o s t F i r e w a l l E x c e p t i o nV M H o s tH o s tP o r t2 1 Retrieves the firewall exceptions of a host named Host. Only firewall exceptions which have port 21 in their incoming port or outgoing ports are returned.
Get-VMHostFirmware
Synopsis
This cmdlet retrieves hosts firmware information. Syntax Get-VMHostFirmware [-VMHost] <VMHost[]> [-Server <VIServer[]>] [<CommonParameters>] Get-VMHostFirmware [-VMHost] <VMHost[]> [-BackupConfiguration] -DestinationPath <String> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostFirmware Detailed Description This cmdlet retrieves firmware information for the hosts specified by the VMHost parameter. To specify a server different from the default one, use the Server parameter. To run this cmdlet, you need to have the "Host.Config.Firmware" permission to the ESX. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost BackupConfiguration
VMHost[] SwitchParameter
Specifies the hosts for which you want to retrieve firmware information. Indicates that you want to backup the host firmware configuration and download the bundle to the specified DestinationPath. Specifies a destination path where to download the host configuration backup bundle if the BackupConfiguration parameter is set. This parameter is required when you specify the host by name. In this case, the host with the specified name is searched on the specified servers and firmware information is retrieved from it. If a VMHost object is passed to the VMHost parameter, the Server parameter is not used.
true false
DestinationPath
String
true
false
Server
VIServer[]
false
false
Return Type Zero or more HostFirmware or HostFirmwareBundle objects Notes This functionality applies to ESXi Embedded only. Examples -------------- Example 1 -------------G e t V M H o s t F i r m w a r eV M H o s t$ v m h o s t Retrieves the firmware information for the specified host. -------------- Example 2 -------------G e t V M H o s t F i r m w a r eV M H o s t$ v m h o s tB a c k u p C o n f i g u r a t i o nD e s t i n a t i o n P a t hC : \ D o w n l o a d s Backups a server configuration for the virtual machine host stored in the $vmhost variable, and downloads the configuration files into the specified folder.
Get-VMHostHba
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
90/287
7/8/13
Syntax
This cmdlet retrieves information about the available HBAs (Host Bus Adapter). Get-VMHostHba [[-VMHost] <VMHost[]>] [[-Device] <String[]>] [-Type <HbaType[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Get-IScsiHbaTarget New-IScsiHbaTarget Remove-IScsiHbaTarget Set-IScsiHbaTarget Set-VMHostHba Detailed Description This cmdlet retrieves information about the available HBAs (Host Bus Adapter). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the devices of the HBA you want to retrieve. Specifies the hosts for which you want to retrieve HBAs. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Specifies the type of the HBAs you want to retrieve. The valid values are Block, FibreChannel, iSCSI, and ParallelSCSI.
Type
HbaType[]
false
false
Return Type Zero or more Hba objects Notes Examples -------------- Example 1 -------------G e t V M H o s t H b aD e v i c e* h b a 0 *|f l Retrieves the available HBA devices that contain "hba0" in their names.
Get-VMHostImageProfile
Synopsis
Gets the image profile associated with the specified ESXi host. Syntax Get-VMHostImageProfile -Entity <VIObjectCore> [<CommonParameters>] Related Commands Apply-ESXImageProfile Get-VMHost Detailed Description Gets the image profile currently associated with the specified ESXi host. Use the Get-VMHost cmdlet to retrieve the host. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Entity
VIObjectCore
true
true (ByValue)
Return Type VMware.ImageBuilder.Types.ImageProfile Notes Examples -------------- Example 1 -------------C : \ P S >G e t V M H o s t I m a g e P r o f i l eE n t i t yh 1 Get the image profile associated with host "h1". -------------- Example 2 -------------C : \ P S >G e t V M H o s t I m a g e P r o f i l eE n t i t y( G e t V M H o s t" h 1 " ) Get the image profile associated with host "h1".
Get-VMHostMatchingRules
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 91/287
7/8/13
Syntax
Retrieves the list of rules in the rule set that match a specified host. Get-VMHostMatchingRules [-VMHost] <VMHost> [-DeployRuleSet <DeployRuleSet>] [<CommonParameters>] Related Commands Get-DeployRuleSet New-DeployRule Detailed Description Retrieves the list of rules in the rule set that match a specified host. You can use this cmdlet to debug your working rule set before activating it. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost DeployRuleSet
The VMHost object to match against. The set of rules to match against a host.
true false
VMware.DeployAutomation.Types.DeployRule[] Notes The DeployRule object has the following properties: Name System.String Pattern DeployRule.Pattern[] Items System.VIObject[] Examples -------------- Example 1 -------------C : \ P S >G e t V M H o s t M a t c h i n g R u l e sh 1 Get the list of rules that match host "h1". -------------- Example 2 -------------C : \ P S >G e t V M H o s t M a t c h i n g R u l e s( G e t V M H o s t" h 1 " ) Get the list of rules that match host "h1".
Get-VMHostModule
Synopsis
This cmdlet retrieves the option strings of the specified host modules. Syntax Get-VMHostModule [-VMHost] <VMHost[]> [[-Name] <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostModule Detailed Description This cmdlet retrieves the option strings of the specified host modules. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name
String[]
Specifies the names of the host modules you want to retrieve. To find a list of the valid module names for different servers, see the vSphere documentation or in the ESX console, run "esxcfg-module -l". This parameter is mandatory only if you are connected to ESX/vCenter Server with version earlier than 4.0. Specifies hosts to retrieve their modules. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
false
false
VMHost Server
VMHost[] VIServer[]
true false
Return Type Zero or more VmHostModule objects Notes Examples -------------- Example 1 -------------G e t V M H o s t M o d u l eN a m eS h a p e r Retrieves the option string for the specified host module.
Get-VMHostNetwork
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
92/287
7/8/13
Syntax
THis cmdlet retrieves the host networks on a vCenter Server system. Get-VMHostNetwork [-Server <VIServer[]>] [-VMHost] <VMHost[]> [<CommonParameters>] Related Commands Online version Set-VMHostNetwork Detailed Description This cmdlet retrieves the host networks on a vCenter Server system. This command retrieves the networking configuration of the hosts specified by the VMHost parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the hosts whose networking configuration you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
true false
Return Type Zero or more VMHostNetworkInfo objects Notes Examples -------------- Example 1 -------------G e t V M H o s t N e t w o r kV M H o s t1 0 . 2 3 . 1 1 3 . 2 1 2|f l Retrieves the networking configuration for the virtual machine host on IP address 10.23.113.212.
Get-VMHostNetworkAdapter
Synopsis
This cmdlet retrieves the host network adapters on a vCenter Server system. Syntax Get-VMHostNetworkAdapter [[-VMHost] <VMHost[]>] [-Physical] [-VMKernel] [-Console] [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHostNetworkAdapter [[-DistributedSwitch] <DistributedSwitch[]>] [-Physical] [-VMKernel] [-Console] [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-VMHostNetworkAdapter Remove-VMHostNetworkAdapter Set-VMHostNetworkAdapter Detailed Description This cmdlet retrieves the host network adapters on a vCenter Server system. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DistributedSwitch VMHost
DistributedSwitch[] VMHost[]
Filters the available network adapters by the virtual switches they are connected to. Specifies the hosts whose network adapters you want to retrieve. The position of this parameter is deprecated and might change in a following release. Specifies the names of the host network adapters you want to retrieve. The position of this parameter might change in a future release. Indicates that you want to retrieve only service console virtual network adapters. Specifies the IDs of the host network adapters you want to retrieve. Indicates that you want to retrieve only physical network adapters. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Indicates that you want to retrieve only VMKernel virtual network adapters.
false false
Name
String[]
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
93/287
7/8/13
-------------- Example 2 --------------
Retrieves information about about all VMKernel network adapters on servers that you are connected to.
$ m y V M H o s t=G e t V M H o s tN a m eM y V M H o s t G e t V M H o s t N e t w o r k A d a p t e rV M H o s t$ m y V M H o s tP h y s i c a l Retrieves all physical network adapters on the specified host. -------------- Example 3 -------------$ m y V D S w i t c h=G e t V D S w i t c hN a m eM y V D S w i t c h G e t V M H o s t N e t w o r k A d a p t e rD i s t r i b u t e d S w i t c h$ m y V D S w i t c hV M K e r n e l Retrieves all VMKernel network adapters connected to the specified vSphere distributed switch.
Get-VMHostNtpServer
Synopsis
This cmdlet retrieves the NTP servers on the specified hosts. Syntax Get-VMHostNtpServer [-VMHost] <VMHost[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Add-VMHostNtpServer Remove-VMHostNtpServer Detailed Description This cmdlet retrieves the NTP servers on the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the hosts, whose NTP servers you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
true false
Return Type Zero or more String objects Notes Returns the IP addresses of the NTP servers. Examples -------------- Example 1 -------------G e t V M H o s t N t p S e r v e rV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0 Retrieves the NTP server of the virtual machine host with an IP address 10.23.123.100.
127.127.1.0
Get-VMHostPatch
Synopsis
This cmdlet retrieves information about the host patches installed on the specified hosts. Syntax Get-VMHostPatch [[-VMHost] <VMHost[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Install-VMHostPatch Detailed Description This cmdlet retrieves information about the host patches installed on the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the hosts for which you want to retrieve the available patches. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
94/287
7/8/13
VIServer. Return Type Zero or more VMHostPatch objects Notes Examples -------------- Example 1 -------------G e t V M H o s t P a t c hH o s t
Get-VMHostProfile
Synopsis
This cmdlet retrieves the available host profiles. Syntax Get-VMHostProfile [[-Name] <String[]>] [-Description <String[]>] [-Entity <InventoryItem[]>] [-ReferenceHost <VMHost[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Export-VMHostProfile Import-VMHostProfile New-VMHostProfile Remove-VMHostProfile Set-VMHostProfile Test-VMHostProfileCompliance Detailed Description This cmdlet retrieves the available host profiles. A host profile encapsulates the host settings and helps to manage the host configuration. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the host profiles you want to retrieve. Specifies a phrase from the description of the host profiles you want to retrieve. Specifies inventory objects associated with the host profiles you want to retrieve. Specifies the IDs of the host profiles you want to retrieve. Specifies the reference hosts of the profiles you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more VMHostProfile objects Notes Examples -------------- Example 1 -------------G e t V M H o s t P r o f i l eN a m eP r o f i l e Retrieves the virtual machine host profile named Profile.
Get-VMHostProfileRequiredInput
Synopsis
This cmdlet performs a check whether the available information is sufficient to apply a host profile. Syntax Get-VMHostProfileRequiredInput [-VMHost] <VMHost> [[-Variable] <Hashtable>] [-Profile <VMHostProfile>] [-Inapplicable] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet performs a check whether the available information is sufficient to apply a host profile, and returns missing values. If the cmdlet returns no output, the information in the hashtable passed to the Variable parameter is sufficient to apply the host profile to the host by using the Apply-VMHostProfile cmdlet. Parameters
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
95/287
7/8/13
NA ME TYPE DESCRIPTION
Specifies a host to check if the provided information is sufficient for applying the specified host profile. Provides a hash table that contains the available values required for applying the specified profile to the the specified host. Indicates that you want to view also the elements that are inapplicable to the operation. Specifies a host profile to check if the provided information is sufficient for applying it to the specified host. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more VMHostProfileInput objects Notes Examples -------------- Example 1 -------------G e t V M H o s t|G e t V M H o s t P r o f i l e R e q u i r e d I n p u t Retrieves required input for a list of hosts. -------------- Example 2 -------------G e t V M H o s t P r o f i l e R e q u i r e d I n p u tV M H o s t$ v m h o s tP r o f i l e$ v m h o s t P r o f i l e Retrieves a required input by specifying a host and a profile. -------------- Example 3 -------------$ r e s u l t=G e t V M H o s t P r o f i l e R e q u i r e d I n p u tV M H o s t$ v m h o s tV a r i a b l e$ r e q u i r e d I n p u t H a s h t a b l e ; i f( n o t$ r e s u l t ){A p p l y V M H o s t P r o f i l eE n t i t y$ v m h o s tV a r i a b l e$ r e q u i r e d I n p u t H a s h t a b l e } Check whether the specified hashtable that contains values for each required input is exhaustive. If the result is null, then the hashtable can be used by ApplyVMHostProfile. -------------- Example 4 -------------$ r e s u l t=G e t V M H o s t P r o f i l e R e q u i r e d I n p u tV M H o s t$ v m h o s tV a r i a b l e$ r e q u i r e d I n p u t H a s h t a b l eI n a p p l i c a b l e ; $ r e s u l t|w h e r e{$ _ . T y p ee q' I n a p p l i c a b l e '}|f o r e a c h{W r i t e H o s t" K e y$ ( $ _ . K e y )i sn o ta p p l i c a b l ef o rh o s t$ v m h o s t "} Retrieve the required and inapplicable input and display all inapplicable keys.
Get-VMHostRoute
Synopsis
This cmdlet retrieves the routes from the routing table of the specified hosts. Syntax Get-VMHostRoute [[-VMHost] <VMHost[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version New-VMHostRoute Remove-VMHostRoute Set-VMHostRoute Detailed Description This cmdlet retrieves the routes from the routing table of the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the hosts for which you want to retrieve routes. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
false false
Return Type Zero or more VMHostRoute objects Notes Supported only on ESX 4.0/ vCenter Server 4.0 and later. Examples -------------- Example 1 -------------G e t V M H o s t R o u t eV M H o s t$ v m h o s t Retrieves the routes for the specified host.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
96/287
7/8/13
-------------- Example 2 --------------
Get-VMHostService
Synopsis
This cmdlet retrieves information about a host service. Syntax Get-VMHostService [-VMHost] <VMHost[]> [-Refresh] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostService Start-VMHostService Stop-VMHostService Restart-VMHostService Detailed Description This cmdlet retrieves information about a host service. If the Refresh parameter is set to $true, the cmdlet refreshes the host services information before retrieving it. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies hosts for which you want to retrieve the available services. Indicates whether the cmdlet refreshes the service information before retrieving it. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type Zero or more HostService objects Notes Examples -------------- Example 1 -------------G e t V M H o s t S e r v i c eR e f r e s h Refreshes and retrieves the host services on the default server. -------------- Example 2 -------------$ v m h o s t=G e t V M H o s tN a m eH o s t $ v m H o s t S e r v i c e=G e t V M H o s t S e r v i c eV M H o s t$ v m h o s t Gets the services of the specified host.
Get-VMHostSnmp
Synopsis
This cmdlet retrieves hosts SNMP configuration. Syntax Get-VMHostSnmp [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostSNMP Test-VMHostSNMP Detailed Description This cmdlet retrieves hosts SNMP configuration. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
false
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
97/287
7/8/13
Notes Examples -------------- Example 1 -------------G e t V M H o s t S N M P
Retrieves the host SNMP configuration. Operates on the default server which must be an ESX host.
Get-VMHostStartPolicy
Synopsis
This cmdlet retrieves the start policy of hosts. Syntax Get-VMHostStartPolicy [-VMHost] <VMHost[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostStartPolicy Detailed Description This cmdlet retrieves the start policy of the hosts specified by the VMHost parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the hosts whose start policy you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
true false
Return Type Zero or more VMHostStartPolicy objects Notes Examples -------------- Example 1 -------------G e t V M H o s t S t a r t P o l i c yV M H o s t1 0 . 2 3 . 1 1 3 . 2 1 2 Retrieves the start policy of the virtual machine host on IP address 10.23.113.212.
Get-VMHostStorage
Synopsis
This cmdlet retrieves the host storages on a vCenter Server system. Syntax Get-VMHostStorage [-VMHost] <VMHost[]> [-Refresh] [-RescanAllHba] [-RescanVmfs] [-Server <VIServer[]>] [<CommonParameters>] Get-VMHostStorage -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostStorage Detailed Description This cmdlet retrieves the host storages on a vCenter Server system. The cmdlet returns a list of the storages on the hosts specified by the VMHost parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the hosts for which you want to retrieve storage information. Specifies the IDs of the host storages that you want to retrieve. Indicates whether the cmdlet refreshes the storage system information before retrieving the specified host storages. Indicates whether to issue a request to rescan all virtual machine hosts bus adapters for new storage devices prior to retrieving the storage information. Indicates whether to perform a re-scan for new virtual machine file systems that might have been added, prior to retrieving the storage information. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
RescanVmfs
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
98/287
7/8/13
Return Type Zero or more VMHostStorageInfo objects Notes
The ScsiLun property of the VMHostStorageInfo object is deprecated and sche duled for removal. Examples -------------- Example 1 -------------G e t V m H o s t S t o r a g eV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4R e f r e s h Retrieves storage information from the virtual machine host with IP address 10.23.112.234. -------------- Example 2 -------------G e t V M H o s t S t o r a g e|s e l e c te x p a n d p r o p e r t ys c s i l u n|f l* Retrieves information about the vendor, model, and serial number of the virtual machine host storage SCSI adapter. Note that for devices, that are not SCSI-3 compliant, the SerialNumber property is not defined. And not all SCSI-3 compliant devices provide the serial number information.
Get-VMHostSysLogServer
Synopsis
This cmdlet displays the remote syslog servers of the specified hosts. Syntax Get-VMHostSysLogServer [-VMHost] <VMHost[]> [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMHostSysLogServer Detailed Description This cmdlet displays the remote syslog servers of the specified hosts. The returned object contains the server address and the port if configured. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Server
VMHost[] VIServer[]
Specifies the host whose remote syslog server you want to display. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer.
true false
Return Type Zero or more NamedIPEndPoint objects Notes Examples -------------- Example 1 -------------$ s y s L o g S e r v e r=G e t V M H o s t S y s L o g S e r v e r V M H o s t1 0 . 2 3 . 1 2 3 . 2 3 4 Retrieves the SysLog server of the virtual machine host with IP address 10.23.123.234.
Get-VMQuestion
Synopsis
This cmdlet retrieves the pending questions for the specified virtual machines. Syntax Get-VMQuestion [-VM <VirtualMachine[]>] [[-QuestionText] <String>] [-QuestionId <String>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMQuestion Detailed Description This cmdlet retrieves the pending questions for the specified virtual machines. A question is a task that requires a response from you. If the VM parameter is not specified or its value is $null, the cmdlet returns all questions for all virtual machines on the specified servers. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
QuestionText QuestionId
String String
Specifies a phrase from the text that describes the questions you want to retrieve. Specifies the IDs of the questions you want to retrieve.
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
99/287
7/8/13
Server VIServer[]
VM Return Type
VirtualMachine[]
false
true (ByValue)
Zero or more VmQuestion objects Notes Examples -------------- Example 1 -------------G e t V M Q u e s t i o nV MV M Retrieves the questions of the VM virtual machine. -------------- Example 2 -------------$ v m=G e t V MV M $ v m|G e t V M Q u e s t i o nQ u e s t i o n T e x t" * h a v eb e e nm o v e do rc o p i e d * " Retrieves the VM virtual machine questions that contain the phrase "have been moved or copied".
Get-VMResourceConfiguration
Synopsis
This cmdlet retrieves information about the resource allocation between the selected virtual machines. Syntax Get-VMResourceConfiguration [-Server <VIServer[]>] [-VM] <VirtualMachine[]> [<CommonParameters>] Related Commands Online version Set-VMResourceConfiguration Detailed Description This cmdlet retrieves information about the resource allocation between the selected virtual machines. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Server
VirtualMachine[] VIServer[]
Specifies the virtual machines whose resource configuration you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
true false
Return Type Zero or more VMResourceConfiguration objects Notes Examples -------------- Example 1 -------------G e t V M R e s o u r c e C o n f i g u r a t i o nV MV M|F o r m a t C u s t o mP r o p e r t yD i s k R e s o u r c e C o n f i g u r a t i o n Displays the disk share for the VM virtual machine.
Get-VMStartPolicy
Synopsis
This cmdlet retrieves the start policy of the virtual machines on a vCenter Server system. Syntax Get-VMStartPolicy [-VMHost <VMHost[]>] [[-VM] <VirtualMachine[]>] [-Server <VIServer[]>] [<CommonParameters>] Related Commands Online version Set-VMStartPolicy Detailed Description This cmdlet retrieves the start policy of the virtual machines on a vCenter Server system. The virtual machines are specified by the VM parameter or retrieved from the host passed through the VMHost parameter. To specify a server different from the default one, use the Server parameter. Parameters
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
100/287
7/8/13
NA ME TYPE DESCRIPTION
VM Server
VirtualMachine[] VIServer[]
Specifies the virtual machines whose start policy you want to retrieve. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the hosts of the virtual machines whose start policy you want to retrieve.
false false
VMHost
VMHost[]
false
true (ByValue)
Return Type Zero or more VMStartPolicy objects Notes Examples -------------- Example 1 -------------G e t V M S t a r t P o l i c yV MV M Retrieves the start policy of the virtual machine named VM.
Import-CIVApp
Synopsis
This cmdlet imports a virtual machine from the underlying vSphere to the cloud. Syntax Import-CIVApp [-VM] <VirtualMachine> [-ComputerName <String>] [-Description <String>] [-Name <String>] [-NoCopy] [-RunAsync] [-Server <CIServer[]>] -OrgVdc <OrgVdc> [-WhatIf] [-Confirm] [<CommonParameters>] Import-CIVApp [-VM] <VirtualMachine> [-ComputerName <String>] [-NoCopy] [-RunAsync] [-Server <CIServer[]>] -VApp <CIVApp> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp Get-CloudVAppTempate Import-CloudVAppTempate Detailed Description This cmdlet imports a virtual machine from the underlying vSphere to the cloud as a vApp. You can import the virtual machine to an already existing vApp or create a new vApp and import the virtual machine into it. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM
VirtualMachine
Specifies the virtual machine you want to import into the cloud. This parameter accepts VirtualMachine objects retrieved from a vCenter Server that has already been registered with vCloud Director. Specifies a computer name for the imported virtual machine. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the imported virtual machine. Specifies the name of the new vApp that you want to create by importing the selected vSphere virtual machine. If you do not set a name, the newly created vApp inherits the name of the imported virtual machine. Use this parameter if you want to import the original vSphere virtual machine. Otherwise, a copy of the virtual machine is imported in vCloud Director. Importing the original vSphere virtual machine might cause its modification. Specifies the organization vDC to which you want to import the virtual machine. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Specifies the vApp into which you want to import the virtual machine. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
ComputerName Confirm
String SwitchParameter
false false
false false
Description Name
String String
false false
false false
NoCopy
SwitchParameter
false
false
OrgVdc RunAsync
OrgVdc SwitchParameter
true false
Server
CIServer[]
false
false
CIVApp SwitchParameter
true false
The CIVApp object that represents the imported vApp Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
101/287
7/8/13
G e t O r g V d c' M y O r g a n i z a t i o n V d c '|I m p o r t C I V A p pV M( G e t V M' M y V M T o I m p o r t ' ) Imports a virtual machine from vSphere into a new cloud virtual appliance. Note: You must be connected to a vCenter Server and a vCloud Director server. -------------- Example 2 -------------( G e t V M' M y V M T o I m p o r t ' )|I m p o r t C I V A p pO r g V d c' M y O r g a n i z a t i o n V d c 'N a m e' M y N e w V A p p 'D e s c r i p t i o n" M yN e wV A p pD e s c r i p t i o n "C o m p u t e r N a m e" M y C o m p u t e r " Imports a virtual machine from vSphere into a new cloud virtual appliance (Vapp) while specifying the new VApp name, its description and the virtual machine computer name. Note: You must be connected to a vCenter Server and a vCloud Director server. -------------- Example 3 -------------I m p o r t C I V A p pV M( G e t V M' M y V M T o I m p o r t ' )O r g V d c' M y O r g a n i z a t i o n V d c 'N o C o p y Imports a virtual machine from vSphere into a new cloud virtual appliance by moving it instead of copying it. Note: You must be connected to a vCenter Server and a vCloud Director server. -------------- Example 4 -------------I m p o r t C I V A p pV M( G e t V M' M y V M T o I m p o r t ' )V A p p' M y V A p p T o E x t e n d ' Imports a virtual machine from vSphere into an existing cloud virtual appliance. Note: You must be connected to a vCenter Server and a vCloud Director server. -------------- Example 5 -------------G e t C I V A p p" M y V A p p T o E x t e n d "|I m p o r t C I V A p p( G e t V M' M y V M T o I m p o r t ' )N o C o p y Imports a VM from vSphere into an existing cloud VApp by moving it instead of copying it. Note: You must be connected to a vCenter Server and a vCloud Director server.
Import-CIVAppTemplate
Synopsis
This cmdlet imports a virtual machine or an OVF package from vCenter Server to vCloud Director as a vApp template. Syntax Import-CIVAppTemplate [-VM] <VirtualMachine> [-Catalog <Catalog>] [-ComputerName <String>] [-Description <String>] [-Name <String>] -OrgVdc <OrgVdc> [NoCopy] [-GoldMaster] [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Import-CIVAppTemplate [-Catalog <Catalog>] [-Name <String>] -SourcePath <String> -OrgVdc <OrgVdc> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Import-CIVAppTemplate [-SourcePath <String>] -VAppTemplate <CIVAppTemplate> -ResumeUpload [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp Get-CIVAppTempate Import-CIVApp Detailed Description This cmdlet imports a virtual machine or an OVF package from vCenter Server to vCloud Director as a vApp template. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM
VirtualMachine
Specifies the virtual machine you want to import into vCloud Director. This parameter accepts VirtualMachine objects retrieved from a vCenter Server that has already been registered with vCloud Director. Note: This parameter is only available to Provider Administrators. Specifies the catalog where the imported template will be placed. Specifies a computer name for the imported object. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the imported object. Indicates that the virtual machine is imported as a GoldMaster vApp template. Specifies a new name for the new OVF or vApp template. If not specified, the new object takes the name of the vSphere virtual machine. Indicates that you want to import the original vSphere object. Otherwise, a copy of the object is imported in the vCloud. Importing the original vSphere object might cause its modification. Specifies the organization vDC to which you want to add the new object. Indicates that you want to resume a previously interrupted OVF
true
true (ByValue)
NoCopy
SwitchParameter
false
false
OrgVdc ResumeUpload
OrgVdc SwitchParameter
true true
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
102/287
7/8/13
upload. RunAsync SwitchParameter
Server
CIServer[]
false
false
SourcePath VAppTemplate
String CIVAppTemplate
true true
SwitchParameter
false
false
The imported CIVAppTemplate objects Notes Examples -------------- Example 1 -------------$ m y C a t a l o g=G e t C a t a l o gM y C a t a l o g $ m y O r g v d c=G e t O r g V d cM y O r g V d c I m p o r t C I V A p p T e m p l a t eS o u r c e P a t hC : \ o v f s \ W i n d o w s X P \ W i n d o w s X P . o v fN a m eM y W i n d o w s X P V A p p T e m p l a t eO r g V d c$ m y O r g v d cC a t a l o g$ m y C a t a l o g Imports an OVF formatted virtual machine as a catalog item while specifying VAppTemplate name, catalog and organization virtual datacenter. -------------- Example 2 -------------$ m y o r g a n i z a t i o n v d c=G e t O r g V d cM y O r g V d c I m p o r t C I V A p p T e m p l a t eS o u r c e P a t hC : \ o v f s \ W i n d o w s X P \ W i n d o w s X P . o v fO r g V d c$ m y O r g v d c Imports an OVF formatted virtual machine while specifying only the organization virtual datacenter to be placed in. -------------- Example 3 -------------G e t C I V A p p T e m p l a t eM y W i n d o w s X P V A p p T e m p l a t e|I m p o r t C I V A p p T e m p l a t eR e s u m e U p l o a dS o u r c e P a t hC : \ o v f s \ W i n d o w s X P \ W i n d o w s X P . o v f Resumes upload in case of a network failure. First obtains the not fully uploaded VAppTemplate, then starts the resume process. -------------- Example 4 -------------$ m y C a t a l o g=G e t C a t a l o gM y C a t a l o g $ m y O r g v d c=G e t O r g V d cM y O r g V d c $ m y V M=G e t V MN a m e' M y W i n d o w s X P ' I m p o r t C I V A p p T e m p l a t eV M$ m y V MN a m eM y W i n d o w s X P V A p p T e m p l a t eO r g V d c$ m y O r g v d cC a t a l o g$ m y C a t a l o g Imports a vSphere virtual machine as a vCloud Director VAppTemplate. Note: You must be connected to a vCenter Server and a vCloud Director server. -------------- Example 5 -------------$ m y O r g v d c=G e t O r g V d cM y O r g V d c $ m y C a t a l o g=G e t C a t a l o gM y C a t a l o g $ m y V M=G e t V MN a m e' M y W i n d o w s X P ' I m p o r t C I V A p p T e m p l a t eV M$ m y V MN a m eM y W i n d o w s X P V A p p T e m p l a t eO r g V d c$ m y O r g v d cC a t a l o g$ m y C a t a l o gN o C o p y Imports a vSphere virtual machine as a vCloud Director VAppTemplate. The virtual machine is moved by using the -NoCopy switch. Note: You must be connected to a vCenter Server and a vCloud Director server.
Import-VApp
Synopsis
This cmdlet imports OVF (Open Virtualization Format) and OVA packages. The package can contain a virtual appliance or a virtual machine. Syntax Import-VApp [-Source] <String> [[-Name] <String>] [-Location <VIContainer>] [-VMHost] <VMHost> [-Datastore <StorageResource>] [-Force] [-DiskStorageFormat <VirtualDiskStorageFormat>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Export-VApp Get-VApp New-VApp Remove-VApp Set-VApp Start-VApp Stop-VApp Move-VApp Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
103/287
7/8/13
This cmdlet imports OVF (Open Virtualization Format) and OVA packages. The package can contain a vApp or a virtual machine. The cmdlet returns a VApp object when the OVF contains a vApp and a VirtualMachine object when the OVF contains a single virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the path to the OVF or OVA package that you want to import. Specifies a name for the imported vApp or virtual machine. Specifies a host where you want to run the vApp or virtual machine. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a datastore or a datastore cluster where you want to store the vApp or virtual machine. Specifies the storage format for the disks of the imported VMs. By default, the storage format is thick. When you set this parameter, you set the storage format for all virtual machine disks in the OVF package. This parameter accepts Thin, Thick, and EagerZeroedThick values. Indicates that you want to import an OVF or OVA package even if the package signature cannot be verified. Specifies a vSphere inventory container where you want to import the vApp or virtual machine. It must be a vApp, a resource pool, or a cluster. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Datastore DiskStorageFormat
StorageResource VirtualDiskStorageFormat
false false
false false
Force
SwitchParameter
false
false
Location
VIContainer
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type The newly created VApp or VirtualMachine object Notes Examples -------------- Example 1 -------------$ v m H o s t=G e t V M H o s tN a m e" M y V M H o s t 1 " I m p o r t v A p pS o u r c e" c : \ v A p p s \ W e b S e r v e r \ W e b S e r v e r . o v f "V M H o s t$ v m H o s t Imports an OVF package by specifying the target host and name. -------------- Example 2 -------------$ m y C l u s t e r=G e t C l u s t e rN a m e" M y C l u s t e r 1 " $ v m H o s t=G e t V M H o s tN a m e" M y V M H o s t 1 " I m p o r t v A p pS o u r c e" c : \ v A p p s \ W e b S e r v e r \ W e b S e r v e r . o v f "V M H o s t$ v m H o s tL o c a t i o n$ m y C l u s t e rN a m e" M y W e b S e r v e r P r o d u c t i o n 1 " Imports an OVF package within a cluster. -------------- Example 3 -------------$ v m H o s t=G e t V M H o s tN a m e" M y V M H o s t 1 " $ m y D a t a s t o r e=G e t D a t a s t o r eN a m e" M y D a t a s t o r e 1 " $ v m H o s t|I m p o r t v A p pS o u r c e" c : \ v A p p s \ W e b S e r v e r \ W e b S e r v e r . o v f "D a t a s t o r e$ m y D a t a s t o r e Imports an OVF package by specifying a datastore where to store the virtual machines. -------------- Example 4 -------------$ m y D a t a s t o r e=G e t D a t a s t o r eN a m e" M y D a t a s t o r e 1 " $ v m H o s t=G e t V M H o s tN a m e" M y V M H o s t 1 " $ v m H o s t|I m p o r t v A p pS o u r c e" c : \ v A p p s \ W e b S e r v e r \ W e b S e r v e r . o v a "D a t a s t o r e$ m y D a t a s t o r eF o r c e Imports an OVA package even if the package signature cannot be verified.
Import-VMHostProfile
Synopsis
This cmdlet imports a host profile from a file. The file path must be accessible from the vSphere PowerCLI client side. Syntax
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
104/287
7/8/13
Import-VMHostProfile [-FilePath] <String> [-Name] <String> [[-ReferenceHost] <VMHost>] [-Description <String>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Export-VMHostProfile Get-VMHostProfile New-VMHostProfile Remove-VMHostProfile Set-VMHostProfile Test-VMHostProfileCompliance Detailed Description This cmdlet imports a host profile from a file. The file path must be accessible from the vSphere PowerCLI client side. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the path to the file, from which you want to import a host profile. Specifies a name of the imported host profile. Specifies a reference host for the imported host profile. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the imported host profile. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Description Server
String VIServer[]
false false
SwitchParameter
false
false
The imported VMHostProfile object Notes Examples -------------- Example 1 -------------I m p o r t V M H o s t P r o f i l eF i l e P a t he x p o r t . p r fN a m eP r o f i l e Imports a virtual machine host profile from the export.prf file and names it Profile.
Install-VMHostPatch
Synopsis
This cmdlet updates the specified hosts. Syntax Install-VMHostPatch [-VMHost] <VMHost[]> -HostPath <String[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Install-VMHostPatch [-VMHost] <VMHost[]> -WebPath <String[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Install-VMHostPatch [-VMHost] <VMHost[]> -LocalPath <String[]> [-HostUsername <String>] [-HostPassword <SecureString>] [-HostCredential <PSCredential>] [Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostPatch Detailed Description This cmdlet updates the specified hosts. The cmdlet installs patches on the host. The patches that can be located locally, on a web location, or in a host file system. When using the LocalPath or WebPath parameters, the ESX/ESXi host attempts to store the patch contents in its local temporary directory. Because ESXi hosts might not have enough free space on their local drives, this cannot apply to large size patches. The best practice for upgrading an ESXi host is to upload the patch contents on the host's datastore and to run Install-VMHostPatch with the HostPath parameter. Depending on the component to be upgraded, you might have to set the host into a maintenance mode and to restart the host or the hostd management service after applying the patch. This cmdlet is experimental and might be changed or removed in a future release. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the hosts you want to update. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a PSCredential object that contains credentials for authenticating with the host. Specifies the password you want to use to authenticate with the host. Specifies a file path on the ESX/ESXi host to the patches you want to install. Specifies the username you want to use to authenticate with the host. Specifies the local file system path to the patches you want to install.
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
105/287
7/8/13
RunAsync SwitchParameter
Server
VIServer[]
false
false
String[] SwitchParameter
true false
false false
One or more VMHostPatchResult objects Notes The cmdlet works only on ESX 4.0 and later. Examples -------------- Example 1 -------------I n s t a l l V M H o s t P a t c hV M H o s t$ v m h o s t 1 , $ v m h o s t 2L o c a l P a t hc : \ e s x 4 0 \ p a t c h e s \ E S X 4 0 0 2 0 0 9 0 6 0 0 1 \ m e t a d a t a . z i pH o s t U s e r n a m ea d m i nH o s t P a s s w o r dp a s s Updates ESX servers using a local file. Before running the cmdlet, you must download the patch file locally and extract to a folder. The name of the folder must contain the patch ID (for example, "ESX400-200906001"). Providing credentials when installing a patch from a local path is mandatory. -------------- Example 2 -------------$ v m h o s t|I n s t a l l V M H o s t P a t c hW e b P a t hh t t p : / / m y I n t e r n a l W e b S e r v e r / e s x 4 0 / E S X 4 0 0 2 0 0 9 0 6 0 0 1 / m e t a d a t a . z i p Upgrades an ESX server using a Web location. Before running the cmdlet, you must download the patch file and extract to a folder that is published on a Web server. The patch URL address must contain the patch ID (for example, http://myInternalWebServer/esx40/ESX400-200906001/). -------------- Example 3 -------------$ d a t a s t o r e=G e t D a t a s t o r eN a m eD a t a s t o r e C o p y D a t a s t o r e I t e mc : \ t e m p \ E S X 4 0 0 2 0 0 9 0 6 0 0 1 \ $ d a t a s t o r e . D a t a s t o r e B r o w s e r P a t hR e c u r s e $ v m h o s t 1 , $ v m h o s t 2|I n s t a l l V M H o s t P a t c hH o s t P a t h / v m f s / v o l u m e s / d a t a s t o r e / E S X 4 0 0 2 0 0 9 0 6 0 0 1 / m e t a d a t a . z i p Upgrades ESX servers using the -HostPath parameter. First, you must download the patch file and extract its contents to a temporary folder that is named after the patch ID (for example, c:\temp\ESX400-200906001\). Copy the folder in the root folder of the Datastore datastore and run Install-VMHostPatch providing the datastore path to the patch. Note that the datastore path is case-sensitive.
Invoke-VMScript
Synopsis
This cmdlet runs a script in the guest OS of each of the specified virtual machines. Syntax Invoke-VMScript [-ScriptText] <String> [-VM] <VirtualMachine[]> [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [GuestCredential <PSCredential>] [-GuestUser <String>] [-GuestPassword <SecureString>] [-ToolsWaitSecs <Int32>] [-ScriptType <ScriptType>] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet runs a script in the guest OS of each of the specified virtual machines. To run Invoke-VMScript, the user must have read access to the folder containing the virtual machine and a Virtual Machine.Interaction.Console Interaction privilege. The virtual machines must be powered on and have VMware Tools installed. Network connectivity to the ESX system hosting the virtual machine on port 902 must be present. To authenticate with the host or the guest OS, one of the HostUser/HostPassword (GuestUser/GuestPassword) pair and HostCredential (GuestCredential) parameters must be provided. The guest account you use to authenticate with the guest operating system must have administrator's privileges. This cmdlet supports only Windows XP 32bit SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Modify and VirtualMachine.GuestOperations.Execute privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ScriptText
String
Provides the text of the script you want to run. You can also pass to this parameter a string variable containing the path to the script. Specifies the virtual machines on whose guest operating systems you want to run the script. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a PSCredential object containing the credentials you
true
false
VM Confirm
VirtualMachine[] SwitchParameter
true false
GuestCredential
PSCredential
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
106/287
7/8/13
Specifies the password you want to use for authenticating with the virtual machine guest OS. Specifies the user name you want to use for authenticating with the virtual machine guest OS. Specifies a PSCredential object containing the credentials you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the user name you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the type of the script. The valid values are PowerShell, Bat, and Bash. If the virtual machine OS is Windows, the default value is PowerShell. If the virtual machine OS is Linux, the default value is Bash. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies how long in seconds the system waits for connecting to the VMware Tools. The default value is 20. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
HostPassword
SecureString
false
false
HostUser
String
false
false
RunAsync
SwitchParameter
false
false
ScriptType
ScriptType
false
false
Server
VIServer[]
false
false
Int32 SwitchParameter
false false
false false
20
One or more VMScriptResult objectsVMScriptResult Notes To make PowerShell scripts work, you must restart the virtual machine after the PowerShell installation. For BIN and BASH scripts, restart is not need ed. Examples -------------- Example 1 -------------I n v o k e V M S c r i p tV MV MS c r i p t T e x t" d i r "G u e s t U s e ra d m i n i s t r a t o rG u e s t P a s s w o r dp a s s 2 Lists the directory entries on the guest OS. -------------- Example 2 -------------$ s c r i p t=' & " $ e n v : P r o g r a m F i l e s \ C o m m o nF i l e s \ M i c r o s o f tS h a r e d \ M S I n f o \ m s i n f o 3 2 . e x e "/ r e p o r t" $ e n v : T m p \ i n f o r e p o r t " ' I n v o k e V M S c r i p tS c r i p t T e x t$ s c r i p tV MV MG u e s t C r e d e n t i a l$ g u e s t C r e d e n t i a l Runs a PowerShell script. In PowerShell, to access environment variables, you must use the following syntax: $env:<environment variable> (for example, $env:ProgramFiles). Also, to run the program, you must specify an ampersand (&) in front of the program path. The outer quotes ($script = '...') are required because this is how you define a string variable in PowerShell. The inner double quotes are required because there are spaces in the path. -------------- Example 3 -------------$ s c r i p t=' " % p r o g r a m f i l e s % \ C o m m o nF i l e s \ M i c r o s o f tS h a r e d \ M S I n f o \ m s i n f o 3 2 . e x e "/ r e p o r t" % t m p % \ i n f o r e p o r t " ' I n v o k e V M S c r i p tS c r i p t T e x t$ s c r i p tV MV MG u e s t C r e d e n t i a l$ g u e s t C r e d e n t i a lS c r i p t T y p eB a t Runs a BAT script. In BAT scripts, to access environment variables, you must use the following syntax: %<environment variable>% (for example, %programfiles%). The outer quotes ($script = '...') are required because this is how you define a string variable in PowerShell. The inner double quotes are required because there are spaces in the path.
Mount-Tools
Synopsis
This cmdlet mounts the VMware Tools CD installer as a CD-ROM on the guest operating system. Syntax Mount-Tools [[-Guest] <VMGuest[]>] [<CommonParameters>] Mount-Tools [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Dismount-Tools Update-Tools
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
107/287
7/8/13
Detailed Description
This cmdlet mounts the VMware Tools CD installer as a CD-ROM on the guest operating system that is specified by the Guest or VM parameters. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Guest VM Server
Specifies the guest operating systems on which you want to mount VMware Tools. Specifies the virtual machines on which you want to mount VMware Tools. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Return Type None Notes Examples -------------- Example 1 -------------M o u n t T o o l sV M Mounts the VMware Tools on the specified virtual machine. The virtual machine must be powered on. -------------- Example 2 -------------G e t V M G u e s tV M|M o u n t T o o l s Mounts the VMware Tools on the virtual machine specified by its guest operating system. The virtual machine must be powered on.
Move-Cluster
Synopsis
This cmdlet moves a vCenter Server cluster from one location to another. Syntax Move-Cluster [-Cluster] <Cluster[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Cluster New-Cluster Set-Cluster Detailed Description This cmdlet moves a vCenter Server cluster to the location that is specified by the Destination parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Cluster Destination
Cluster[] VIContainer
Specifies the clusters you want to move to another location. Specifies the folder or datacenter where you want to move the clusters. If a datacenter is specified for the Destination parameter, the cluster is moved to its "hostFolder" folder. The "hostFolder" is a system folder and is guaranteed to exist. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true true
Confirm
SwitchParameter
false
false
$true
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more relocated Cluster objects Notes Examples -------------- Example 1 -------------M o v e C l u s t e rC l u s t e rC l u s t e rD e s t i n a t i o nF o l d e r Moves the cluster named Cluster into the folder called Folder on the same datacenter
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
108/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Move-Datacenter
Synopsis
This cmdlet moves a vCenter Server datacenter from one location to another. Syntax Move-Datacenter [-Datacenter] <Datacenter[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-Datacenter Get-Datacenter Remove-Datacenter Set-Datacenter Detailed Description This cmdlet moves a vCenter Server datacenter to the location that is specified by the Destination parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the datacenters you want to move to another location. Specifies the folder where you want to move the datacenters. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more relocated Datacenter objects Notes Examples -------------- Example 1 -------------M o v e D a t a c e n t e rD a t a c e n t e rD e s t i n a t i o nF o l d e r Moves the Datacenter datacenter into the folder named Folder.
Move-Datastore
Synopsis
This cmdlet moves datastores from one location to another. Syntax Move-Datastore [-Datastore] <Datastore[]> [-Destination] <VIObject> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-Datastore Get-Datastore Remove-Datastore Set-Datastore Detailed Description This cmdlet moves datastores from one location to another. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the datastore that you want to move. Specifies a datastore cluster, folder, or datacenter where you want to place the datastore. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
109/287
7/8/13
Return Type Zero or more relocated Datastore objects Notes Examples -------------- Example 1 --------------
M o v e D a t a s t o r e" M y D a t a s t o r e "D e s t i n a t i o n" M y D a t a s t o r e F o l d e r " Moves the MyDatastore datastore to the specified folder. -------------- Example 2 -------------$ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m e" M y D a t a t o r e C l u s t e r " G e t D a t a s t o r e" M y D a t a s t o r e 1 " ," M y D a t a s t o r e 2 "|M o v e D a t s t o r eD e s t i n a t i o n$ m y D a t a s t o r e C l u s t e r Moves two datastores to a specified datastore cluster.
Move-Folder
Synopsis
This cmdlet moves a vCenter Server folder from one location to another. Syntax Move-Folder [-Folder] <Folder[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Folder New-Folder Remove-Folder Set-Folder Detailed Description This cmdlet moves a vCenter Server folder to the location that is specified by the Destination parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Folder Destination
Folder[] VIContainer
Specifies the folders you want to move to another location. Specifies the datacenter or folder where you want to move the folders. If a datacenter is specified for the Destination parameter, the folder is moved to the datacenter's hostFolder or vmFolder folder, depending on the folder's child item type. The hostFolder and vmFolder are system folders and are guaranteed to exist. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true true
Confirm
SwitchParameter
false
false
$true
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more relocated Folder objects Notes Examples -------------- Example 1 -------------G e t F o l d e rN a m e" v m F o l d e r "|M o v e F o l d e rD e s t i n a t i o n" d e s t i n a t i o n V m F o l d e r " Moves the "vmFolder" folder into another folder of the same type named "destinationVmFolder".
Move-HardDisk
Synopsis
This cmdlet moves a hard disk from one location to another. Syntax Move-HardDisk [-HardDisk] <HardDisk[]> [-Datastore] <Datastore> [-StorageFormat <VirtualDiskStorageFormat>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [Confirm] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
110/287
7/8/13
Related Commands Online version Get-HardDisk New-HardDisk Remove-HardDisk Set-HardDisk Detailed Description
This cmdlet moves a hard disk from one location to another. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the hard disk that you want to move to another location. Specifies a datastore where you want to place the hard disk. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies the storage format of the relocated hard disk. This parameter accepts Thin, Thick, and EagerZeroedThick values. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
StorageFormat
VirtualDiskStorageFormat
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more relocated HardDisk objects Notes Examples -------------- Example 1 -------------$ m y D a t a s t o r e 1=G e t D a t a s t o r eN a m e' M y D a t a s t o r e 1 ' $ m y D i s k=G e t V MN a m eM y V m 1|G e t H a r d D i s k M o v e H a r d D i s kH a r d D i s k$ m y D i s kD a t a s t o r e$ m y D a t a s t o r e 1 Moves the hard disk of a specified virtual machine to another datastore. -------------- Example 2 -------------$ m y D i s k=G e t V MN a m e' M y V M 1 '|G e t H a r d D i s k $ m y D a t a s t o r e 1=G e t D a t a s t o r eN a m e' M y D a t a s t o r e 1 ' M o v e h a r d D i s k-H a r d D i s k$ m y D i s kD a t a s t o r e$ m y D a t a s t o r e 1-S t o r a g e F o r m a t' E a g e r Z e r o e d T h i c k ' Moves the hard disk of a specified virtual machine to another datastore and changes the storage format of the hard disk to EagerZeroedThick.
Move-Inventory
Synopsis
This cmdlet moves a vCenter Server inventory item from one location to another. Syntax Move-Inventory [-Item] <InventoryItem[]> [-Destination] <VIContainer> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Inventory Remove-Inventory Detailed Description This cmdlet moves a vCenter Server inventory object or template to the location that is specified by the Destination parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Item
InventoryItem[]
Specifies the Folder, ResourcePool, Datacenter, VirtualMachine, VMHost, Template, or Cluster objects you want to move to another location. Specifies the location where you want to move the inventory items. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console.
true
true (ByValue)
Destination Confirm
VIContainer SwitchParameter
true false
RunAsync
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
111/287
7/8/13
Server VIServer[]
SwitchParameter
false
false
Zero or more relocated VIObject objects Notes Examples -------------- Example 1 -------------$ v m=G e t V MN a m eV M * M o v e I n v e n t o r yI t e m$ v mD e s t i n a t i o nF o l d e r Moves the virtual machines whose names start with VM to the Folder folder. -------------- Example 2 -------------G e t F o l d e rF o l d e r 1|G e t I n v e n t o r yN o R e c u r s i o n|M o v e I n v e n t o r yD e s t i n a t i o nF o l d e r 2 Moves all objects from the Folder1 folder to the Folder2 folder.
Move-ResourcePool
Synopsis
This cmdlet moves a resource pool from one location to another. Syntax Move-ResourcePool [-ResourcePool] <ResourcePool[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ResourcePool New-ResourcePool Remove-ResourcePool Set-ResourcePool Detailed Description This cmdlet moves a resource pool to the location that is specified by the Destination parameter. To specify a server different from the default one, use the Server parameter. Moving a resource pool is only supported when the objects assigned to the ResourcePool and Destination parameters are passed through connections to one and the same server with the same credentials. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ResourcePool Destination
ResourcePool[] VIContainer
Specifies the resource pools you want to move to another location. Specifies the location where you want to move the resource pools. If a host or a cluster is specified for the Destination parameter, the resource pool is moved into a resource pool named Resources. The Resources resource pool is a system resource pool and is guaranteed to exist. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true true
Confirm
SwitchParameter
false
false
$true
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more relocated ResourcePool objects Notes Examples -------------- Example 1 -------------M o v e R e s o u r c e P o o lR e s o u r c e P o o lR e s o u r c e P o o lD e s t i n a t i o nH o s t Moves the resource pool named ResourcePool to the virtual machine host Host.
Move-Template
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
112/287
7/8/13
Synopsis
This cmdlet moves virtual machine templates to another location. Syntax Move-Template [-Template] <Template[]> [-Destination] <VIContainer> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Template New-Template Remove-Template Detailed Description This cmdlet moves virtual machine templates to a location that is specified by the Destination parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a container object where you want to move the templates. Specifies the virtual machine templates you want to move to another location. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more relocated Template objects Notes Examples -------------- Example 1 -------------M o v e T e m p l a t eT e m p l a t e$ t e m p l a t eD e s t i n a t i o n$ d e s t Moves the $template object into the $dest container object.
Move-VApp
Synopsis
This cmdlet moves the specified virtual appliances to a new location. Syntax Move-VApp [-Destination] <VIContainer> [-VApp] <VApp[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VApp New-VApp Export-VApp Import-VApp Set-VApp Start-VApp Stop-VApp Remove-VApp Detailed Description This cmdlet moves the specified vApps to a new location. If the destination is a host or a cluster, the vApps are moved to the system "Resources" resource pool. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Destination
VApp[] VIContainer
Specifies the vApps you want to move. Specifies where you want to move the specified vApps. Supported types are Folder, VMHost, Cluster, ResourcePool, VApp, and Datacenter. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that
true true
Confirm
SwitchParameter
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
113/287
7/8/13
Return Type Zero or more relocated VApp objects Notes Examples -------------- Example 1 --------------
$ v m H o s t=G e t V M H o s tN a m e" M y V M H o s t 1 " $ m y D e s t i n a t i o n R P=N e w R e s o u r c e P o o lN a m e" v A p pR e s o u r c e P o o l "L o c a t i o n$ v m H o s t M o v e V A p pV A p p( G e t V a p pN a m e" M y V A p p 1 "L o c a t i o n$ v m H o s t )D e s t i n a t i o n$ m y D e s t i n a t i o n R P Moves a vApp from a host to a resource pool from the same host. -------------- Example 2 -------------$ v m H o s t=G e t V M H o s tN a m e" M y V M H o s t 1 " $ m y D e s t i n a t i o n V A p p=N e w V A p pN a m e" M y v A p p 1 "L o c a t i o n$ v m H o s t ( G e t V a p pN a m e" M y v A p p 2 "L o c a t i o n( G e t R e s o u r c e P o o lN a m e" M y R e s o u r c e P o o l 1 " )|M o v e V A p pD e s t i n a t i o n$ m y D e s t i n a t i o n V A p p Moves a vApp from a resource pool to another vApp. -------------- Example 3 -------------M o v e V A p pN a m e" M y v A p p 1 "( G e t V M H o s tN a m e" M y V M H o s t 1 " ) Moves a vApp from a resource pool to a host. -------------- Example 4 -------------$ m y V m F o l d e r 1=G e t F o l d e rN a m e" M y V M F o l d e r 1 "L o c a t i o n( G e t D a t a c e n t e rN a m e" M y D a t a c e n t e r 1 " )N o R e c u r s i o n $ m y V M F o l d e r 2=N e w F o l d e rN a m e" M y V M F o l d e r 2 "L o c a t i o n$ m y V m F o l d e r 1 G e t V A p pN a m e" M y V A p p "|M o v e V A p pD e s t i n a t i o n$ m y V M F o l d e r 2R u n A s y n c Moves a virtual appliance to a folder asynchronously.
Move-VM
Synopsis
This cmdlet moves virtual machines to another location. Syntax Move-VM [-AdvancedOption <AdvancedOption[]>] [[-Destination] <VIContainer>] [-Datastore <StorageResource>] [-DiskStorageFormat <VirtualDiskStorageFormat>] [RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Remove-VM New-VM Set-VM Start-VM Stop-VM Suspend-VM Restart-VM Detailed Description This cmdlet moves a virtual machine to the location that is specified by the Destination or the Datastore parameters. The destination must be a folder, host, cluster, or a resource pool. Moving a virtual machine in a cluster is only possible if the virtual machine is in a resource pool in that cluster. If the virtual machine is outside the cluster, you need to specify a virtual machine host in that cluster as destination. When moving virtual machines that are powered on, VMotion is used. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Destination
VirtualMachine[] VIContainer
Specifies the virtual machines you want to move to another location. Specifies a folder, host, cluster, or a resource pool where you want to move the virtual machines. If a datacenter is specified for the Destination parameter, the virtual machines are moved to the datacenter's "vmFolder" folder. The "vmFolder" is a system folder and is guaranteed to exist. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. This parameter is only applicable when a DatastoreCluster object is passed to the Datastore parameter. Specifies one or more rules for the placement of the virtual machines that you want to relocate. To indicate that VMs should be stored on different datastores, pass an SdrsVMAntiAffinityRule object to the parameter. You can set more than one Storage DRS (SDRS) VM anti-affinity rules. To indicate that the VM disks should be stored on different datastores, pass an SdrsVMDiskAntiAffinityRule object to the parameter. You can set only one SDRS VM disk anti-affinity rule.
true false
AdvancedOption
AdvancedOption[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
114/287
7/8/13
Confirm SwitchParameter
Datastore
StorageResource
false
false
DiskStorageFormat
VirtualDiskStorageFormat
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more relocated VirtualMachine objects Notes Examples -------------- Example 1 -------------G e t V MN a m eV M|M o v e V MD e s t i n a t i o n1 0 . 2 3 . 1 1 2 . 2 3 5 Moves the virtual machine named VM from its current location to the host on IP address 10.23.112.235. -------------- Example 2 -------------M o v e V MV MV MD e s t i n a t i o nF o l d e r Moves the virtual machine to a folder called Folder. Note that you are able to move virtual machines only to folders containing virtual machines (the 'blue' folders in the vSphere Client). -------------- Example 3 -------------M o v e V MV MV MD e s t i n a t i o nR e s o u r c e P o o l Moves the virtual machine to the ResourcePool resourcepool. The ESX host does not change. -------------- Example 4 -------------$ m y D a t a s t o r e C l u s t e r 1=G e t D a t a s t o r e C l u s t e rN a m e' M y D a t a s t o r e C l u s t e r 1 ' M o v e V MV M' M y V M 1 'D a t a s t o r e$ m y D a t a s t o r e C l u s t e r 1 Moves the MyVM1 virtual machine to any datastore in the specified datastore cluster. -------------- Example 5 -------------$ m y D a t a s t o r e C l u s t e r 1=G e t D a t a s t o r e C l u s t e rN a m e' M y D a t a s t o r e C l u s t e r 1 ' $ m y V m 2=G e t V MN a m e' M y V M 2 ' $ v m A n t i A f f i n i t y R u l e=N e w O b j e c tT y p e N a m eV M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M A n t i A f f i n i t y R u l eA r g u m e n t L i s t$ m y V m 2 M o v e V MV M' M y V M 1 'D a t a s t o r e$ m y D a t a s t o r e C l u s t e r 1A d v a n c e d O p t i o n$ v m A n t i A f f i n i t y R u l e Moves the MyVM1 virtual machine to the specified datastore cluster and sets a VM anti-affinity rule for the placement of the virtual machine. The MyVM1 virtual machine will be placed on any datastore in the specified datastore cluster that does not contain the MyVM2 virtual machine. -------------- Example 6 -------------$ m y V m 1=G e t V MN a m e' M y V M 1 ' $ v m d k s=G e t H a r d d i s kV M$ m y V m 1 $ m y D a t a s t o r e C l u s t e r 1=G e t D a t a s t o r e C l u s t e rN a m e' M y D a t a s t o r e C l u s t e r 1 ' $ v m d k A n t i A f f i n i t y R u l e=N e w O b j e c tT y p e N a m eV M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M D i s k A n t i A f f i n i t y R u l eA r g u m e n t L i s t$ v m d k s M o v e V MV M' $ m y V m 1 'D a t a s t o r e$ m y D a t a s t o r e C l u s t e r 1A d v a n c e d O p t i o n$ v m d k A n t i A f f i n i t y R u l e Moves the MyVM1 virtual machine to the specified datastore cluster and sets a VM disk anti-affinity rule for the placement of the virtual machine. The disks of the MyVM1 virtual machine will be stored on different datastores in the specified datastore cluster.
Move-VMHost
Synopsis
This cmdlet moves hosts to another location. Syntax
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
115/287
7/8/13
Related Commands Online version Add-VMHost Get-VMHost Remove-VMHost Restart-VMHost Set-VMHost Start-VMHost Stop-VMHost Suspend-VMHost Detailed Description
Move-VMHost [-VMHost] <VMHost[]> [-Destination] <VIContainer> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>]
This cmdlet moves hosts to the location that is specified by the Destination parameter. To specify a server different from the default one, use the Server parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the hosts you want to move to another location. Specifies the location where you want to move the hosts. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more relocated VMHost objects Notes Examples -------------- Example 1 -------------M o v e V M H o s t1 9 2 . 1 6 8 . 1 1 2 . 1 1 3D e s t i n a t i o nD a t a c e n t e r Moves the host with IP address 10.23.112.113 to a different datacenter named Datacenter.
New-AdvancedSetting
Synopsis
This cmdlet creates a new advanced setting for the specified entity. Syntax New-AdvancedSetting [-Name] <String> [-Value] <Object> [-Entity] <VIObject[]> [-Type <AdvancedSettingType>] [-Force] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AdvancedSetting Remove-AdvancedSetting Set-AdvancedSetting Detailed Description This cmdlet creates a new advanced setting for the specified entity. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the advanced setting. Specifies a value for the advanced setting. Specifies the entity for which you want to create a new advanced setting. This parameter accepts VIServer, VirtualMachine, VMHost, DatastoreCluster, and Cluster objects. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to create the new advanced setting even if another setting with the same name exists for the specified object type. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the type of the new advanced setting. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
Force
SwitchParameter
false
false
Server
VIServer[]
false
false
Type WhatIf
AdvancedSettingType SwitchParameter
false false
false false
Return Type
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
116/287
7/8/13
The one or more newly created AdvancedSetting objects Notes Examples -------------- Example 1 --------------
N e w A d v a n c e d S e t t i n gE n t i t y( G e t C l u s t e rN a m eC l u s t e r )N a m eS e t t i n g N a m eV a l u eS e t t i n g V a l u eT y p eC l u s t e r H A Creates a new advanced setting for the Cluster cluster - of type CLusterHA, with name SettingName and value SettingValue.
New-AlarmAction
Synopsis
This cmdlet creates an alarm action and attaches it to the specified alarm. Syntax New-AlarmAction [-AlarmDefinition] <AlarmDefinition> -Email [-Subject <String>] -To <String[]> [-Cc <String[]>] [-Body <String>] [-Server <VIServer[]>] [-WhatIf] [Confirm] [<CommonParameters>] New-AlarmAction [-AlarmDefinition] <AlarmDefinition> -Script -ScriptPath <String> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-AlarmAction [-AlarmDefinition] <AlarmDefinition> -Snmp [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AlarmAction Get-AlarmActionTrigger Get-AlarmDefinition New-AlarmActionTrigger Remove-AlarmAction Remove-AlarmActionTrigger Set-AlarmDefinition Detailed Description This cmdlet creates an alarm action and attaches it to the specified alarm. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the alarm definition for which you want to configure actions. Specifies the text of the email message. Specifies the email addresses you want to add to the CC field of the email message. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that when the alarm is activated, the system sends an email message to the specified address. Use the Subject, To, CC, and Body parameters to customize the alarm message. Indicates that a script is run when the alarm is activated. Specifies the file path to the script that will run when the alarm is activated. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that a SNMP message is sent when the alarm is activated. Specifies a subject for the email message you want to send. Specifies the email address to which you want to send a message. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter
true
false
The newly created AlarmAction object Notes Examples -------------- Example 1 -------------G e t A l a r m D e f i n i t i o nN a m e" A l a r m 1 "|N e w A l a r m A c t i o nS n m p Creates an alarm action SNMP. -------------- Example 2 -------------G e t A l a r m D e f i n i t i o nN a m e" A l a r m 1 "|N e w A l a r m A c t i o nS c r i p tS c r i p t P a t h' c : \ t e s t . p s 1 ' Creates an alarm action script. -------------- Example 3 --------------
G e t A l a r m D e f i n i t i o nN a m e" A l a r m 1 "|N e w A l a r m A c t i o nE m a i lT o' t e s t @ v m w a r e . c o m 'C C@ ( ' t e s t 1 @ v m w a r e . c o m ' ,' t e s t 2 @ v m w a r e . c o m ' )B o d y' T e s tb o d y 'S u b j e c t' T e
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
117/287
7/8/13
Creates an alarm action Email.
New-AlarmActionTrigger
Synopsis
This cmdlet creates a new action trigger for the specified alarm action. Syntax New-AlarmActionTrigger [-StartStatus] <InventoryItemStatus> [-EndStatus] <InventoryItemStatus> -AlarmAction <AlarmAction> [-Repeat] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AlarmAction Get-AlarmActionTrigger Get-AlarmDefinition New-AlarmAction Remove-AlarmAction Remove-AlarmActionTrigger Set-AlarmDefinition Detailed Description This cmdlet creates a new action trigger for the specified alarm action. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the start status for the alarm action. The valid values are Green, Yellow, and Red. Specifies the end status for the alarm action. The valid values are Green, Yellow, and Red. Specifies the alarm action for which you want to create an action trigger. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates whether you want the alarm action to repeat until the alarm is acknowledged. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter SwitchParameter
false false
false false
The newly created AlarmActionTrigger object Notes Examples -------------- Example 1 -------------G e t A l a r m D e f i n i t i o nN a m e" A l a r m 1 "|G e t A l a r m A c t i o n|N e w A l a r m A c t i o n T r i g g e rS t a r t S t a t u s' R e d 'E n d S t a t u s' Y e l l o w 'R e p e a t Creates an action trigger for all actions for the specified alarm definition.
New-CDDrive
Synopsis
This cmdlet creates a new virtual CD drive. Syntax New-CDDrive [-IsoPath <String>] [-HostDevice <String>] [-StartConnected] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CDDrive Remove-CDDrive Set-CDDrive Detailed Description This cmdlet creates a new virtual CD drive for each of the provided virtual machines. If an ISO location is provided, sets the CD to point to the ISO. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machine to which the new virtual CD drive belongs. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the path to the CD drive on the virtual machine host that backs the virtual CD drive. Do not set this parameter if the
true false
HostDevice
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
118/287
7/8/13
IsoPath String
Server
VIServer[]
false
false
SwitchParameter SwitchParameter
false false
false false
The one or more newly created CDDrive objects Notes Examples -------------- Example 1 -------------N e w C D D r i v eV M$ v mI S O P a t h" P a t h _ t o _ I S O \ t e s t . i s o " Creates a CD drive on the specified virtual machine and attach an ISO image to it.
New-CIAccessControlRule
Synopsis
This cmdlet creates a new access control rule. Syntax New-CIAccessControlRule [-AccessLevel] <AccessLevel> -Entity <AccessControlledEntity> [-User] <CIObject> [-Server <CIServer[]>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] New-CIAccessControlRule [-AccessLevel] <AccessLevel> -Entity <AccessControlledEntity> -EveryoneInOrg [-Server <CIServer[]>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIAccessControlRule Set-CIAccessControlRule Remove-CIAccessControlRule Detailed Description This cmdlet creates a new access control rule. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AccessLevel
AccessLevel
Specifies the access level for the access control rule that you want to create. This parameter accepts Read, ReadWrite, and FullControl values. Specifies the cloud users for whom the access control rule applies. This parameter accepts CIUser and Org objects. When you pass an Org object to this parameter, the access control rule applies for everyone in the organization. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the entity for which you want to create the access control rule. This parameter accepts vApp and Catalog objects. Indicates that the access control rule applies for everyone in the organization of the entity. Indicates that you want to overwrite any existing access control rules for the specified entity and cloud user. This parameter is only applicable when the User parameter is specified. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
User
CIObject
true
false
Confirm
SwitchParameter
false
false
Entity
AccessControlledEntity
true
true (ByValue)
EveryoneInOrg Force
SwitchParameter SwitchParameter
true false
false false
Server
CIServer[]
false
false
SwitchParameter
false
false
The newly created CIAccessControlRule object Notes Examples -------------- Example 1 -------------N e w C I A c c e s s C o n t r o l R u l eE n t i t y' M y V A p p 'U s e r' M y U s e r 'A c c e s s L e v e l" F u l l C o n t r o l " Creates a new access control rule for the specified vApp. The access control rule provides the specified user with full control access privileges for the vApp. -------------- Example 2 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
119/287
7/8/13
N e w C I A c c e s s C o n t r o l R u l eE n t i t y' M y C a t a l o g 'E v e r y o n e I n O r gA c c e s s L e v e l" R e a d " Creates a new access control rule for the specified catalog. The access control rule provides all users in the organization with read only privileges for the catalog.
New-CIVApp
Synopsis
This cmdlet creates a new vApp. Syntax New-CIVApp [-Name] <String> [-Description <String>] [-OrgVdc <OrgVdc>] [-RunAsync] [-RuntimeLease <TimeSpan>] [-Server <CIServer[]>] [-StorageLease <TimeSpan>] -VAppTemplate <CIVAppTemplate> [-WhatIf] [-Confirm] [<CommonParameters>] New-CIVApp [-Name] <String> [-Description <String>] [-OrgVdc <OrgVdc>] [-RunAsync] [-RuntimeLease <TimeSpan>] [-Server <CIServer[]>] [-StorageLease <TimeSpan>] -VApp <CIVApp> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp Import-CIVApp Remove-CIVApp Restart-CIVApp Set-CIVApp Start-CIVapp Stop-CIVApp Suspend-CIVapp Detailed Description This cmdlet creates a new vApp. You can clone an existing vApp or create the vApp from a vApp template. By default, the state of the vApp is Powered Off and the vApp is not deployed. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Confirm
String SwitchParameter
Specifies a name for the vApp you want to create. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the vApp you want to create. Specifies the organization virtual datacenter (vDC) where you want to store the new vApp.
true false
false false
Description OrgVdc
String OrgVdc
false false
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the maximum running time for the vApp before vCloud Director stops it automatically. To specify that the lease is unlimited, pass $null. When creating a vApp from a vApp template, not specifying this parameter automatically applies the default organization settings. When cloning a vApp, not specifying this parameter automatically applies the source vApp settings. 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. Specifies the maximum amount of time for the vApp to remain stopped before vCloud Director automatically marks it as expired, or deletes it, depending on the organization policy. To specify that the lease is unlimited, pass $null. When creating a vApp from a vApp template, not specifying this parameter automatically applies the default organization settings. When cloning a vApp, not specifying this parameter automatically applies the source vApp settings. Specifies the vApp you want to clone. Specifies the vApp template from which you want to create the new vApp. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
RuntimeLease
TimeSpan
false
false
Server
CIServer[]
false
false
StorageLease
TimeSpan
false
false
The newly created CIVApp object Notes Examples -------------- Example 1 -------------$ m y V A p p=G e t C I V A p pN a m e' M y S o u r c e V A p p ' N e w C I V A p pN a m e' M y C l o n e d V A p p 'D e s c r i p t i o n" T h i si sm yc l o n e dv A p p "V A p p$ m y V A p p Creates a new vApp by cloning the specified vApp. -------------- Example 2 -------------$ m y T e m p l a t e=G e t C I V A p p T e m p l a t eN a m e' M y S o u r c e T e m p l a t e '
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
120/287
7/8/13
$ m y O r g V d c=G e t O r g V d cN a m e' M y O r g V d c ' N e w C I V A p pN a m e' M y N e w V A p p 'D e s c r i p t i o n" T h i sv A p pi sc r e a t e df r o mt h ev A p pt e m p l a t en a m e dM y S o u r c e T e m p l a t e . "O r g V d c$ m y O r g V d cV A p p T e m p l a t e$ m y T e m p l a t e Creates a new vApp from the specified vApp template and stores it in the specified organization vDC.
New-CIVAppNetwork
Synopsis
This cmdlet creates a new vApp network. Syntax New-CIVAppNetwork -Direct -ParentOrgNetwork <OrgNetwork> -VApp <CIVApp> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-CIVAppNetwork [-DisableFirewall] [-ParentOrgNetwork <OrgNetwork>] -VApp <CIVApp> [-RunAsync] [-Server <CIServer[]>] -Routed [-Description <String>] [DnsSuffix <String>] -Gateway <IPAddress> -Name <String> -Netmask <IPAddress> [-PrimaryDns <IPAddress>] [-SecondaryDns <IPAddress>] [-StaticIPPool <IPRangeList>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVAppNetwork Remove-CIVAppNetwork Set-CIVAppNetwork Detailed Description This cmdlet * To create * To create * To create creates a new vApp network. a direct vApp network, specify the Direct parameter. a routed vApp network, specify the Routed parameter. an isolated vApp network, specify the Routed parameter but do not specify the ParentOrgNetwork parameter.
Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the vApp network that you want to create. Indicates that you want to create a vApp network that is directly connected to a parent organization network. When the Direct parameter is specified, you cannot specify the Routed parameter. Indicates that you want to create a vApp network with a disabled firewall service. By default, when the Routed parameter is specified, the vApp network is created with an enabled firewall service. Specifies a DNS suffix for the vApp network that you want to create. Specifies the default gateway for the vApp network that you want to create. Specifies a name for the vApp network that you want to create. Specifies a network mask for the vApp network that you want to create. Specifies the parent organization network to which the vApp network connects. Do not specify this parameter if you want to create an isolated vApp network. Specifies a primary DNS for the vApp network that you want to create. Indicates that you want to create a routed network. To create an isolated network, specify the Routed parameter but do not specify the ParentOrgParameter. When the Routed parameter is specified, you cannot specify the Direct parameter. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies a secondary DNS for the vApp network you want to create. 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. Specifies a range of static IP addresses for the vApp network to allocate to virtual machines. For example, "192.168.10.0 192.168.10.50, 192.168.10.100 - 192.168.10.150". Specifies the vApp for which you want to create a vApp network. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Description Direct
String SwitchParameter
false true
false false
DisableFirewall
SwitchParameter
false
false
PrimaryDns Routed
IPAddress SwitchParameter
false true
false false
RunAsync
SwitchParameter
false
false
SecondaryDns Server
IPAddress CIServer[]
false false
false false
StaticIPPool
IPRangeList
false
false
CIVApp SwitchParameter
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
121/287
7/8/13
-------------- Example 1 --------------
$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' $ p a r e n t O r g N e t w o r k=G e t O r g N e t w o r kN a m e' M y P a r e n t O r g a n i z a t i o n N e t w o r k ' N e w C I V A p p N e t w o r kP a r e n t O r g N e t w o r k$ p a r e n t O r g N e t w o r kV A p p$ m y V A p pR o u t e dD e s c r i p t i o n' T h i si sm yr o u t e dn e t w o r k . 'D n s S u f f i x' m y d o m a i n . c o m 'G a t e w a y' 1 9 2 . Creates a new routed vApp network with the specified configuration. -------------- Example 2 --------------
$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' N e w C I V A p p N e t w o r kP a r e n t O r g N e t w o r k$ n u l lV A p p$ m y V A p pR o u t e dD e s c r i p t i o n' T h i si sm yi s o l a t e dn e t w o r k . 'D n s S u f f i x' m y d o m a i n . c o m 'G a t e w a y' 1 9 2 . 1 6 8 . 3 . 3 'Createsa new isolated vApp network with the specified configuration. -------------- Example 3 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' $ p a r e n t O r g N e t w o r k=G e t O r g N e t w o r kN a m e' M y P a r e n t O r g a n i z a t i o n N e t w o r k ' N e w C I V A p p N e t w o r kP a r e n t O r g N e t w o r k$ p a r e n t O r g N e t w o r kV A p p$ m y V A p p? D i r e c t Creates a new direct vApp network.
New-CIVAppTemplate
Synopsis
This cmdlet creates a new vApp template. Syntax New-CIVAppTemplate [-Name] <String> [-VApp] <CIVApp> [[-OrgVdc] <OrgVdc>] [-Catalog <Catalog>] [-Description <String>] [-RunAsync] [-CustomizeOnInstantiate] [-Server <CIServer[]>] [-StorageLease <TimeSpan>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVAppTemplate Import-CIVAppTemplate Remove-CIVAppTemplate Set-CIVAppTemplate Detailed Description This cmdlet creates a new vApp template from the specified vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the vApp template you want to create. Specifies the vApp from which you want to create the new vApp template. Specifies the organization virtual datacenter (vDC) where you want to store the new vApp template. Specifies the catalog to which you want to add the new vApp template. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that every vApp created from the template must be customized upon instantiation. Specifies a description for the vApp template you want to create. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Specifies the maximum amount of time for the vApp to remain stopped before vCloud Director automatically marks it as expired, or deletes it, depending on the organization policy. If you do not specify this parameter, the default storage lease setting of the organization is applied. To specify that the lease is unlimited, pass $null. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false true (ByValue) false false false OrgVdc of the specified vApp
Server
CIServer[]
false
false
StorageLease
TimeSpan
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
122/287
7/8/13
-------------- Example 1 --------------
G e t C I V A p p' M y V A p p '|N e w C I V A p p T e m p l a t eN a m e' M y V A p p T e m p l a t e 'O r g V d c' M y O r g V d c 'C a t a l o g' M y C a t a l o g 'D e s c r i p t i o n" M y T e m p l a t e D e s c r i p t i o n " Creates a new template from a cloud vApp, specifies name and description for the template, places it in the MyOrgVdc organization vDC, and shares it in the MyCatalog catalog. -------------- Example 2 -------------G e t C I V A p p' M y V A p p '|N e w C I V A p p T e m p l a t eN a m e' M y V A p p T e m p l a t e 'O r g V d c' M y O r g V d c 'C u s t o m i z e O n I n s t a n t i a t e Creates a new template from a cloud vApp, specifies name and destination organization vDC for the template, and enables customization upon instantiation when creating a vApp from the template. -------------- Example 3 -------------G e t C I V A p p' M y V A p p '|N e w C I V A p p T e m p l a t eN a m e' M y V A p p T e m p l a t e 'O r g V d c' M y O r g V d c 'S t o r a g e L e a s e3 . 0 4 : 3 0 : 3 0R u n A s y n c Asynchronously creates a template from a cloud vApp, specifies name and destination organization vDC for the template, and sets the storage lease to 3 days, 4 hours, 30 minutes and 30 seconds.
New-Cluster
Synopsis
This cmdlet creates a new cluster. Syntax New-Cluster [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-Name] <String> Location <VIContainer> [-HAEnabled] [-HAAdmissionControlEnabled] [-HAFailoverLevel <Int32>] [-DrsEnabled] [-DrsMode <DrsMode>] [-DrsAutomationLevel <DrsAutomationLevel>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Cluster Move-Cluster Remove-Cluster Set-Cluster Detailed Description This cmdlet creates a new cluster with the provided inputs, in the location that is specified by the Location parameter. HAEnabled is automatically set to $true if some of the HA settings, HAAdmissionControlEnabled, HAFailoverLevel, HARestartPriority, HAIsolationResponse, are specified . DrsEnabled is automatically set to $true if some of the DRS settings, DrsAutomationLevel, DrsMode, are specified . Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Confirm
String SwitchParameter
Specifies the name of the new cluster. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a DRS (Distributed Resource Scheduler) automation level. The valid values are FullyAutomated, Manual, and PartiallyAutomated. Indicates that VMware DRS (Distributed Resource Scheduler) is enabled. This parameter is deprecated and scheduled for removal. Use the DrsAutomationLevel parameter instead. Specifies a DRS (Distributed Resource Scheduler) mode. The valid values are FullyAutomated, Manual, and PartiallyAutomated.
true false
DrsAutomationLevel
DrsAutomationLevel
false
false
DrsEnabled DrsMode
SwitchParameter DrsMode
false false
false false
HAAdmissionControlEnabled
SwitchParameter
Indicates that virtual machines cannot be powered on if they violate availability constraints. Indicates that VMware high availability is enabled. Specifies a configured failover level. This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines. The valid values range from 1 to 4. Indicates that the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. The valid values are PowerOff and DoNothing. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies the cluster HA restart priority. The valid values are Disabled, Low, Medium, and High. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future
false
false
HAEnabled HAFailoverLevel
SwitchParameter Int32
false false
false false
HAIsolationResponse
HAIsolationResponse
false
false
HARestartPriority
HARestartPriority
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
123/287
7/8/13
Location VIContainer
Server
VIServer[]
false
false
VMSwapfilePolicy
VMSwapfilePolicy
false
false
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type The newly created Cluster object Notes Examples -------------- Example 1 -------------$ e n g i n e e r i n g F o l d e r=G e t F o l d e rE n g i n e e r i n g N e w C l u s t e rL o c a t i o nF o l d e rN a m eC l u s t e rD R S E n a b l e dD R S M o d eF u l l y A u t o m a t e d Creates a new cluster named Cluster in the Folder folder.
New-CustomAttribute
Synopsis
This cmdlet creates a new custom attribute. Syntax New-CustomAttribute [-Name] <String> [[-TargetType] <CustomAttributeTargetType[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CustomAttribute Remove-CustomAttribute Set-CustomAttribute Get-Annotation Set-Annotation Detailed Description This cmdlet creates a new custom attribute. A custom attribute is a user-defined description field of one or more vCenter Server objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name TargetType
String CustomAttributeTargetType[]
Specifies a name for the new custom attribute. Specifies the type of the objects to which the new custom attribute applies. The valid values are VirtualMachine, ResourcePool, Folder, VMHost, Cluster, Datacenter, and $null. If the value is $null the custom attribute is global and applies to all target types. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
false false
Confirm
SwitchParameter
false
false
$true
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
124/287
7/8/13
-------------- Example 1 --------------
N e w C u s t o m A t t r i b u t eN a m e" C o m p a n y N a m e "T a r g e t T y p eV M H o s t ,V i r t u a l M a c h i n e Creates a new custom attribute named CompanyName for the virtual machines and hosts on the server.
New-CustomField
Synopsis
This cmdlet creates a new custom field for a particular inventory item type. Syntax New-CustomField [-Entity] <InventoryItem> [-Name] <String> [[-Value] <String>] [-Global] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Remove-CustomField Set-CustomField Detailed Description This cmdlet is deprecated and scheduled for removal. This cmdlet creates a custom field for the object types that are provided by the Entity parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the inventory objects for which you want to create a new custom field. Specifies the name of the new custom field. Specifies the value of the new custom field. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the new custom field applies to all types of objects. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Global WhatIf
SwitchParameter SwitchParameter
false false
false false
Return Type The specified InventoryItem object Notes Examples -------------- Example 1 -------------N e w C u s t o m F i e l dE n t i t yV MN a m eC P U M a x L o a dV a l u e3 0 0 Creates a custom field named CPUMaxLoad for the VM virtual machine, and sets it initial value to 300. The command returns the virtual machine VM, to which the new custom field belongs.
New-Datacenter
Synopsis
This cmdlet creates a new datacenter. Syntax New-Datacenter [-Location] <VIContainer> [-Name] <String> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Datacenter Move-Datacenter Remove-Datacenter Set-Datacenter Detailed Description This cmdlet creates a new datacenter in the location that is specified by the Location parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new datacenter. Specifies the location where you want to create the new datacenter. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
125/287
7/8/13
WhatIf Return Type The newly created Datacenter object Notes Examples -------------- Example 1 -------------SwitchParameter
$ f o l d e r=G e t F o l d e rN o R e c u r s i o n|N e w F o l d e rN a m eF o l d e r N e w D a t a c e n t e rL o c a t i o n$ f o l d e rN a m eD a t a c e n t e r|f l Gets the inventory root folder and create a new folder called Folder in it. Creates a new datacenter called Datacenter in the Folder folder. The result is pipelined to the fl command to retrieve a flat view of the new datacenter properties.
New-Datastore
Synopsis
This cmdlet creates a new datastore. Syntax New-Datastore [-Server <VIServer[]>] [-VMHost] <VMHost[]> [-Name] <String> -Path <String> [-Vmfs] [-BlockSizeMB <Int32>] [-FileSystemVersion <String>] [-WhatIf] [-Confirm] [<CommonParameters>] New-Datastore [-Server <VIServer[]>] [-VMHost] <VMHost[]> [-Name] <String> -Path <String> [-Nfs] -NfsHost <String> [-ReadOnly] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Datastore Remove-Datastore Set-Datastore Move-Datastore Detailed Description This cmdlet creates a new datastore based on the provided parameters. The following characters cannot be used in a datastore name: slash (/), backslash (\), and percent (%). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a host where you want to create the new datastore. Specifies a name for the new datastore. Specifies the maximum file size of VMFS in megabytes (MB). If no value is given, the maximum file size for the current system platform is used. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the file system you want to use on the new datastore. Indicates that you want to create an NFS datastore. Specifies the NFS host where you want to create the new datastore. If you want to create an NFS datastore, specify the remote path of the NFS mount point. If you want to create a VMFS datastore, specify the canonical name of the SCSI logical unit that will contain new VMFS datastores. Indicates that the access mode for the mount point is ReadOnly. The default access mode is ReadWrite. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Indicates that you want to create a VMFS datastore. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
ReadOnly Server
SwitchParameter VIServer[]
false false
false false
SwitchParameter SwitchParameter
false false
false false
The one or more newly created Datastore objects Notes Examples -------------- Example 1 -------------N e w D a t a s t o r eV M H o s t$ v m h o s tN a m eD a t a s t o r eP a t h$ s c s i L u n . C a n o n i c a l N a m eV m f sF i l e S y s t e m V e r s i o n3 Creates a VMFS datastore by specifying the file system type. -------------- Example 2 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
126/287
7/8/13
N e w D a t a s t o r eN f sV M H o s t1 0 . 2 3 . 1 1 2 . 6 0N a m eN F S D a t a s t o r eP a t h/ m y n f sN f s H o s t1 0 . 2 3 . 8 4 . 7 3 Creates a NFS datastore. -------------- Example 3 -------------$ v m h o s t 1 ,$ v m h o s t 2|N e w D a t a s t o r eN f sN a m eN F S 1P a t h" / m n t / n f s 1 / n f s 1 1 / t e s t 1 "N f s H o s t1 0 . 2 3 . 1 1 3 . 5 5R e a d O n l y Creates a read-only NFS datastore across multiple virtual machine hosts.
New-DatastoreCluster
Synopsis
This cmdlet creates a new datastore cluster. Syntax New-DatastoreCluster [-Name] <String> -Location <VIContainer> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Unknown Get-DatastoreCluster Set-DatastoreCluster Remove-DatastoreCluster Detailed Description This cmdlet creates a new datastore cluster. By default, Storage DRS is disabled. To enable Storage DRS, run Set-DatastoreCluster. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Confirm
String SwitchParameter
Specifies a name for the datastore cluster that you want to create. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a container object (Datacenter or Folder) where you want to place the new datastore cluster. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
false false
Location Server
VIContainer VIServer[]
true false
SwitchParameter
false
false
The newly created DatastoreCluster object Notes Examples -------------- Example 1 -------------N e w D a t a s t o r e C l u s t e rN a m e' M y D a t a s t o r e C l u s t e r 'L o c a t i o n' M y D a t a c e n t e r ' Creates a new datastore cluster on the specified datacenter.
New-DeployRule
Synopsis
Creates a new rule. Syntax New-DeployRule [-Name] <String> -Pattern <String[]> -Item <VIObjectCore[]> [<CommonParameters>] New-DeployRule [-Name] <String> -AllHosts -Item <VIObjectCore[]> [<CommonParameters>] Related Commands Add-DeployRule Copy-DeployRule Set-DeployRule Detailed Description Creates a new rule with the specified items and patterns. The items specify what should be associated with an ESXi host and the patterns specify which ESXi hosts the rule applies to. A rule on its own does not affect anything. The rule must first be added to the working rule set in order to place it in context with the other rules in the system. Since multiple rules can match a single host, the rule set is used to rank the rules. Items in higher ranking rules are preferred over items in lower ranking rules. Only one item of a particular type will be associated with the host. For example, if two rules in a rule set have host profiles, only the profile in the higher ranking rule will be used. Alternatively, if one rule has a host profile and the other rule has an image profile, both rules will have an affect. You must have the "AutoDeploy.Rule.Create" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
127/287
7/8/13
Name AllHosts String SwitchParameter Name of the new rule.
Specify AllHosts to apply the new rule to all hosts managed by VMware Auto Deploy. Hosts are managed by VMware Auto Deploy if the DHCP server directs them to the Auto Deploy TFTP configuration file. Item the rule should apply to the hosts. Can be an image profile, a host profile, or a folder or cluster on the vCenter Server system to add the host to. Set of hosts the new rule should apply to. Pattern strings use the following syntax: <attr>==<value> Adds a pattern that exactly matches the specified value against the specified attribute. Use this syntax if you need to match a string that contains a comma. <attr>=<Val1 >[,val2,... ,valN] Adds a pattern that matches against the comma-separated list of values. Supported value types are: string Exact string match <ip1>-<ip2> Range of IPv4 addresses.
Item
VIObjectCore[]
true
true (ByValue)
Pattern
String[]
true
false
Return Type VMware.DeployAutomation.Types.DeployRule Notes Examples -------------- Example 1 -------------C : \ P S >$ r u l e=N e w D e p l o y R u l eN a m e" d e f a u l t F o l d e r "I t e m" N e w H o s t s "A l l H o s t s Create a rule that places all hosts in the folder named "NewHosts". -------------- Example 2 -------------C : \ P S >$ i m g=G e t E S X I m a g e P r o f i l eN a m e" M yE S X i5 . 0 " C : \ P S >$ r u l e=N e w D e p l o y R u l eN a m e" t e s t r u l e "I t e m$ i m gP a t t e r n " v e n d o r = A c m e " , " v e n d o r = = V M w a r e ,I n c . " , " i p v 4 = 1 9 2 . 1 6 8 . 1 . 1 0 1 9 2 . 1 6 8 . 1 . 2 0 " Create a rule that assigns the image profile named "My ESXi 5.0" to hosts that match a set of vendors and are in a particular IPv4 range.
New-DrsRule
Synopsis
This cmdlet creates a new DRS rule. Syntax New-DrsRule [-Name] <String> [-Cluster] <Cluster[]> [-Enabled [<Boolean>]] -KeepTogether [<Boolean>] -VM <VirtualMachine[]> [-RunAsync] [-Server <VIServer[]>] [WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-DrsRule Remove-DrsRule Set-DrsRule Detailed Description This cmdlet creates a new DRS rule. Each rule defines the virtual machines that can run on the same host (affinity rule) or must run on different hosts (anti-affinity rule). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new DRS rule. Specifies the clusters for which the new DRS rule applies. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. If the value of this parameter is $true, the new DRS rule is enabled for the specified clusters. If the value is $false, it is disabled. If the value of this parameter is $true, the new DRS rule is an affinity rule. If the value is $false, the DRS rule is an anti-affinity rule. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the virtual machines that are referenced by the new DRS rule. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Enabled KeepTogether
Boolean Boolean
false true
false false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
true (ByValue)
VM WhatIf
VirtualMachine[] SwitchParameter
true false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
128/287
7/8/13
Return Type The newly created DrsVMAffinityRule object Notes Examples -------------- Example 1 --------------
N e w D r s R u l eC l u s t e r$ c l u s t e rN a m ea n t i A f f i n i t y R u l e 1K e e p T o g e t h e r$ f a l s eV M$ a n t i A f f i n i t y V M s Creates a new DRS rule for the cluster saved in the $cluster variable with the specified parameters.
New-EsxImageProfile
Synopsis
Syntax New-EsxImageProfile -NewProfile [-Name] <String> [-Vendor] <String> -SoftwarePackage <SoftwarePackage[]> [-AcceptanceLevel <AcceptanceLevels>] [-Description <String>] [-ReadOnly] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] New-EsxImageProfile -CloneProfile <ImageProfile> [-Name] <String> [-Vendor] <String> -SoftwarePackage <SoftwarePackage[]> [-AcceptanceLevel <AcceptanceLevels>] [-Description <String>] [-ReadOnly] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description Creates an image profile on the client machine, either by cloning or from scratch. Image Bulder performs the complete set of image profile validation tests on the new image profile and displays all errors found during validation. You pass the new image profile into the Set-EsxImageProfile, Export-EsxImageProfile, AddEsxSoftwarePackage, and Remove-EsxSoftwarePackage cmdlets in the -ImageProfile parameter as follows: *Use the image profile name, as specified in the -Name parameter. *Pipe the output of New-EsxImageProfile to the commandlet. The resulting image profile will be preserved for the current session only. To preserve an image profile across sessions, use the Export-EsxImageProfile cmdlet. The created image profile does not have to be assigned to a variable; it is preserved in memory automatically and will be listed with the Get-EsxImageProfile cmdlet. Specify either -NewProfile or -CloneProfile, but not both. If you want to edit an image profile published in a depot, you must clone the image profile before you edit it. When you clone an image profile, specify a Name parameter for the clone. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
(prompt) A short string that together with Creator uniquely describes the profile. Required to create a profile. (prompt) A short string describing the organization that created the profile. Required to create a profile. Optional. Specifies the minimum acceptance level required for VIBs in the image profile. Defaults to "PartnerSupported". Must be one of the following values: *VMwareCertified *VMwareAccepted *PartnerSupported *CommunitySupported
CloneProfile
ImageProfile
Specifies an image profile to clone from. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or from the Name property of any ImageProfile object *An ImageProfile object You must specify a -Name parameter that differs from the name of the original you create the clone from. You can also specify the -Vendor parameter to change the Vendor field of the clone.
true
SwitchParameter String SwitchParameter SwitchParameter Optional. A long string describing the contents or purpose of the image profile. Specify -NewProfile to create a new profile (as opposed to cloning an existing one. Optional. Makes the image profile read only. If you make an image profile read only when you create it, you cannot make it modifyable later. (Pipeline input) One or more VIB software packages that the image profile should contain. Required to create a profile. The value can take one of the following forms: *Name of a VIB, as displayed in the Name column of Get-
SoftwarePackage
SoftwarePackage[]
true
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
129/287
7/8/13
---------- Example 1 ---------N e w E s x I m a g e P r o f i l eC l o n e P r o f i l e" E S X 5 . 0 2 3 4 5 6 7 s t a n d a r d "\ N a m e" M yc u s t o mp r o f i l e "A c c e p t a n c e L e v e lC o m m u n i t y S u p p o r t e d Clone an image profile, give it a new name, and change the acceptance level. (NOTE: The '\' is used to continue the second line of input; either press ENTER after \ or enter everything on one line without the '\'). ---------- Example 2 ---------$ i p=N e w E s x I m a g e P r o f i l eN e w P r o f i l eN a m e" B u i l tf r o ms c r a t c h ! "V e n d o r" N o t V m w a r e "\ S o f t w a r e P a c k a g ee s x b a s e , e s x t b o o t , m i s c d r i v e r s Create an image profile from scratch, assigning the result to a variable. Software packages are specified by name. ---------- Example 3 ---------G e t E s x S o f t w a r e P a c k a g eN a m ee s x b a s e , e s x t b o o t , m i s c d r i v e r s| \ N e w E s x I m a g e P r o f i l eN e w P r o f i l eN a m e" B u i l tf r o ms c r a t c h ! "V e n d o r" N o t V m w a r e " Create an image profile from scratch, passing in software packages via pipeline
New-FloppyDrive
Synopsis
This cmdlet creates a new virtual floppy drive. Syntax New-FloppyDrive [-FloppyImagePath <String>] [-NewFloppyImagePath <String>] [-HostDevice <String>] [-StartConnected] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-FloppyDrive Remove-FloppyDrive Set-FloppyDrive Detailed Description This cmdlet creates a new virtual floppy drive for each of the provided virtual machines. If a floppy image path is provided, sets the floppy drive to point to the image. If both the FloppyImagePath and HostDevice parameters are specified, an error is generated. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines to which you want to attach the new virtual floppy drive. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the datastore path to the floppy image file backing the virtual floppy drive. Do not use this parameter together with the HostDevice parameter. Specifies the path to the floppy drive on the host which will back this virtual floppy drive. Do not use this parameter together with the FloppyImagePath parameter. Specifies a new datastore path to a floppy image file backing the virtual floppy drive. Do not use this parameter together with the HostDevice parameter. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter,
true false
FloppyImagePath
String
false
false
HostDevice
String
false
false
NewFloppyImagePath
String
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
130/287
7/8/13
StartConnected WhatIf
SwitchParameter SwitchParameter
Indicates that the virtual floppy drive starts connected when its associated virtual machine powers on. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
false false
Return Type The one or more newly created FloppyDrive objects Notes Examples -------------- Example 1 -------------N e w F l o p p y D r i v eV MV MH o s t D e v i c e' / d e v / f d 0 'S t a r t C o n n e c t e d Creates a floppy drive backed by the client device /dev/fd0 and sets it to start connected when the virtual machine is powered on.
New-Folder
Synopsis
This cmdlet creates a new folder on a vCenter Server system. Syntax New-Folder [-Name] <String> [-Location] <VIContainer> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Folder Move-Folder Remove-Folder Set-Folder Detailed Description This cmdlet creates a new folder on the specified location. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Location
String VIContainer
Specifies a name for the new folder. Specifies a container object (folder, datacenter, or cluster) where you want to place the new folder. If a datacenter is specified for the Location parameter, then the folder is created in its "hostFolder" folder and contains hosts and clusters. The "hostFolder" is a system folder and is guaranteed to exist. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true true
Confirm
SwitchParameter
false
false
$true
Server
VIServer[]
false
false
SwitchParameter
false
false
The newly created Folder object Notes Examples -------------- Example 1 -------------N e w F o l d e rN a m e" F o l d e r 1 "L o c a t i o n( G e t D a t a c e n t e r ) [ 0 ] Creates a new folder in a datacenter root. -------------- Example 2 -------------N e w F o l d e rN a m e" F o l d e r 1 "L o c a t i o n( G e t C l u s t e r ) [ 0 ] Creates a new folder in a cluster root. -------------- Example 3 -------------G e t F o l d e r|S e l e c tF i r s t1|N e w F o l d e rN a m e" F o l d e r 2 " Creates a nested folder by using a pipeline command.
7/8/13
New-HardDisk
Synopsis
This cmdlet creates a new hard disk on the specified location. Syntax New-HardDisk [-AdvancedOption <AdvancedOption[]>] [[-Persistence] <String>] [-Controller <ScsiController>] [[-DiskType] <DiskType>] [-CapacityKB <Int64>] [CapacityGB <Decimal>] [-Split] [-ThinProvisioned] [-StorageFormat <VirtualDiskStorageFormat>] [-DeviceName <String>] [-Datastore <StorageResource>] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-HardDisk [[-Persistence] <String>] [-Controller <ScsiController>] -DiskPath <String> [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Copy-HardDisk Get-HardDisk Remove-HardDisk Set-HardDisk Move-HardDisk Detailed Description This cmdlet creates a new hard disk on the specified virtual machine or datastore. When a new virtual disk with raw disk mapping (RDM) backing is created, the compatibility mode of "virtual" or "physical" must be specified using the DiskType parameter. In "virtual" compatibility mode, the disk can use the specified disk modes. In "physical" compatibility mode, the disk modes are ignored and commands are passed directly to the backing Logical Unit Number (LUN). If "flat" mode is set by the DiskType parameter, the virtual disk backing is pre-allocated. If the hard disk is attached to no virtual machine, the value of the DiskType parameter might be Unknown, which means that no type is specified. Use the Persistence parameter to make the disk Persistent (changes are immediately and permanently written to the disk), Nonpersistent (changes to the disk are discarded when you power off or reset the virtual machine), IndependentPersistent, IndependentNonPersistent, or Undoable. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Persistence
VirtualMachine[] String
Specifies the virtual machines to which you want to add the new disk. Specifies the disk persistence mode. The valid values are Persistent, NonPersistent, IndependentPersistent, IndependentNonPersistent, and Undoable. This parameter is supported only when the disk type is set to ?rawVirtual? or ?flat?. The 'NonPersistent' and 'Undoable' values are deprecated and scheduled for removal. Their usage is not recommended because they do not work with snapshots and are not supported on ESX 3.5 and later. Specifies the type of file backing you want to use. The valid values are rawVirtual, rawPhysical, flat, and unknown. If the hard disk is attached to no virtual machine, the value of the DiskType parameter might be Unknown, which means that no type is specified. Specifies advanced options for creating hard disks. Accepts only SdrsVMDiskAntiAffinityRule objects. You can define an anti-affinity SDRS rule for the disk by specifying a SdrsVMDiskAntiAffinityRule object to the AdvancedOption parameter and this will override any existing SdrsVMDiskAntiAffinityRule for the virtual machine. The SdrsVMDiskAntiAffinityRule defines a Storage DRS intra-VM anti-affinity rule (vm disk anti-affinity rule). It is only applicable when creating a virtual machine or hard disk on a datastore cluster. An instance of the object is created by invoking its constructor. There are two constructors - "public SdrsVMDiskAntiAffinityRule(param string[] diskIdentifier)" and "public SdrsVMDiskAntiAffinityRule(param HardDisk[] disk)". For the first constructor, "diskIdentifier" can be either the disk key or the index of the disk in the disk array. The specified disks (and the disk to which the rule is applied) are placed in an anti-affinity rule on a DatastoreCluster. Only one such rule is supported per a virtual machine. You can pass the instance to the AdvancedOption parameter of the New-VM or NewHardDisk cmdlets. The SDRS functionality is experimental.
true false
DiskType
DiskType
false
false
AdvancedOption
AdvancedOption[]
false
false
CapacityGB
Decimal
Specifies the capacity of the new virtual disk in gigabytes (GB). You need to specify this parameter when you create hard disks of type Flat. This parameter is obsolete. Use CapacityGB instead. Specifies the capacity of the new virtual disk in kilobytes (KB). You need to specify this parameter when you create hard disks of type Flat. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a SCSI controller to which you want to attach the new hard disk. Specifies the datastore where you want to place the new hard disk. If a DatastoreCluster object is passed to the Datastore parameter, the hard disk is added to the DatastoreCluster in an automated SDRS mode. You can define an anti-affinity SDRS rule for the disk by specifying an SdrsVMDiskAntiAffinityRule object to the AdvancedOption parameter and this will override any existing SdrsVMDiskAntiAffinityRule for the virtual machine. Specifies the host-specific device the LUN is being accessed through. If the target LUN is not available on the host then it is empty. For example, this could happen if it has been masked out accidentally. Only supported when DiskType is set to ?rawVirtual? or ? rawPhysical?. The device name is visible in the vSphere
false
false
CapacityKB
Int64
false
false
Confirm
SwitchParameter
false
false
$true
Controller Datastore
ScsiController StorageResource
false false
false false
DeviceName
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
132/287
7/8/13
DiskPath Server
String VIServer[]
Specifies the path to the hard disk. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. This parameter is deprecated and scheduled for removal. Use the StorageFormat instead. Specifies the type of the virtual disk file - split or monolithic. If the value is $true, the virtual disk is stored in multiple files, each 2GB. If the value is $false, the virtual disk is stored in a single file. This parameter is supported only if the DiskType parameter is set to ? flat?. Specifies the storage format of the new hard disk. This parameter accepts Thin, Thick, and EagerZeroedThick values. This parameter is deprecated and scheduled for removal. Use the StorageFormat instead. Indicates to the underlying file system, that the virtual disk backing file should be allocated lazily (using thin provisioning). This parameter is only used for file systems that support configuring the provisioning policy on a per file basis, such as VMFS3. This parameter is supported only if the DiskType parameter is set to ? flat?. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
false false
Split
SwitchParameter
false
false
StorageFormat
VirtualDiskStorageFormat
false
false
ThinProvisioned
SwitchParameter
false
false
WhatIf
SwitchParameter
false
false
Return Type The one or more newly created HardDisk objects Notes Works only on ESX hosts. New-HardDisk cannot create undoable disks on powered-on virtual machines. On ESX versions later than 3.0, non-persistent and undoable disks are not s upported. Examples -------------- Example 1 -------------$ v m=G e t V MV M $ v m|N e w H a r d D i s kC a p a c i t y G B1 0 0P e r s i s t e n c ep e r s i s t e n t Adds to the VM virtual machine a new hard disk in a persistent mode with capacity of 100 GB. -------------- Example 2 -------------$ d e v i c e N a m e=( $ v m h o s t|G e t S c s i L u n|W h e r e{ $ _ . C a n o n i c a l N a m em a t c h" n a a " } ) [ 0 ] . C o n s o l e D e v i c e N a m e N e w H a r d D i s kV M$ v mD i s k T y p eR a w P h y s i c a lD e v i c e N a m e$ d e v i c e N a m e Obtains a valid device name for Raw Disk Mapping. Then the command creates a RDM hard disk for the specified virtual machine, with the obtained device name. -------------- Example 3 -------------N e w H a r d D i s kV M$ v mC a p a c i t y G B1 0 0P e r s i s t e n c eI n d e p e n d e n t N o n P e r s i s t e n t Creates a non-persistent hard disk with the specified capacity. -------------- Example 4 -------------N e w H a r d D i s kV M$ v mD i s k P a t h" [ s t o r a g e 1 ]O t h e r V M / O t h e r V M . v m d k " Attaches an available disk from a *.vmdk file. -------------- Example 5 -------------$ v m=G e t V MW e b S e r v e r V M $ d i s k=$ v m|G e t H a r d D i s k $ a n t i A f f i n i t y R u l e=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M D i s k A n t i A f f i n i t y R u l e '$ d i s k N e w H a r d D i s kV M$ v mA d v a n c e d O p t i o n$ a n t i A f f i n i t y R u l eC a p a c i t y G B4 0D a t a s t o r eD a t a s t o r e C l u s t e r 1 First retrieves the existing disk which will be part of the VMDK anti affinity rule. Then, creates an object describing the rule and creates the new hard disk.
New-IScsiHbaTarget
Synopsis
This cmdlet creates a new iSCSI HBA target. Syntax New-IScsiHbaTarget -IScsiHba <IScsiHba[]> [-Address] <String[]> [[-Port] <Int32>] [-Type <IScsiHbaTargetType>] [[-IScsiName] <String>] [-ChapType <ChapType>] [ChapName <String>] [-ChapPassword <String>] [-MutualChapEnabled [<Boolean>]] [-MutualChapName <String>] [-MutualChapPassword <String>] [-InheritChap
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
133/287
7/8/13
Related Commands Online version Get-IScsiHbaTarget Remove-IScsiHbaTarget Set-IScsiHbaTarget Get-VMHostHba Set-VMHostHba Detailed Description
This cmdlet creates a new iSCSI HBA target. The cmdlet also enables and configures the CHAP (Challenge Handshake Authentication Protocol) authentication settings of the new target. The Address parameter supports both IPv4 and v6 and also supports the string representations of these types. e.g. ?<address>:<port>?. The Port parameter is used only when the value of the Address parameter does not contain the port. The default port number is 3260. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the address of the new iSCSI HBA target. Specifies the TCP port of the target. Specifies the iSCSI name of the target. It can be specified only for Static targets. Specifies a CHAP authentication name for the new target. Specifies a CHAP authentication password for the new target. Specifies the type of the CHAP (Challenge Handshake Authentication Protocol) you want the new target to use. The valid values are Prohibited, Discouraged, Preferred, and Required. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the CHAP setting is inherited from the iSCSI HBA. Indicates that the Mutual CHAP setting is inherited from the iSCSI HBA. Specifies the iSCSI HBA for which you want to create the new target. Indicates that Mutual CHAP is enabled. Specifies a Mutual CHAP authentication name for the new target. Specifies a Mutual CHAP authentication password for the new target. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the type of the target. The valid values are Static and Send. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
false false true (ByValue) false false false false <initiator name>
Type WhatIf
IScsiHbaTargetType SwitchParameter
false false
false false
Send
Return Type The newly created IScsiHbaTarget object Notes CHAP configuration is supported only on vCenter Server/ESX 4.0 and later. Examples -------------- Example 1 -------------$ h b a=G e t V M H o s t|G e t V M H o s t H b aT y p ei S c s i N e w I S c s i H b a T a r g e tI S c s i H b a$ h b aA d d r e s s1 0 . 2 3 . 8 4 . 7 3 Creates a new target with IP address 10.23.84.73 on the specified iSCSI HBA device. -------------- Example 2 -------------G e t V M H o s t|G e t V M H o s t H b aT y p ei S c s i|N e w I S c s i H b a T a r g e tA d d r e s s" 1 0 . 2 3 . 8 4 . 7 3 "C h a p T y p eP r e f e r r e dC h a p N a m eu s e rC h a p P a s s w o r dp a s s Creates a new target on the provided iSCSI HBA device and configures the CHAP settings of the target.
New-NetworkAdapter
Synopsis
This cmdlet creates a new virtual network adapter. Syntax
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
134/287
7/8/13
New-NetworkAdapter [-MacAddress <String>] -NetworkName <String> [-StartConnected] [-WakeOnLan] [-Type <VirtualNetworkAdapterType>] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-NetworkAdapter [-MacAddress <String>] [-StartConnected] [-WakeOnLan] [-Type <VirtualNetworkAdapterType>] -PortId <String> -DistributedSwitch <DistributedSwitch> [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-NetworkAdapter [-MacAddress <String>] [-StartConnected] [-WakeOnLan] [-Type <VirtualNetworkAdapterType>] -Portgroup <VirtualPortGroupBase> [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-NetworkAdapter Remove-NetworkAdapter Set-NetworkAdapter Detailed Description This cmdlet creates a new virtual network adapter for each of the provided virtual machines and sets the optional properties if provided. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines to which you want to attach the new virtual network adapter. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a virtual switch to which you want to connect the network adapter. Specifies an optional MAC address for the new virtual network adapter. Specifies the name of the network to which you want to add the new virtual network adapter. Specifying a distributed port group name is obsolete. Use the Portgroup parameter instead. Specifies a standard or a distributed port group to which you want to connect the new network adapter. Specifies the port of the specified distributed switch to which you want to connect the network adapter. Use this parameter only if the DistributedSwitch parameter is specified. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the virtual network adapter starts connected when the virtual machine associated with it powers on. Specifies the type of the new network adapter. The valid types are e1000, Flexible, Vmxnet, EnhancedVmxnet, and Vmxnet3, and Unknown. If no value is given to the parameter, the new network adapter is of the type recommended by VMware for the given guest OS. Indicates that wake-on-LAN is enabled on the newly created virtual network adapter. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Portgroup
VirtualPortGroupBase
true
false
PortId
String
true
false
Server
VIServer[]
false
false
StartConnected
SwitchParameter
false
false
Type
VirtualNetworkAdapterType
false
false
WakeOnLan WhatIf
SwitchParameter SwitchParameter
false false
false false
Return Type The one or more newly created NetworkAdapter objects Notes There are two special cases concerning the behavior of New-NetworkAdapter: - If you are directly connected to a standalone ESX host (that is not manag ed by a vCenter Server), the MAC address of the newly created network adapt er is generated after the associated virtual machine is powered on for a fi rst time. - If you are directly connected to an ESX host that is managed by a vCenter Server, the MAC address of the newly created network adapter is generated with a delay of several seconds. Examples -------------- Example 1 -------------G e t V MV M|N e w N e t w o r k A d a p t e r N e t w o r k N a m e" V MN e t w o r k "M a c A d d r e s s' 0 0 : 5 0 : 5 6 : a 1 : 0 0 : 0 0 'W a k e O n L a nS t a r t C o n n e c t e dT y p eE n h a n c e d V m x n e t Create a virtual network adapter with the specified parameters. -------------- Example 2 -------------$ m y V m=G e t V MN a m eM y V M $ M y V D P o r t g r o u p=G e t V D P o r t g r o u pN a m eM y V D P o r t G r o u p N e w N e t w o r k A d a p t e rV M$ m y V MP o r t g r o u p$ M y V D P o r t g r o u p Adds a new network adapter to the specified virtual machine and connects it to the specified distributed port group. -------------- Example 3 -------------$ m y V M=G e t V MN a m eM y V M $ M y V D S w i t c h=G e t V D S w i t c hN a m eM y V D S w i t c h N e w N e t w o r k A d a p t e rV M$ m y V MD i s t r i b u t e d S w i t c h$ M y V D S w i t c hP o r t I d1 0 0 Adds a new network adapter to the specified virtual machine and connects it to the specified port on the specified vSphere distributed switch.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
135/287
7/8/13
New-Org
Synopsis
This cmdlet creates a new organization. Syntax New-Org -Name <String> -FullName <String> [-Description <String>] [-Server <CIServer>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Org Remove-Org Set-Org Detailed Description This cmdlet creates a new organization. By default, the new organization is enabled. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the organization that you want to create. Specifies a full name for the organization that you want to create. Specifies a unique name identifier for the organization that you want to create. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
SwitchParameter
false
false
The newly created Organization object Notes Examples -------------- Example 1 -------------$ m y O r g N a m e=" M y O r g " $ m y O r g a n i z a t i o n=N e w O r gN a m e$ m y O r g N a m eF u l l N a m e" M y O r g F u l l N a m e "D e s c r i p t i o n" M y O r g D e s c r i p t i o n " Creates a new organization with the specified full name and description.
New-OrgNetwork
Synopsis
This cmdlet creates a new organization network on a vCloud Director server. Syntax New-OrgNetwork -Name <String> [-Description <String>] -Direct -Org <Org> -ExternalNetwork <ExternalNetwork> [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [Confirm] [<CommonParameters>] New-OrgNetwork -Name <String> [-Description <String>] -Internal -Org <Org> -NetworkPool <NetworkPool> -Gateway <IPAddress> -Netmask <IPAddress> [DnsSuffix <String>] [-PrimaryDns <IPAddress>] [-SecondaryDns <IPAddress>] [-StaticIPPool <IPRangeList>] [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] New-OrgNetwork -Name <String> [-Description <String>] -Routed -Org <Org> -ExternalNetwork <ExternalNetwork> -NetworkPool <NetworkPool> -Gateway <IPAddress> -Netmask <IPAddress> [-DnsSuffix <String>] [-PrimaryDns <IPAddress>] [-SecondaryDns <IPAddress>] [-StaticIPPool <IPRangeList>] [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OrgNetwork Remove-OrgNetwork Set-OrgNetwork Detailed Description This cmdlet creates a new organization network on a vCloud Director server. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the organization network that you want to create. Indicates that you want to create an organization network that is connected directly to an external network. Specifies the DNS suffix of the organization network that you want to create.
false
false
Description
String
false
false
Direct DnsSuffix
SwitchParameter String
true false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
136/287
7/8/13
ExternalNetwork ExternalNetwork
SecondaryDns Server
IPAddress CIServer[]
false false
false false
IPRangeList SwitchParameter
false false
false false
The newly created OrgNetwork object Notes You can run this cmdlet only against vCloud Director 1.5.x environments. Examples -------------- Example 1 --------------
N e w O r g N e t w o r kD i r e c tN a m e' M y O r g D i r e c t N e t w o r k 'O r g' M y O r g a n i z a t i o n 'E x t e r n a l N e t w o r k' M y E x t e r n a l N e t w o r k 'D e s c r i p t i o n" T h en e t w o r kh a sd i r e c tc o n n e c t i o nt Creates a new organization network that is directly connected to the specified external network. -------------- Example 2 --------------
N e w O r g N e t w o r kI n t e r n a lN a m e' M y O r g I n t e r n a l N e t w o r k 'O r g' M y O r g a n i z a t i o n 'N e t w o r k P o o l' M y N e t w o r k P o o l 'G a t e w a y" 1 9 2 . 1 6 6 . 1 0 . 1 0 "P r i m a r y D n s" 1 9 2 . 1 6 6 . 1 0 . 1 "Creates a new internal organization network with a specified gateway, primary DNS, and network mask. -------------- Example 3 --------------
N e w O r g N e t w o r kR o u t e dN a m e' M y O r g R o u t e d O r g N e t w o r k 'O r g' M y O r g 'E x t e r n a l N e t w o r k' M y E x t e r n a l N e t w o r k 'N e t w o r k P o o l' M y N e t w o r k P o o l 'G a t e w a y" 1 9 2 . 1 6 6 . 1 0 . 1 0 "Creates a new routed organization network with a specified gateway, primary DNS, network mask, and a range of static IP addresses that will be allocated to the virtual machines in the network.
New-OrgVdc
Synopsis
This cmdlet creates an organization virtual datacenter (vDC). Syntax New-OrgVdc [-Name] <String> -AllocationModelAllocationPool -CpuAllocationGHz <Double> [-Description <String>] -MemoryAllocationGB <Decimal> [-NetworkPool <NetworkPool>] -Org <Org> -ProviderVdc <ProviderVdc> [-Server <CIServer[]>] -StorageAllocationGB <Decimal> [-WhatIf] [-Confirm] [<CommonParameters>] New-OrgVdc [-Name] <String> -AllocationModelPayAsYouGo [-Description <String>] [-NetworkPool <NetworkPool>] -Org <Org> -ProviderVdc <ProviderVdc> [-Server <CIServer[]>] [-StorageAllocationGB <Decimal>] -VMCpuCoreMHz <Int64> [-WhatIf] [-Confirm] [<CommonParameters>] New-OrgVdc [-Name] <String> -AllocationModelReservationPool -CpuAllocationGHz <Double> [-Description <String>] -MemoryAllocationGB <Decimal> [-NetworkPool <NetworkPool>] -Org <Org> -ProviderVdc <ProviderVdc> [-Server <CIServer[]>] -StorageAllocationGB <Decimal> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Remove-OrgVdc Get-OrgVdc Set-OrgVdc Detailed Description This cmdlet creates an organization virtual datacenter (vDC). You can configure resource allocation for the organization vDC by specifying an allocation model and by configuring CPU, memory and storage allocation.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
137/287
7/8/13
The organization vDC is created using a default configuration. * VMMaxCount is set to 100. * NetworkMaxCount is set to 1024. * The vDC is automatically enabled. * Thin provisioning is disabled. * Fast provisioning is disabled. * NicMaxCount is set to $null (unlimited). When you set the AllocationModelAllocationPool parameter, by default MemoryGuaranteedPercent is set to 100 and CpuGuaranteedPercent is set to 0. When you set the AllocationModelPayAsYouGo parameter, by default MemoryGuaranteedPercent is set to 100 and CpuGuaranteeedPercent is set to 0. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name AllocationModelAllocationPool
String SwitchParameter
Specifies a name for the organization vDC that you want to create. Specifies that you want to use the Allocation Pool resource allocation model. The allocation model determines how and when the provider vDC compute and memory resources that you allocate are committed to the organization vDC. Specifies that you want to use the Pay As You Go resource allocation model. The allocation model determines how and when the provider vDC compute and memory resources that you allocate are committed to the organization vDC. Specifies that you want to use the Reservation Pool resource allocation model. The allocation model determines how and when the provider vDC compute and memory resources that you allocate are committed to the organization vDC. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the CPU resources in gigahertz (GHz) that you want to allocate to the organization vDC. Specifies a description for the organization vDC that you want to create. Specifies the memory resources in gigabytes (GB) that you want to allocate to the organization vDC. Specifies a network pool that your organization vDC will have access to. Specifies the organization for which you want to create an organization vDC. Specifies the provider vDC that would provide the resources for your organization vDC. 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 ConnectCIServer. Specifies the storage resources in gigabytes (GB) that you want to allocate to the organization vDC. Note: To ensure backward compatibility, PowerCLI provides limited support for this parameter against vCloud Director 5.1 environments. When you develop new scripts for vCloud Director 5.1 environments, do not use this parameter.
true true
false false
AllocationModelPayAsYouGo
SwitchParameter
true
false
AllocationModelReservationPool
SwitchParameter
true
false
Confirm
SwitchParameter
false
false
CpuAllocationGHz
Double
true
false
Description MemoryAllocationGB
String Decimal
false true
false false
StorageAllocationGB
Decimal
true
false
VMCpuCoreMHz
Int64
Specifies a vCPU speed in megahertz (MHz). This value defines what a virtual machine with one vCPU will consume at maximum when running within this organization vDC. A virtual machine with two vCPUs would consume a maximum of twice this value. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
WhatIf
SwitchParameter
false
false
Return Type The newly created OrgVdc object Notes Examples -------------- Example 1 -------------N e w O r g V d c` A l l o c a t i o n M o d e l A l l o c a t i o n P o o l` C p u A l l o c a t i o n G H z2` D e s c r i p t i o n" O r gV D Cf o ro r g 1 "` M e m o r y A l l o c a t i o n G B2 0` N a m e" m y O r g V d c 1 "` O r g" o r g a n i z a t i o n 1 "` P r o v i d e r V d c" m y P r o v i d e r V d c "` S t o r a g e A l l o c a t i o n G B" 1 0 0 "` N e t w o r k P o o l' l a r g e N e t w o r k P o o l Creates a new organization vDC using the Allocation Pool resource allocation model. -------------- Example 2 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
138/287
7/8/13
N e w O r g V d c` A l l o c a t i o n M o d e l P a y A s Y o u G o` D e s c r i p t i o n" O r gV D Cf o ro r g 1 "` V M C p u C o r e M H z2` N a m e" m y P a y A s Y o u G o O r g V d c "` O r g" o r g a n i z a t i o n 1 "` P r o v i d e r V d c" m y P r o v i d e r V d c 1 "` S t o r a g e A l l o c a t i o n G B1 0 0` N e t w o r k P o o l' l a r g e N e t w o r k P o o l '
Creates a new organization vDC using the Pay As You Go resource allocation model. -------------- Example 3 -------------N e w O r g V d c` A l l o c a t i o n M o d e l R e s e r v a t i o n P o o l` C p u A l l o c a t i o n G H z2` D e s c r i p t i o n" O r gV D Cf o ro r g 1 "` M e m o r y A l l o c a t i o n G B2 0 N a m e" m y R e s e r v a t i o n P o o l O r g V d c "` O r g" o r g a n i z a t i o n 1 "` P r o v i d e r V d c" m y P r o v i d e r V d c 1 "` S t o r a g e A l l o c a t i o n G B1 0 0` N e t w o r k P o o l' l a r g e N e t w o r k P o o l ' Creates a new organization vDC using the Reservation Pool resource allocation model.
New-OSCustomizationNicMapping
Synopsis
This cmdlet adds NIC settings mappings to the specified OS customization specifications. Syntax New-OSCustomizationNicMapping -OSCustomizationSpec <OSCustomizationSpec[]> [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-OSCustomizationNicMapping -OSCustomizationSpec <OSCustomizationSpec[]> [-NetworkAdapterMac <String[]>] [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [-VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [-Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-OSCustomizationNicMapping -OSCustomizationSpec <OSCustomizationSpec[]> [-Position <Int32[]>] [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [-VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OSCustomizationNicMapping Set-OSCustomizationNicMapping Detailed Description This cmdlet adds NIC settings mappings to the specified OS customization specifications. If the given specification is server-side, it is updated on the server. If it is client-side, the reference that is kept in-memory is updated but the variable that is passed to the cmdlet is not modified. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
IpAddress
String
Specifies an IP address. Using this parameter automatically sets the IpMode parameter to UseStaticIp. Specifies a subnet mask. Specifies a default gateway. Specifies a DNS address. This parameter applies only to Windows operating systems. Specifies an alternate gateway. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the IP configuration mode. The valid values are UseDhcp, PromptUser, UseVCApplication, and UseStaticIP. Specifies the MAC addresses of the network adapters to which you want to map the new OS customization specifications. Specifies the OS customization specification to which you want to add the NIC setting mapping. Specifies the position of the NIC to which you want to map the OS customization specification. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Specifies an optional argument you want to pass to the vCenter Server to obtain an IP address. Indicates that the cmdlet is run only to display the changes that would be made and actually no
false
false
IpMode
OSCustomizationIPMode
false
false
UseDhcp
NetworkAdapterMac
String[]
false
false
VCApplicationArgument WhatIf
String SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
139/287
7/8/13
Wins Return Type String[]
The one or more newly created OSCustomizationNicMapping objects Notes Examples -------------- Example 1 --------------
N e w O S C u s t o m i z a t i o n N i c M a p p i n gO S C u s t o m i z a t i o n S p e c$ s p e cI p M o d eU s e S t a t i c I PI P A d d r e s s1 0 . 0 . 0 . 1S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0D e f a u l t G a t e w a y1 0 . 0 . 0 . 2 5 3D n s S e r v Creates a new NIC mapping for the OS customization spec stored in $spec.
New-OSCustomizationSpec
Synopsis
This cmdlet creates a new OS customization specification. Syntax New-OSCustomizationSpec [-OSType <String>] [-Server <VIServer[]>] [-Name <String>] [-Type <OSCustomizationSpecType>] [-DnsServer <String[]>] [-DnsSuffix <String[]>] [-Domain <String>] [-NamingScheme <String>] [-NamingPrefix <String>] [-Description <String>] [-WhatIf] [-Confirm] [<CommonParameters>] New-OSCustomizationSpec -OSCustomizationSpec <OSCustomizationSpec> [-Server <VIServer[]>] [-Name <String>] [-Type <OSCustomizationSpecType>] [-WhatIf] [Confirm] [<CommonParameters>] New-OSCustomizationSpec -FullName <String> -OrgName <String> [-OSType <String>] [-ChangeSid] [-DeleteAccounts] [-Server <VIServer[]>] [-Name <String>] [-Type <OSCustomizationSpecType>] [-DnsServer <String[]>] [-DnsSuffix <String[]>] [-GuiRunOnce <String[]>] [-AdminPassword <String>] [-TimeZone <String>] [AutoLogonCount <Int32>] [-Domain <String>] [-Workgroup <String>] [-DomainCredentials <PSCredential>] [-DomainUsername <String>] [-DomainPassword <String>] [-ProductKey <String>] [-NamingScheme <String>] [-NamingPrefix <String>] [-Description <String>] [-LicenseMode <LicenseMode>] [-LicenseMaxConnections <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OSCustomizationSpec Set-OSCustomizationSpec Detailed Description This cmdlet creates a new OS customization specification or clones an existing one. If a name is provided, creates and adds the specified customization specification to the server. Otherwise, creates and returns the requested specification object. If the Name parameter is not specified, the OSCustomizationSpec object is not persisted on the server. Either the Domain or the Workgroup parameters should be provided if a Windows specification is created. If a Linux specification is created, the Domain parameter is mandatory. New-OSCustomizationSpec automatically creates a default NIC mapping. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AdminPassword
String
Specifies a new OS administrator's password. This parameter applies only to Windows operating systems. Specifies the number of times the virtual machine automatically logs in as administrator without prompting for user credentials. The valid values are in the range between 0 and Int32.MaxValue. Specifying 0 disables auto logon. This parameter applies only to Windows operating systems. Indicates that the customization should modify the system security identifier (SID). This parameter applies only to Windows operating systems. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to delete all user accounts. This parameter applies only to Windows operating systems. Provides a description for the new specification. Specifies the DNS server settings. This parameter applies only to Linux operating systems. Specifies the DNS suffix settings. This parameter applies only to Linux operating systems. Specifies a domain name. Specifies the credentials you want to use for domain authentication. This parameter applies only to Windows operating systems. Specifies the password you want to use for domain authentication. This parameter applies only to Windows operating systems. Specifies the user name you want to use for domain authentication. This parameter applies only to Windows operating systems. Specifies the administrator's full name. This parameter applies only to Windows operating
false
false
AutoLogonCount
Int32
false
false
ChangeSid
SwitchParameter
false
false
Confirm
SwitchParameter
false
false
$true
DeleteAccounts
SwitchParameter
false
false
Description DnsServer
String String[]
false false
false false
empty string
DnsSuffix
String[]
false
false
Domain DomainCredentials
String PSCredential
false false
false false
empty string
DomainPassword
String
false
false
DomainUsername
String
false
false
FullName
String
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
140/287
7/8/13
GuiRunOnce String[]
LicenseMaxConnections
Int32
false
false
$null
LicenseMode
LicenseMode
false
false
Notspecified
Name NamingPrefix
String String
false false
NamingScheme
String
false
false
Vm
Specifies the name of the organization to which the administrator belongs. Specifies an OS customization specification that you want to clone. Specifies the type of the operating system. The valid values are Linux and Windows. Specifies the MS product key. If the guest OS version is earlier than Vista, this parameter is required in order to make the customization unattended. For Vista or later, the OS customization is unattended no matter if the ProductKey parameter is set. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the name or ID of the time zone for a Windows guest OS only. Using wildcards is supported. The following time zones are available: 000 001 002 003 004 010 015 020 025 030 033 035 040 Int'l Dateline Samoa Hawaii Alaskan Pacific Mountain (U.S. and Canada) U.S. Mountain: Arizona Central (U.S. and Canada) Canada Central Mexico Central America Eastern (U.S. and Canada) U.S. Eastern: Indiana (East)
Server
VIServer[]
false
true (ByValue)
TimeZone
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
141/287
7/8/13
Type
OSCustomizationSpecType
Specifies the type of the OS customization specification. The valid values are Persistent and NonPersistent. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Specifies a workgroup. This parameter applies only to Windows operating systems.
WhatIf
SwitchParameter
false
false
String
false
false
empty string
The newly created OSCustomizationSpec object Notes When the ProductKey parameter is not specified, the OS customization is una ttended only if the Windows guest operating system version is Vista or late r. This cmdlet is supported only in 32-bit PowerCLI mode. Examples -------------- Example 1 --------------
N e w O S C u s t o m i z a t i o n S p e cN a m eS p e cO S T y p eW i n d o w sF u l l N a m eA d m i n i s t r a t o rO r g N a m eO r g a n i z a t i o nN a m i n g S c h e m eF i x e dN a m i n g P r e f i xC o m p u t e rP r o d u c t K e y" x x x x Generates a new SID for the machine and sets the name of the machine to "Computer". -------------- Example 2 --------------
N e w O S C u s t o m i z a t i o n S p e cN a m eS p e cO S T y p eW i n d o w sD e s c r i p t i o n" T h i ss p e ca d d sac o m p u t e ri nad o m a i n . "F u l l N a m eA d m i n i s t r a t o rO r g N a m eO r g a n i z a t i o nN a m i n g Creates a customization specification that adds a computer in the domain named "Domain".
New-ResourcePool
Synopsis
This cmdlet creates a new resource pool. Syntax
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
142/287
7/8/13
New-ResourcePool -Location <VIContainer> -Name <String> [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64>] [CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemLimitGB <Decimal>] [-MemReservationMB <Int64>] [MemReservationGB <Decimal>] [-MemSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ResourcePool Move-ResourcePool Remove-ResourcePool Set-ResourcePool Detailed Description This cmdlet creates a new resource pool with the provided inputs on the location that is specified by the Location parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the CPU reservation can grow beyond the specified value if the parent resource pool has unreserved resources. Specifies a CPU usage limit in MHz. Utilization will not exceed this limit even if there are available resources. Specifies the CPU size in MHz that is guaranteed to be available. Specifies the CPU allocation level for this pool. This property is used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal. Specifies a container object (ResourcePool, Cluster, or VMHost) where you want to place the new resource pool. If a host or a cluster is specified for the Location parameter, the resource pool is created in the "Resources" resource pool. The "Resources" resource pool is a system resource pool and is guaranteed to exist. If the value is $true, the memory reservation can grow beyond the specified value if the parent resource pool has unreserved resources. Specifies a memory usage limit in gigabytes (GB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. This parameter is obsolete. Use MemLimitGB instead. Specifies a memory usage limit in megabytes (MB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. Specifies the guaranteed available memory in gigabytes (GB). This parameter is obsolete. Use MemReservationGB instead. Specifies the guaranteed available memory in megabytes (MB). Specifies the memory allocation level for this pool. This property is used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal. Specifies a name for the new resource pool. Specifies the CPU allocation level for this pool. This property is used in relative allocation between resource consumers. This parameter is ignored unless the CpuSharesLevel parameter is set to Custom. Specifies the memory allocation level for this pool. This property is used in relative allocation between resource consumers. This parameter is ignored unless the MemSharesLevel parameter is set to Custom. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
$true
CpuExpandableReservation
Boolean
false
false
CpuLimitMhz
Int64
false
false
CpuReservationMhz CpuSharesLevel
Int64 SharesLevel
false false
Location
VIContainer
true
true (ByValue)
MemExpandableReservation
Boolean
false
false
MemLimitGB
Decimal
false
false
MemLimitMB
Int64
false
false
MemReservationGB MemReservationMB
Decimal Int64
false false
false false
MemSharesLevel
SharesLevel
false
false
Normal
Name NumCpuShares
String Int32
true false
false false
NumMemShares
Int32
false
false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type The newly created ResourcePool object Notes Examples -------------- Example 1 -------------$ r e s o u r c e p o o l 1=G e t R e s o u r c e P o o lL o c a t i o nC l u s t e rN a m eR e s o u r c e P o o l 1
N e w R e s o u r c e P o o lL o c a t i o n$ r e s o u r c e p o o l 1N a m eR e s o u r c e P o o l 2C p u E x p a n d a b l e R e s e r v a t i o n$ t r u eC p u R e s e r v a t i o n M h z5 0 0C p u S h a r e s L e v e lh i g hM e m E x p a n d a b l e R e s e r v Creates a new resource pool named ResourcePool2 in the cluster's root resource pool ResourcePool1.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
143/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
New-ScsiController
Synopsis
This cmdlet creates a new SCSI controller. Syntax New-ScsiController [-HardDisk] <HardDisk[]> [[-Type] <ScsiControllerType>] [[-BusSharingMode] <ScsiBusSharingMode>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ScsiController Set-ScsiController Detailed Description This cmdlet creates a new SCSI controller. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HardDisk Type
HardDisk[] ScsiControllerType
Specifies the hard disks you want to attach to the new SCSI controller. Specifies the type of the SCSI controller. The valid values are ParaVirtual, VirtualBusLogic, VirtualLsiLogic, and VirtualLsiLogicSAS. Specifies the bus sharing mode of the SCSI controller. The valid values are NoSharing, Physical, and Virtual. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
BusSharingMode Confirm
ScsiBusSharingMode SwitchParameter
false false
false false
SwitchParameter
false
false
The one or more newly created ScsiController objects Notes Examples -------------- Example 1 -------------$ v m=G e t V MV M|N e w H a r d D i s kC a p a c i t y K B1 0 4 8 5 7 6 0|N e w S c s i C o n t r o l l e r Creates a new 10GB hard disk and a new SCSI controller with default values for the BusSharingMode and Type properties. -------------- Example 2 -------------$ d i s k=G e t H a r d D i s kV MV M|S e l e c tF i r s t2 N e w S c s i C o n t r o l l e rH a r d D i s k$ d i s kB u s S h a r i n g M o d eP h y s i c a lT y p eV i r t u a l L s i L o g i c S A S Creates for the first two hard disks of VM a new SCSI controller of VirtualLsiLogicSAS type and with Physical bus sharing mode.
New-Snapshot
Synopsis
This cmdlet creates a new snapshot of a virtual machine. Syntax New-Snapshot [-VM] <VirtualMachine[]> [-Name] <String> [-Description <String>] [-Memory] [-Quiesce] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Snapshot Remove-Snapshot Set-Snapshot Detailed Description This cmdlet creates a new snapshot of a virtual machine with the provided inputs. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Name Confirm
Specifies the virtual machines you want to snapshot. Specifies a name for the new snapshot. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Provide a description of the new snapshot.
Description
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
144/287
7/8/13
Memory Quiesce SwitchParameter SwitchParameter
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
The one or more newly created Snapshot objects Notes Examples -------------- Example 1 -------------N e w S n a p s h o tV MV MN a m eB e f o r e P a t c h Creates a new snapshot of the VM virtual machine named BeforePatch.
New-StatInterval
Synopsis
This cmdlet creates a statistics interval with the specified parameters. Syntax New-StatInterval [-Name] <String> [-SamplingPeriodSecs] <Int32> [-StorageTimeSecs] <Int32> [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Stat Get-StatType Get-StatInterval Remove-StatInterval Set-StatInterval Detailed Description This cmdlet creates a statistics interval with the specified parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new statistics interval. Specifies a sampling period in seconds. Specifies the length of time (in seconds) that the statistics information is kept in the database. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
SwitchParameter
false
false
The newly created StatInterval object Notes Creation of statistics intervals is not supported on vCenter Server and ESX later than 2.0. Examples -------------- Example 1 -------------N e w S t a t I n t e r v a lN a m eM i n u t eS a m p l i n g P e r i o d S e c s6 0S t o r a g e T i m e S e c s6 0 0 Creates a new statistics interval named Minute. Note that creating statistics intervals is allowed only on VirtualCenter 2.0.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
145/287
7/8/13
New-Template
Synopsis
This cmdlet creates a new virtual machine template. Syntax New-Template [-VM] <VirtualMachine> [-Name] <String> [-Location] <VIContainer> [-Datastore <StorageResource>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [Confirm] [<CommonParameters>] New-Template [[-Name] <String>] [-Location <VIContainer>] [-VMHost <VMHost>] [-Datastore <StorageResource>] [-DiskStorageFormat <VirtualDiskStorageFormat>] -Template <Template> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] New-Template [[-Name] <String>] [-Location <VIContainer>] -VMHost <VMHost> [-TemplateFilePath] <String> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Template Remove-Template Set-Template Detailed Description This cmdlet creates a new template based on the specified virtual machine. You can also create a new template by cloning an existing one. You can also register an existing template to the vCenter Server inventory. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new template. Specifies the datastore path to the file you want to use to register the new template. Specifies the virtual machine from which you want to create the new template. Specifies the location where you want to place the new template. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the datastore or the datastore cluster where you want to store the new template. Specifies the disk storage format of the new template. This parameter accepts Thin, Thick, and EagerZeroedThick values. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies a template you want to clone. Specifies the host where you want to create the new template. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Datastore DiskStorageFormat
StorageResource VirtualDiskStorageFormat
false false
false false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
Return Type The newly created Template object Notes Examples -------------- Example 1 -------------$ m y V M=G e t V MN a m e" M y V M 1 " $ d r s C l u s t e r = G e t D a t a s t o r e C l u s t e r" M y D a t a s t o r e C l u s t e r " N e w T e m p l a t eV M$ m y V MN a m e" M y T e m p l a t e "D a t a s t o r e$ d r s C l u s t e rL o c a t i o nD a t a c e n t e r 2 Creates a template named MyTemplate from the MyVM1 virtual machine and stores it in the MyDatastoreCluster datastore cluster in the Datacenter2 datacenter. -------------- Example 2 -------------$ m y F o l d e r=G e t F o l d e rN a m e" M y F o l d e r 1 " N e w T e m p l a t eN a m e" M y T e m p l a t e 1 "T e m p l a t e F i l e P a t h" [ S t o r a g e 1 ]t e m p l a t e f o l d e r / t e m p l a t e . v m t x "L o c a t i o n$ m y F o l d e rV M H o s t( G e t V M H o s t ) Registers the existing MyTemplate1 template to a vCenter Server inventory folder by using the specified template file. -------------- Example 3 -------------$ m y T e m p l a t e=G e t T e m p l a t eN a m e" M y T e m p l a t e 1 " $ m y D s=G e t D a t a s t o r eN a m e" M y D a t a s t o r e 1 " N e w T e m p l a t eT e m p l a t e$ m y T e m p l a t eN a m e" M y T e m p l a t e 2 "D a t a s t o r e$ m y D sL o c a t i o n" D a t a c e n t e r 2 " Creates the MyTemplate2 template by cloning an existing template and stores the new template in the specified datastore in the Datacenter2 datacenter.
7/8/13
New-VApp
Synopsis
This creates a new vApp. Syntax New-VApp -Location <VIContainer> [-Name] <String> [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64>] [CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemLimitGB <Decimal>] [-MemReservationMB <Int64>] [MemReservationGB <Decimal>] [-MemSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] New-VApp -Location <VIContainer> [[-Name] <String>] -VApp <VApp> [-VMHost <VMHost>] [-Datastore <Datastore>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [Confirm] [<CommonParameters>] Related Commands Online version Export-VApp Get-VApp Import-VApp Remove-VApp Set-VApp Start-VApp Stop-VApp Move-VApp Detailed Description This creates a new vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Confirm
String SwitchParameter
Specifies a name for the new vApp. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the CPU reservation can grow beyond the specified value if there are available resources. Specifies a CPU usage limit in MHz. Utilization will not exceed this limit even if there are available resources. Specifies the CPU size in MHz that is guaranteed to be available. Specifies the CPU allocation level for this vApp. This property is used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal. Specifies the datastore where you want to store the copied vApp. If you do not specify a datastore, the cmdlet takes the first datastore of the host or cluster. Specifies a VApp, ResourcePool, VMHost, or Cluster object where you want to place the new vApp. If the value is $true, the memory reservation can grow beyond the specified value if there are available resources. Specifies a memory usage limit in gigabytes (GB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. This parameter is obsolete. Use MemLimitGB instead. Specifies a memory usage limit in megabytes (MB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. Specifies the guaranteed available memory in gigabytes (GB). This parameter is obsolete. Use MemReservationGB instead. Specifies the guaranteed available memory in megabytes (MB). Specifies the memory allocation level for this vApp. This property is used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal. Specifies the CPU allocation level for this vApp. This property is used in relative allocation between resource consumers. This parameter is ignored unless the CpuSharesLevel parameter is set to Custom. Specifies the memory allocation level for this vApp. This property is used in relative allocation between resource consumers. This parameter is ignored unless the MemSharesLevel parameter is set to Custom. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the Center Server systems 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,
true false
CpuExpandableReservation
Boolean
false
false
CpuLimitMhz
Int64
false
false
CpuReservationMhz CpuSharesLevel
Int64 SharesLevel
false false
false false
Datastore
Datastore
false
false
Location MemExpandableReservation
VIContainer Boolean
true false
MemLimitGB
Decimal
false
false
MemLimitMB
Int64
false
false
MemReservationGB MemReservationMB
Decimal Int64
false false
false false
MemSharesLevel
SharesLevel
false
false
NumCpuShares
Int32
false
false
NumMemShares
Int32
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
147/287
7/8/13
VApp VMHost WhatIf VApp VMHost SwitchParameter
Return Type The newly created VApp object Notes Examples -------------- Example 1 -------------N e w V A p pN a m eM y V A p p 1C p u L i m i t M h z4 0 0 0C p u R e s e r v a t i o n M h z1 0 0 0L o c a t i o nM y V M H o s t 1 Creates a new vApp on the MyVMHost1 host.
New-VDPortgroup
Synopsis
This cmdlet creates distributed port groups. Syntax New-VDPortgroup [-VDSwitch] <VDSwitch> -Name <String> [-Notes <String>] [-NumPorts <Int32>] [-VlanId <Int32>] [-VlanTrunkRange <VlanRangeList>] [-PortBinding <DistributedPortGroupPortBinding>] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VDPortgroup [-VDSwitch] <VDSwitch> [-Name <String>] -ReferencePortgroup <VDPortgroup> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VDPortgroup [-VDSwitch] <VDSwitch> [-Name <String>] -BackupPath <String> [-KeepIdentifiers] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VDPortgroup Set-VDPortgroup Remove-VDPortgroup Export-VDPortgroup Detailed Description This cmdlet creates distributed port groups. You can create a new distributed port group with custom properties, specify a reference port group to clone its properties, or provide a backup profile to import the port group configuration. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VDSwitch
VDSwitch
Specifies the vSphere distributed switch on which you want to create the new distributed port group. Specifies the full file path to the .zip file containing the backup configuration that you want to import. Only .zip files created with the Export-VDPortgroup cmdlet are supported. Note: This parameter is supported only on vSphere 5.1 and later.
true
true (ByValue)
BackupPath
String
true
false
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the original vSphere distributed port group identifiers will be preserved. Note: This parameter is supported only on vSphere 5.1 and later.
false
false
KeepIdentifiers
SwitchParameter
false
false
Name Notes
String String
Specifies the name of the new distributed port group that you want to create. Specifies a description for the new distributed port group that you want to create. Specifies the number of ports that the distributed port group will have. If you do not set this parameter, the number of ports for the new distributed port group is set to 128 ports. Specifies the port binding setting for the distributed port group that you want to create. This parameter accepts Static, Dynamic, and Ephemeral values. Note: Dynamic port binding is deprecated. For better performance, static port binding is recommended. Specifies a reference distributed port group. The properties of the new distributed port group will be cloned from the reference distributed port group.
true false
false false
NumPorts
Int32
false
false
PortBinding
DistributedPortGroupPortBinding
false
false
Static
ReferencePortgroup
VDPortgroup
true
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
148/287
7/8/13
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies the VLAN ID of the distributed port group that you want to create. Valid values are integers in the range of 1 to 4094. Specifies the VLAN trunk range for the distributed port group that you want to create. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9". Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Server
VIServer[]
false
false
VlanId
Int32
false
false
VlanTrunkRange
VlanRangeList
false
false
WhatIf
SwitchParameter
false
false
Return Type The newly created VDPortgroup object Notes Examples -------------- Example 1 -------------G e t V D S w i t c hN a m e" M y V D S w i t c h "|N e w V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "N u m P o r t s8V L a n I d4 Creates a new distributed port group on the specified vSphere distributed switch with the specified number of ports and VLAN ID. -------------- Example 2 -------------$ m y R e f e r n c e P o r t r o u p=G e t V D P o r t g r o u pN a m e" M y R e f e r e n c e P o r t G r o u p " G e t V D S w i t c hN a m e" M y V D S w i t c h "|N e w V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "R e f e r e n c e P o r t g r o u p$ m y R e f e r n c e P o r t r o u p Creates a new distributed port group on the specified vSphere distributed switch by cloning the configuration of the distributed port group named "MyReferencePortGroup". -------------- Example 3 -------------G e t V D S w i t c hN a m e" M y V D S w i t c h "|N e w V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "R u n A s y n c Creates asynchronously a new distributed port group on the specified vSphere distributed switch. -------------- Example 4 -------------$ m y B a c k u p F i l e P a t h=' c : \ B a c k u p . z i p ' G e t V D S w i t c hN a m e" M y V D S w i t c h "|N e w V D P o r t g r o u pN a m e" M y V D P o r t g r o u p "B a k u p P a t h$ m y B a c k u p F i l e P a t h Creates a new distributed port group on the specified vSphere distributed switch by importing the specified backup profile. -------------- Example 5 -------------G e t V D S w i t c hN a m e" M y V D S w i t c h "|N e w V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "V l a n T r u n k R a n g e" 1 5 ,1 0 2 0 " Creates a new distributed port group on the specified vSphere distributed switch with the specified name and VLAN trunk range settings.
New-VDSwitch
Synopsis
This cmdlet creates vSphere distributed switches. Syntax New-VDSwitch [-ContactDetails <String>] [-ContactName <String>] [-LinkDiscoveryProtocol <LinkDiscoveryProtocol>] [-LinkDiscoveryProtocolOperation <LinkDiscoveryOperation>] [-MaxPorts <Int32>] [-Mtu <Int32>] [-Notes <String>] [-NumUplinkPorts <Int32>] [-Version <String>] -Name <String> -Location <VIContainer> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VDSwitch -ReferenceVDSwitch <VDSwitch> -Name <String> -Location <VIContainer> [-WithoutPortGroups] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VDSwitch -BackupPath <String> [-KeepIdentifiers] [-Name <String>] -Location <VIContainer> [-WithoutPortGroups] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VDSwitch Remove-VDSwitch Set-VDSwitch Export-VDSwitch Detailed Description This cmdlet creates vSphere distributed switches. You can create a new distributed switch with custom properties, specify a reference distributed switch to clone its configuration, or provide a backup profile to import the switch configuration.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
149/287
7/8/13
Note: Creating vSphere distributed switches from a reference switch or a backup profile requires vCenter Server 5.1 or later. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
BackupPath
String
Specifies the full file path to the .zip file containing the backup configuration that you want to import. Only .zip files created with the Export-VDSwitch cmdlet are supported. Note: This parameter is supported only on vSphere 5.1 and later.
true
false
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the contact details of the vSphere distributed switch administrator. Specifies the name of the vSphere distributed switch administrator. Indicates that the original vSphere distributed switch and port group identifiers will be preserved. You cannot specify this parameter, when the Name parameter is specified. Note: This parameter is supported only on vSphere 5.1 and later.
false
false
LinkDiscoveryProtocol
LinkDiscoveryProtocol
Specifies the discovery protocol type of the distributed switch that you want to create. This parameter accepts CDP and LLDP values. If you do not set a value for this parameter, the default server setting is used. Specifies the link discovery protocol operation for the distributed switch that you want to create. This parameter accepts Advertise, Listen, Both, and Disabled values. If you do not set a value for this parameter, the default server setting is used. Specifies the location where you want to create the vSphere distributed switch. This parameter accepts Datacenter and Folder objects. Note: You cannot create distributed port groups with identical names in the same location. If you want to import or clone a distributed switch with its distributed port groups, you need to specify a location that does not contain identically named distributed port groups.
false
false
LinkDiscoveryProtocolOperation
LinkDiscoveryOperation
false
false
Location
VIContainer
true
false
MaxPorts
Int32
Specifies the maximum number of ports allowed on the vSphere distributed switch that you want to create. Specifies the maximum MTU size for the vSphere distributed switch that you want to create. Valid values are positive integers only. Specifies a name for the new vSphere distributed switch that you want to create. You cannot specify this parameter, when the KeepIdentifiers parameter is specified. Specifies a description for the vSphere distributed switch that you want to create. Specifies the number of uplink ports on the vSphere distributed switch that you want to create. Specifies a reference vSphere distributed switch. The properties of the new distributed switch will be cloned from the reference distributed switch. Note: This parameter is supported only on vSphere 5.1 and later.
false
false
Mtu
Int32
false
false
Name
String
true
false
Notes
String
false
false
NumUplinkPorts
Int32
false
false
ReferenceVDSwitch
VDSwitch
true
true (ByValue)
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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 ConnectVIServer. Specifies the version of the vSphere distributed switch that you want to create. This parameter accepts 4.0,
false
false
Server
VIServer[]
false
false
Version
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
150/287
7/8/13
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Indicates that the new distributed switch will be created without importing the port groups from the specified backup file or reference distributed switch.
false
false
WithoutPortGroups
SwitchParameter
false
false
Return Type The newly created VDSwitch object Notes Examples -------------- Example 1 --------------
$ m y D a t a c e n t e r=G e t D a t a c e n t e rN a m e" M y D a t a c e n t e r " N e w V D S w i t c hN a m e" M y V D S w i t c h "L o c a t i o n$ m y D a t a c e n t e rL i n k D i s c o v e r y P r o t o c o l" L L D P "L i n k D i s c o v e r y P r o t o c o l O p e r a t i o n" L i s t e n "M a x P o r t s2 5 6V e r s i o n" 5 . 0 . 0 " Creates a new vSphere distributed switch with the specified name, version, maximum number of ports, and link discovery protocol settings in the specified datacenter. -------------- Example 2 -------------$ m y F o l d e r=G e t F o l d e rN a m e" M y F o l d e r " G e t V D S w i t c hN a m e" M y R e f e r e n c e S w i t c h "|N e w V D S w i t c hN a m e" M y V D S w i t c h "L o c a t i o n$ m y F o l d e rW i t h o u t P o r t G r o u p s Creates a new vSphere distributed switch by cloning the configuration of the existing distributed switch named "MyReferenceSwitch". The new distributed switch is created without cloning the existing port groups and is stored in the specified folder. -------------- Example 3 -------------$ m y F o l d e r=G e t F o l d e rN a m e" M y F o l d e r " N e w V D S w i t c hN a m e" M y V D S w i t c h "L o c a t i o n$ m y F o l d e rW i t h o u t P o r t G r o u p sB a c k u p P a t h" c : \ M y D i s t r i b u t e d S w i t c h P r o f i l e . z i p " Creates a new vSphere distributed switch by importing the specified backup profile.
New-VICredentialStoreItem
Synopsis
This cmdlet creates a new entry in the credential store. Syntax New-VICredentialStoreItem [-Host] <String> [-User] <String> [[-Password] <String>] [[-File] <String>] [<CommonParameters>] Related Commands Online version Get-VICredentialStoreItem Remove-VICredentialStoreItem Detailed Description This cmdlet creates a new entry in the credential store. If there is an existing entry for the specified host and user, it is overwritten. If the credential store file does not exist, it is created (along with its directory if needed). If no file is specified, the item is created in the default credential store file %APPDATA%\VMware\credstore\vicredentials.xml. Credential store items for vCloud Director servers must contain user name and organization in the following format: user_name:organization_name, where both names are lower-cased. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the host for which you want to create the new credentials item. Specifies a user name. Specifies a password. Specifies a file path where you want to store the new credentials.
The newly created VICredentialStoreItem object Notes Examples -------------- Example 1 -------------N e w V I C r e d e n t i a l S t o r e I t e mH o s t1 9 2 . 1 6 8 . 1 . 1 0U s e rA d m i nP a s s w o r dp a s s Adds a new item in the default credential store file.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
151/287
7/8/13
New-VIPermission
Synopsis
This cmdlet creates new permissions on the specified inventory objects for the provided users and groups in the role. Syntax New-VIPermission [-Entity] <VIObject[]> [-Principal] <VIAccount[]> [-Role] <Role> [-Propagate [<Boolean>]] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIPermission Remove-VIPermission Set-VIPermission Get-VIPrivilege Get-VIRole New-VIRole Remove-VIRole Set-VIRole Detailed Description This cmdlet creates new permissions on the specified inventory objects for the provided users and groups in the role. By default, new permissions are propagated down the hierarchy to sub-entities. You cannot create new permissions for the following objects: - direct child folders of a datacenter - root resource pools of clusters and standalone hosts. These objects always inherit the permissions of their parent. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Principal
VIAccount[]
Specifies users and groups to which you want to apply the new permissions. If you specify principal names by using the "domain\name" syntax, wildcards are not supported. Specifies the roles for which you want to create new permissions. Specifies the inventory objects for which you want to create new permissions. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to propagate the new permissions to the child inventory objects. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
Propagate Server
Boolean VIServer[]
false false
false false
SwitchParameter
false
false
The one or more newly created Permission objects Notes You can specify permissions to a datastore only on vSphere 4.0 and later. Examples -------------- Example 1 -------------N e w V I R o l eN a m eR o l eS e r v e r$ s e r v e rP r i v i l e g e( G e t V I P r i v i l e g eP r i v i l e g e G r o u p ) $ p e r m i s s i o n=N e w V I P e r m i s s i o nR o l eR o l eP r i n c i p a lA d m i n i s t r a t o rE n t i t y( G e t D a t a c e n t e r ) Creates a permission on the provided server for a role with the specified privileges.
New-VIProperty
Synopsis
This cmdlet creates a new extension property on the specified object type. Syntax New-VIProperty [-Name] <String> [-ObjectType] <String[]> [-Value] <ScriptBlock> [-Force] [-BasedOnExtensionProperty <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VIProperty [-Name] <String> [-ObjectType] <String[]> [-Force] [-ValueFromExtensionProperty] <String> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIProperty Remove-VIProperty Detailed Description This cmdlet creates a new extension property on the specified object type. Changes take effect upon the next retrieval of the corresponding objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name
String
Specifies a name for the new extension property. Names are case-sensitive and can include only letters, numbers, and the underscore symbol. The name of a property must start with a letter or
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
152/287
7/8/13
ObjectType String[]
Value ValueFromExtensionProperty
ScriptBlock String
true true
false false
BasedOnExtensionProperty
String[]
false
false
Confirm
SwitchParameter
false
false
$true
Force
SwitchParameter
false
false
WhatIf
SwitchParameter
false
false
Return Type The newly created VIProperty object Notes In PowerShell 2.0, errors in evaluating values of new properties are not di splayed. You can find information about these errors in the $Error environm ent variable. Examples -------------- Example 1 --------------
N e w V I P r o p e r t yO b j e c t T y p eV i r t u a l M a c h i n eN a m eC o m m i t t e d S p a c e M BV a l u e{$ v m=$ a r g s [ 0 ] ;$ s u m=0 ;$ v m . E x t e n s i o n D a t a . S t o r a g e . P e r D a t a s t o r e U s a g e|f o r e a c h{$ s G e t V M|s e l e c tN a m e ,C o m m i t t e d S p a c e M B Creates a script-based property for the VirtualMachine object type that calculates the committed space of a virtual machine. -------------- Example 2 --------------
N e w V I P r o p e r t yO b j e c t T y p eV i r t u a l M a c h i n eN a m eC o m m i t t e d S p a c e M BV a l u e{$ v m=$ a r g s [ 0 ] ;$ s u m=0 ;$ v m . E x t e n s i o n D a t a . S t o r a g e . P e r D a t a s t o r e U s a g e|f o r e a c h{$ s G e t V M|s e l e c tN a m e ,C o m m i t t e d S p a c e M B Creates a property that calculates the committed space of a virtual machine. The cmdlet uses the BasedOnExtensionProperty parameter to specify which ExtensionData member is used by the script block. This mean that during the creation of each virtual machine, only the specified property of extension data Storage.PerDatastoreUsage.Committed will be filled up. -------------- Example 3 -------------N e w V I P r o p e r t yO b j e c t T y p eV i r t u a l M a c h i n eN a m eC o m m i t t e d S p a c eV a l u e F r o m E x t e n s i o n P r o p e r t y' S U MS t o r a g e . P e r D a t a s t o r e U s a g e . C o m m i t t e d ' Creates a new property that calculates the committed storage based on the property and aggregation function SUM specified by the ValueFromExtensionProperty parameter. -------------- Example 4 -------------N e w V I P r o p e r t yO b j e c t T y p eI n v e n t o r y I t e mN a m eO v e r a l l S t a t u sV a l u e F r o m E x t e n s i o n P r o p e r t y' O v e r a l l S t a t u s ' G e t V M|s e l e c tN a m e ,O v e r a l l S t a t u s G e t V M H o s t|s e l e c tN a m e ,O v e r a l l S t a t u s Creates a new property based on the OverallStatus property for all inventory types. -------------- Example 5 -------------N e w V I P r o p e r t yO b j e c t T y p eV I O b j e c t C o r eV a l u e{i f($ a r g s [ 0 ] . U I dm a t c h" / V I s e r v e r = [ \ w ] + @ ( . * ) : . * "){$ m a t c h e s [ 1 ]}e l s e{"}}N a m eV I S e r v e r N a m e G e t I n v e n t o r y|s e l e c tN a m e ,V I S e r v e r N a m e Creates a script-based property to VIObjectCore that parses the UId property and extracts the name of the server to which a given object belongs.
New-VIRole
Synopsis
This cmdlet creates a new role on the specified servers and applies the provided privileges. Syntax New-VIRole [-Name] <String> [[-Privilege] <Privilege[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
153/287
7/8/13
Online version Get-VIRole Remove-VIRole Set-VIRole Get-VIPrivilege Get-VIPermission New-VIPermission Remove-VIPermission Set-VIPermission Detailed Description
This cmdlet creates a new role on the specified servers and applies the provided privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new role. Specifies the privileges you want to apply to the new role. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
SwitchParameter
false
false
The newly created Role object Notes Examples -------------- Example 1 -------------N e w V I R o l eN a m eR o l eP r i v i l e g e( G e t V I P r i v i l e g eP r i v i l e g e G r o u p ) Creates a new role with the provided group privileges.
New-VirtualPortGroup
Synopsis
This cmdlet creates a new port group on the specified host. Syntax New-VirtualPortGroup [-Name] <String> [-VirtualSwitch] <VirtualSwitch> [-VLanId <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Remove-VirtualPortGroup Set-VirtualPortGroup Get-VirtualPortGroup Detailed Description This cmdlet creates a new port group on the host using the provided parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new port group. Specifies the virtual switch for which you want to create a new port group. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Specifies the VLAN ID for ports using this port group. The following values are valid: 0 - specifies that you do not want to associate the port group with a VLAN. 1 to 4094 - specifies a VLAN ID for the port group. 4095 - specifies that the port group should use trunk mode, which allows the guest operating system to manage its own VLAN tags.
Server
VIServer[]
false
false
VLanId
Int32
false
false
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
The newly created VirtualPortGroup object Notes Examples -------------- Example 1 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
154/287
7/8/13
$ v s w i t c h= N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 4 . 2 3 4N a m eV S w i t c h $ v p o r t g r o u p= N e w V i r t u a l P o r t G r o u pV i r t u a l S w i t c h$ v s w i t c h N a m eV P o r t G r o u p Creates a virtual port group named VPortGroup on the virtual switch VSwitch.
New-VirtualSwitch
Synopsis
This cmdlet creates a new virtual switch. Syntax New-VirtualSwitch [-VMHost] <VMHost> [-Name] <String> [[-NumPorts] <Int32>] [[-Nic] <PhysicalNic[]>] [[-Mtu] <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VirtualSwitch Detailed Description This cmdlet creates a new virtual switch on the host that is specified by the VMHost parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the host on which you want to create the new virtual switch. Specifies a name for the new virtual switch. Specifies the virtual switch port number. The value is rounded to the closest exact power of two that is greater than the given number (for example, if the user specifies 67, this number is rounded to 128). The value range is between 1 and 1024. Note that the port number displayed in the vSphere Client might differ from the value that you specified for the NumPorts parameter. Specifies the physical network interface cards you want to add to the Active NICs of the new virtual switch. This parameter accepts both objects and strings. Specifies the maximum transmission unit (MTU) associated with the specified virtual switch (in bytes). The MTU value is always greater than 0. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Nic
PhysicalNic[]
false
false
Mtu
Int32
false
false
Confirm
SwitchParameter
false
false
$true
Server
VIServer[]
false
false
SwitchParameter
false
false
The newly created VirtualSwitch object Notes NumPorts are at least as many as the user specified. (The server rounds it up to the closest exact power of two, greater than the given number) The MTU field is only available on VPX 2.5 and ESX 3.5. For older VPX vers ions, this field is expected to be null. Examples -------------- Example 1 -------------$ v s w i t c h= N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4N a m eV S w i t c h Creates a new virtual switch named VSwitch on the virtual machine host with IP address 10.23.112.234. -------------- Example 2 -------------$ n e t w o r k=G e t V M H o s t N e t w o r kV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4 $ p h N i c=$ n e t w o r k . P h y s i c a l N i c [ 0 ] . D e v i c e N a m e $ v s w i t c h=N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4N a m eV S w i t c hN i c$ p h N i c Creates a new virtual switch named VSwitch on the virtual machine host with IP address 10.23.112.234 with a physical network adapter. -------------- Example 3 -------------G e t V M H o s t* . 1 2 8|N e w V i r t u a l S w i t c hN a m eV S w i t c hN i cv m n i c 5 , v m n i c 6 Create a virtual switch named VSwitch with two physical network adapters - 'vmnic5' and 'vmnic6'. Note that the 'vmnic5' and 'vmnic6' adapters must not be assigned to other virtual switches.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
155/287
7/8/13
New-VM
Synopsis
This cmdlet creates a new virtual machine. Syntax New-VM [-AdvancedOption <AdvancedOption[]>] [[-VMHost] <VMHost>] [-Version <VMVersion>] -Name <String> [-ResourcePool <VIContainer>] [-VApp <VApp>] [Location <Folder>] [-Datastore <StorageResource>] [-DiskMB <Int64[]>] [-DiskGB <Decimal[]>] [-DiskPath <String[]>] [-DiskStorageFormat <VirtualDiskStorageFormat>] [-MemoryMB <Int64>] [-MemoryGB <Decimal>] [-NumCpu <Int32>] [-Floppy] [-CD] [-GuestId <String>] [-AlternateGuestName <String>] [NetworkName <String[]>] [-Portgroup <VirtualPortGroupBase[]>] [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [DrsAutomationLevel <DrsAutomationLevel>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-Server <VIServer[]>] [-RunAsync] [-Notes <String>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VM [-AdvancedOption <AdvancedOption[]>] [[-VMHost] <VMHost>] -Name <String> [-ResourcePool <VIContainer>] [-VApp <VApp>] [-Location <Folder>] [Datastore <StorageResource>] [-Template] <Template> [-DiskStorageFormat <VirtualDiskStorageFormat>] [-OSCustomizationSpec <OSCustomizationSpec>] [HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-DrsAutomationLevel <DrsAutomationLevel>] [-Server <VIServer[]>] [RunAsync] [-Notes <String>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VM [-AdvancedOption <AdvancedOption[]>] [[-VMHost] <VMHost>] [-Name <String>] [-ResourcePool <VIContainer>] [-VApp <VApp>] [-Location <Folder>] [Datastore <StorageResource>] [-DiskStorageFormat <VirtualDiskStorageFormat>] [-OSCustomizationSpec <OSCustomizationSpec>] [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-DrsAutomationLevel <DrsAutomationLevel>] [-LinkedClone] [-ReferenceSnapshot <Snapshot>] [-Server <VIServer[]>] [-RunAsync] [-Notes <String>] -VM <VirtualMachine[]> [-WhatIf] [-Confirm] [<CommonParameters>] New-VM [[-VMHost] <VMHost>] [-Name <String>] [-ResourcePool <VIContainer>] [-VApp <VApp>] [-Location <Folder>] [-HARestartPriority <HARestartPriority>] [HAIsolationResponse <HAIsolationResponse>] [-DrsAutomationLevel <DrsAutomationLevel>] -VMFilePath <String> [-Server <VIServer[]>] [-RunAsync] [-Notes <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Move-VM Remove-VM Set-VM Start-VM Stop-VM Suspend-VM Restart-VM Detailed Description This cmdlet creates a new virtual machine with the provided parameters. The network adapter and the SCSI adapter of the new virtual machine are created of the recommended type for the OS that is specified by the GuestId parameter. If the OSCustomizationSpec parameter is used, the virtual machine is customized according to the spec. You must specify values for at least one of the ResourcePool, VMHost, and VApp parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Template
VMHost Template
Specifies the host on which you want to create the new virtual machine. Specifies the virtual machine template you want to use for the creation of the new virtual machine. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies advanced options for creating virtual machines. Accepts only SdrsVMDiskAntiAffinityRule and SdrsVMAntiAffinityRule objects. The SdrsVMDiskAntiAffinityRule defines a Storage DRS intra-VM anti-affinity rule (vm disk anti-affinity rule). It is only applicable when creating a virtual machine or hard disk on a datastore cluster. An instance of the object is created by invoking its constructor. There are two constructors - "public SdrsVMDiskAntiAffinityRule(param string[] diskIdentifier)" and "public SdrsVMDiskAntiAffinityRule(param HardDisk[] disk)". For the first constructor, "diskIdentifier" can be either the disk key or the index of the disk in the disk array. The specified disks (and the disk to which the rule is applied) are placed in an antiaffinity rule on a DatastoreCluster. Only one such rule is supported per a virtual machine. You can pass the instance to the AdvancedOption parameter of the New-VM or New-HardDisk cmdlets. The SdrsVMAntiAffinityRule defines a Storage DRS inter-VM anti-affinity rule. It is only applicable when creating a virtual machine on a DatastoreCluster. An instance of the object is created by invoking its constructor. The constructor has one parameter - an array of virtual machines - "public SdrsVMAntiAffinityRule(param VirtualMachine[] vm)". Then, you can pass the instance to the AdvancedOption parameter of the New-VM cmdlet. This will place the new virtual machine and the virtual machines specified in the constructor in an inter-VM anti-affinity rule on a DatastoreCluster. The SDRS functionality is experimental.
false true
AdvancedOption
AdvancedOption[]
false
false
AlternateGuestName
String
Specifies the full OS name of the new virtual machine. Use this parameter if the GuestID parameter is set to otherGuest or otherGuest64. Indicates that you want to add a CD drive to the new virtual machine. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the datastore where you want to place the new virtual machine. If a DatastoreCluster is passed to the Datastore parameter, the virtual machine is placed in the DatastoreCluster in an automated SDRS mode and with enabled intra-VM affinity rule (unless another rule is specified). You
false
false
CD Confirm
SwitchParameter SwitchParameter
false false
Datastore
StorageResource
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
156/287
7/8/13
DiskGB
Decimal[]
Specifies the size in gigabytes (GB) of the disks that you want to create and add to the new virtual machine. This parameter is obsolete. Use DiskGB instead. Specifies the size in megabytes (MB) of the disks that you want to create and add to the new virtual machine. Specifies paths to virtual disks you want to add to the new virtual machine. Specifies the storage format of the disks of the virtual machine. This parameter accepts Thin, Thick, and EagerZeroedThick values. Specifies a DRS (Distributed Resource Scheduler) automation level. The valid values are FullyAutomated, Manual, PartiallyAutomated, AsSpecifiedByCluster, and Disabled. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifying this parameter is only supported when the virtual machine is inside a cluster. Otherwise, an error is generated. Indicates that you want to add a floppy drive to the new virtual machine. Specifies the guest operating system of the new virtual machine. The valid values for specific ESX versions are listed in the description of the VirtualMachineGuestOsIdentifier enumeration type in the vSphere API Reference available at http://www.vmware.com/support/developer/vcsdk/. Depending on the hardware configuration of the host, some of the guest operating systems might be inapplicable. Indicates whether the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. The available values are AsSpecifiedByCluster, PowerOff, and DoNothing. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifying this parameter is only supported when the virtual machine is inside a cluster. Otherwise, an error is generated. Specifies the HA restart priority of the new virtual machine. The valid values are Disabled, Low, Medium, High, and ClusterRestartPriority. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifiesing this parameter is only supported when the virtual machine is inside a cluster. Otherwise, an error is generated. Indicates that you want to create a linked clone. When you set the LinkedClone parameter, the ReferenceSnapshot parameter becomes mandatory. Specifies the folder where you want to place the new virtual machine. Specifies the memory size in gigabytes (GB) of the new virtual machine. This parameter is obsolete. Use MemoryGB instead. Specifies the memory size in megabytes (MB) of the new virtual machine. Specifies a name for the new virtual machine. If you are registering or cloning an existing virtual machine, this parameter is not mandatory. Specifies the networks to which you want to connect the new virtual machine. Specifying a distributed port group name is obsolete. Use the Portgroup parameter instead. Provides a description of the new virtual machine. The alias of this parameter is Description. Specifies the number of the virtual CPUs of the new virtual machine. Specifies a customization specification that is to be applied to the new virtual machine. This works only in 32-bit mode. Specifies standard or distributed port groups to which you want to connect the virtual machine. For each specified port group, a new network adapter is created. Specifies a source snapshot for the linked clone that you want to create. When you set the LinkedClone parameter, the ReferenceSnapshot parameter becomes mandatory. Specifies where you want to place the new virtual machine. The parameter accepts VMHost, Cluster,
false
false
DiskMB
Int64[]
false
false
4096
DiskPath DiskStorageFormat
String[] VirtualDiskStorageFormat
false false
false false
DrsAutomationLevel
DrsAutomationLevel
false
false
Floppy GuestId
SwitchParameter String
false false
false false
HAIsolationResponse
HAIsolationResponse
false
false
HARestartPriority
HARestartPriority
false
false
LinkedClone
SwitchParameter
false
false
Name
String
true
false
NetworkName
String[]
false
false
Portgroup
VirtualPortGroupBase[]
false
false
ReferenceSnapshot
Snapshot
false
false
ResourcePool
VIContainer
false
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
157/287
7/8/13
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. This parameter is deprecated. Use the ResourcePool parameter instead. Specifies the vApp where you want to create the new virtual machine. Specifies the version of the new virtual machine. The valid values are v4, v7, and v8. By default, the new virtual machine is created with the highest available version. Specifies a virtual machine to clone. Specifies a path to the virtual machine you want to register. Specifies the swapfile placement policy. The following values are valid: InHostDataStore - Stores the swapfile in the datastore specified by the VMSwapfileDatastoreID property of the virtual machine host. If the VMSwapfileDatastoreID property is not set or indicates a datastore with insufficient free space, the swapfile is stored in the same directory as the virtual machine. This setting might degrade the VMotion performance. WithVM - Stores the swapfile in the same directory as the virtual machine.
false
false
Server
VIServer[]
false
false
VApp
VApp
false
true (ByValue)
Version
VMVersion
false
false
VM VMFilePath VMSwapfilePolicy
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type The newly created VirtualMachine object Notes Applying customization specs works only in 32-bit mode. Examples -------------- Example 1 --------------
$ m y T a r g e t V M H o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MN a m eM y V M 1R e s o u r c e P o o l$ m y T a r g e t V M H o s tD a t a s t o r eM y D a t a s t o r e 1N u m C P U2M e m o r y G B4D i s k G B4 0N e t w o r k N a m e" V MN e t w o r k "F l o p p yC DD i s k S t o r a g e F o Creates a virtual machine by specifying a target host, a target datastore, and a network to connect to, and configures the settings for the virtual machine. -------------- Example 2 -------------$ m y C l u s t e r=G e t C l u s t e rN a m eM y C l u s t e r 1 N e w V MN a m eM y V M 1R e s o u r c e P o o l$ m y C l u s t e r Creates a virtual machine by specifying a cluster. The ResourcePool parameter accepts ResourcePool, Cluster, VApp, and standalone VMHost objects. -------------- Example 3 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y C l u s t e r=G e t C l u s t e rN a m eM y C l u s t e r 1 N e w V MN a m eM y V M 1V M H o s t$ v m h o s tR e s o u r c e P o o l$ m y C l u s t e rD i s k G B4M e m o r y G B1 Creates a virtual machine by specifying a cluster and explicitly selecting the host, instead of allowing auto-selection of a target host. -------------- Example 4 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MN a m eM y V M 1R e s o u r e P o o l$ v m h o s tD i s k G B4 0 , 1 0 0 Creates a virtual machine with multiple disks. -------------- Example 5 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MN a m eM y V M 1R e s o u r c e P o o l$ v m h o s tD i s k P a t h" [ S t o r a g e 1 ]W i n d o w s X P / W i n d o w s X P . v m d k " Creates a virtual machine by specifying an existing disk. -------------- Example 6 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MN a m eM y V M 1R e s o u r c e P o o l$ v m h o s tV e r s i o nv 4 Creates a virtual machine by explicitly specifying the version of the virtual machine hardware through the Version parameter. -------------- Example 7 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
158/287
7/8/13
$ m y D a t a s t o r e=G e t D a t a s t o r eN a m eM y D a t a s t o r e 1 $ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MN a m eM y V M 2V MM y V M 1D a t a s t o r e$ m y D a t a s t o r eV M H o s t$ v m h o s t Creates a new virtual machine named MyVM2 by cloning the MyVM1 virtual machine on the specified datastore and host. -------------- Example 8 -------------N e w V MV MM y V M 1 ,M y V M 2L o c a t i o nM y F o l d e r 1V M H o s tM y H o s t 1 Copies the MyVM1 and MyVM2 virtual machines to the MyFolder1 folder on the MyHost1 host. -------------- Example 9 -------------$ m y R e s o u r c e P o o l=G e t R e s o u r c e P o o lN a m eM y R e s o u r c e P o o l 1 $ m y S p e c i f i c a t i o n=G e t O S C u s t o m i z a t i o n S p e cN a m eW i n d o w s S p e c N e w V MV MM y V M 1N a m eM y V M 2O S C u s t o m i z a t i o n S p e c$ m y S p e c i f i c a t i o nR e s o u r c e P o o l$ m y R e s o u r c e P o o l Clones the virtual machine MyVM1 to MyVM2 and applies a customization specification on the cloned virtual machine. -------------- Example 10 -------------$ m y R e s o u r c e P o o l=G e t R e s o u r c e P o o lN a m eM y R e s o u r c e P o o l 1 $ m y T e m p l a t e=G e t T e m p l a t eN a m eW i n d o w s T e m p l a t e $ m y S p e c i f i c a t i o n=G e t O S C u s t o m i z a t i o n S p e cN a m eW i n d o w s S p e c N e w V MN a m eM y V M 2T e m p l a t e$ m y T e m p l a t eR e s o u r c e P o o l$ m y R e s o u r c e P o o lO S C u s t o m i z a t i o n S p e c$ m y S p e c i f i c a t i o n Creates a virtual machine from the specified template and applies the specified customization specification. -------------- Example 11 -------------c dv m s t o r e s : \ m y s e r v e r @ 4 4 3 \ D a t a c e n t e r \ S t o r a g e 1 \ M y V M 1 \ $ v m x F i l e=G e t I t e mM y V M 1 . v m x $ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MV M H o s t$ v m h o s tV M F i l e P a t h$ v m x F i l e . D a t a s t o r e F u l l P a t h Retrieves the specified configuration file for the MyVM1 virtual machine and registers the MyVM1 virtual machine on the specified host. -------------- Example 12 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r 1 N e w V MN a m eM y V M 1D i s k G B4 0 , 4 0D a t a s t o r e$ m y D a t a s t o r e C l u s t e rR e s o u r c e P o o l$ v m h o s t Creates a virtual machine on a datastore cluster. By default, the new virtual machine has an intra-VM affinity rule. -------------- Example 13 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r 1 $ m y A d v a n c e d O p t i o n=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M D i s k A n t i A f f i n i t y R u l e '1 , 2 N e w V MN a m eM y V M 1D i s k G B4 0 , 4 0 , 4 0D a t a s t o r e$ m y D a t a s t o r e C l u s t e rA d v a n c e d O p t i o n$ m y A d v a n c e d O p t i o nR e s o u r c e P o o l$ v m h o s t Creates a virtual machine on a datastore cluster. The machine has three hard disks. For the first two disks, intra-VM anti-affinity rule is specified and they will be placed on a datastore different from the datastore cluster. Identifying the hard disk in the Intra-VM anti-affinity happens by indexing the disks starting from 1. -------------- Example 14 -------------$ m y V M 1=G e t V MN a m eW i n d o w s X P $ m y R e s o u r c e P o o l=G e t R e s o u r c e P o o lN a m eM y R e s o u r c e P o o l 1 $ m y A d v a n c e d O p t i o n=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M A n t i A f f i n i t y R u l e '$ m y V M 1 $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r 1 N e w V MN a m eM y V M 1D i s k G B4 0 , 4 0 , 4 0D a t a s t o r e$ m y D a t a s t o r e C l u s t e rA d v a n c e d O p t i o n$ m y A d v a n c e d O p t i o nR e s o u r c e P o o l$ m y R e s o u r c e P o o l Creates a virtual machine on a datastore cluster and specifies a VM anti-affinity rule between the new virtual machine and an existing virtual machine. -------------- Example 15 -------------$ m y S o u r c e V M=G e t V MN a m eM y S o u r c e V M 1 $ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ h a r d D i s k L i s t=G e t H a r d D i s kV M$ v m|s e l e c tF i r s t2 $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r 1 $ m y A d v a n c e d O p t i o n=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M D i s k A n t i A f f i n i t y R u l e '$ h a r d D i s k L i s t N e w V MN a m eM y V M 1V M$ m y S o u r c e V MD a t a s t o r e$ m y D a t a s t o r e C l u s t e rA d v a n c e d O p t i o n$ m y A d v a n c e d O p t i o nR e s o u r c e P o o l$ v m h o s t Clones a virtual machine on a datastore cluster and specifies an intra-VM anti-affinity rule by using references to the hard disks of the source virtual machine. When you apply this rule to the AdvancedOption parameter of New-VM, the first and second disk of the new virtual machine will be placed on different datastores within the specified datastore cluster. -------------- Example 16 -------------$ m y S o u r c e V M=G e t V MN a m eM y S o u r c e V M 1 $ m y V M 1=G e t V MN a m eW i n d o w s X P $ m y A d v a n c e d O p t i o n=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M A n t i A f f i n i t y R u l e '$ m y V M 1 $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r 1 $ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 N e w V MN a m eM y V M 2V M$ m y S o u r c e V MD a t a s t o r e$ m y D a t a s t o r e C l u s t e rA d v a n c e d O p t i o n$ m y A d v a n c e d O p t i o nR e s o u r c e P o o l$ v m h o s t Clones a virtual machine on a datastore cluster and specifies a VM anti-afffinity rule between the new virtual machine and an existing virtual machine. When you apply this rule to the AdvancedOption parameter of New-VM, the new virtual machine and the WindowsXP virtual machine will be placed on different datastores within the specified datastore cluster. -------------- Example 17 -------------$ m y S o u r c e T e m p l a t e=G e t T e m p l a t eN a m eW i n d o w s T e m p l a t e $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r $ m y A d v a n c e d O p t i o n=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M D i s k A n t i A f f i n i t y R u l e '$ h a r d D i s k L i s t $ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
159/287
7/8/13
N e w V MN a m eM y V M 1T e m p l a t e$ m y S o u r c e T e m p l a t eD a t a s t o r e$ m y D a t a s t o r e C l u s t e rA d v a n c e d O p t i o n$ m y A d v a n c e d O p t i o nR e s o u r c e P o o l$ v m h o s t Creates a virtual machine from a template, specifies a VM anti-affinity rule, and stores the virtual machine on a specified datastore cluster. -------------- Example 18 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V M=G e t V MN a m eW i n d o w s X P $ m y S o u r c e T e m p l a t e=G e t T e m p l a t eN a m eW i n d o w s T e m p l a t e $ m y D a t a s t o r e C l u s t e r=G e t D a t a s t o r e C l u s t e rN a m eM y S t o r a g e C l u s t e r 1 $ m y A d v a n c e d O p t i o n=N e w O b j e c t' V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . D a t a s t o r e M a n a g e m e n t . S d r s V M A n t i A f f i n i t y R u l e '$ m y V M N e w V MN a m eV MT e m p l a t e$ m y S o u r c e T e m p l a t eD a t a s t o r e$ m y D a t a s t o r e C l u s t e rA d v a n c e d O p t i o n$ m y A d v a n c e d O p t i o nR e s o u r c e P o o l$ v m h o s t Creates a virtual machine from a template, specifies a VM anti-affinity rule, and stores the virtual machine on a specified datastore cluster. -------------- Example 19 -------------$ m y S o u r c e V M=G e t V MN a m eM y S o u r c e V M 1 $ m y R e f e r e n c e S n a p s h o t=G e t S n a p s h o tV M$ m y S o u r c e V MN a m e" I n i t i a l S t a t e " $ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y D a t a s t o r e=G e t D a t a s t o r eN a m eM y D a t a s t o r e 1 N e w V MN a m eM y L i n k e d C l o n e V M 1V M$ m y S o u r c e V ML i n k e d C l o n eR e f e r e n c e S n a p s h o t$ m y R e f e r e n c e S n a p s h o tR e s o u r c e P o o l$ v m h o s tD a t a s t o r e$ m y D a t a s t o r e Creates a linked clone from the specified snapshot of the parent virtual machine. The linked clone is stored to the specified VM host and datastore. -------------- Example 20 -------------$ m y C l u s t e r=G e t C l u s t e rN a m e" M y C l u s t e r " $ m y V D P o r t G r o u p=G e t V D P o r t g r o u pN a m e" M y V D P o r t G r o u p " $ m y S h a r e d D a t a s t o r e=G e t D a t a s t o r eN a m e" M y S h a r e d D a t a s t o r e " N e w V MN a m eM y V MR e s o u r c e P o o l$ m y C l u s t e rP o r t g r o u p$ m y V D P o r t G r o u pD i s k G B4 0M e m o r y G B4D a t a s t o r e$ m y S h a r e d D a t a s t o r e Creates a new virtual machine with the specified configuration and connects it to the specified distributed port group.
New-VMGuestRoute
Synopsis
This cmdlet adds a new route to the routing table of the provided virtual machines and guests. Syntax New-VMGuestRoute [-VM <VirtualMachine[]>] [-Destination] <IPAddress> [[-Netmask] <String>] [-Gateway] <IPAddress> [-Interface <Object>] [-VMGuest <VMGuest[]>] [-Server <VIServer[]>] [-ToolsWaitSecs <Int32>] [-GuestPassword <SecureString>] [-GuestUser <String>] [-GuestCredential <PSCredential>] [HostPassword <SecureString>] [-HostUser <String>] [-HostCredential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMGuestRoute Remove-VMGuestRoute Detailed Description This cmdlet adds a new route to the routing table of the provided virtual machines and guests. The cmdlet adds only persistent routes. This cmdlet supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a destination IP address for the new route. Specifies a network mask for the new route. Specifies a gateway for the new route. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a PSCredential object that contains credentials for authenticating with the guest OS. Do not use this parameter if the GuestUser and GuestPassword parameters are used. Specifies the password you want to use for authenticating with the guest OS. Specifies the user name you want to use for authenticating with the guest OS. Specifies a PSCredential object that contains credentials for authenticating with the host. Do not use this parameter if the HostUser and HostPassword parameters are used. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10.
GuestCredential
PSCredential
false
false
HostPassword
SecureString
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
160/287
7/8/13
HostUser String
Interface Server
Object VIServer[]
false false
false false
ToolsWaitSecs
Int32
false
false
The newly created VMGuestRoute object Notes Consider that New-VMGuestRoute might behave inconsistently and create diff erent types of routes depending on the OS type - Windows or Linux. This cmdlet is experimental and might be changed or removed in a future rel ease. Examples -------------- Example 1 -------------N e w V M G u e s t R o u t eG u e s t U s e ru s e rG u e s t P a s s w o r dp a s s 2V M$ v mD e s t i n a t i o n' 1 9 2 . 1 6 8 . 1 0 0 . 1 0 'N e t m a s k' 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5 'G a t e w a y' 1 0 . 2 3 . 1 1 2 . 5 8 ' Creates a new guest route with the specified parameters.
New-VMHostAccount
Synopsis
This cmdlet creates a new host user or group account. Syntax New-VMHostAccount [-Id] <String> [-Password] <String> [-Description <String>] [-UserAccount] [-AssignGroups <String[]>] [-GrantShellAccess] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] New-VMHostAccount [-Id] <String> [-GroupAccount] [-AssignUsers <String[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Set-VMHostAccount Get-VIAccount Remove-VMHostAccount Detailed Description This cmdlet creates a new host user or group account using the provided parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies an ID for the new host account. Specifies a password for the new host account. If the UserAccount parameter is set to $true, use AssignGroups to specify the groups to which the newly created user belongs. If the GroupAccount parameter is set to $true, use AssignUsers to specify the users that belong to the newly created group account. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Provide a description of the new host account. The maximum length of the text is 255 symbols. Indicates that the new account is allowed to access the ESX shell. Indicates that the new host account is a group account. Starting with ESXi 5.1, this parameter is not supported. Specifies the vCenter Server systems 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-VIServer. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Indicates that the new host account is a user account. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
SwitchParameter SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
161/287
7/8/13
Notes
Starting with ESXi 5.1, you cannot create group host accounts. Examples -------------- Example 1 -------------N e w V M H o s t A c c o u n tI DM y U s e r 1P a s s w o r dM y P a s s w o r d 1U s e r A c c o u n t Creates a user account with a specified user ID and password. The user account is created on the default server. -------------- Example 2 -------------$ m y U s e r 1=G e t V M H o s t A c c o u n tI DM y U s e r 1U s e r N e w V M H o s t A c c o u n tI dM y G r o u p 1G r o u p A c c o u n tA s s i g n U s e r s$ m y U s e r 1 Creates a group account with a specified ID and assigns a specified user to the group account. Starting with ESXi 5.1, you cannot create group host accounts.
New-VMHostNetworkAdapter
Synopsis
This cmdlet creates a new HostVirtualNIC (Service Console or VMKernel) on the specified host. Syntax New-VMHostNetworkAdapter [[-VMHost] <VMHost>] [[-PortGroup] <String>] [-PortId <String>] [-VirtualSwitch] <VirtualSwitchBase> [[-IP] <String>] [[-SubnetMask] <String>] [[-Mac] <String>] [-Mtu <Int32>] [-ConsoleNic] [-VMotionEnabled [<Boolean>]] [-FaultToleranceLoggingEnabled [<Boolean>]] [-IPv6ThroughDhcp] [AutomaticIPv6] [-IPv6 <String[]>] [-ManagementTrafficEnabled [<Boolean>]] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Remove-VMHostNetworkAdapter Set-VMHostNetworkAdapter Detailed Description This cmdlet creates a new HostVirtualNIC (Service Console or VMKernel) on the specified host. Creates a port group with a name specified by the PortGroup parameter on the virtual switch passed through the VirtualSwitch parameter. Adds either a Console NIC if ConsoleNIC is set, or a VMKernel NIC otherwise. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost
VMHost
Specifies the host to which you want to add the new adapter. This parameter is mandatory when creating a network adapter on a distributed switch. Specifies the port group to which you want to add the new adapter. If the port group is nonexistent, a new port group with the specified name will be created and the new adapter will be added to the port group. Specifies the virtual switch to which you want to add the new network adapter. Specifies an IP address for the new network adapter. All IP addresses are specified using IPv4 dot notation. If IP is not specified, DHCP mode is enabled. For VMKernel network adapters, the DHCP mode is supported only on vCenter Server 4.0, ESX 4.0, and later. Specifies a subnet mask for the new network adapter. Specifies a media access control (MAC) address for the new virtual network adapter. Indicates that the IPv6 address is obtained through a router advertisement. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. If the value is $true, indicates that you want to create a service console virtual network adapter. If the value is $false, indicates that you want to create a virtual host/VMkernel network adapter. Not supported on ESXi. Indicates that the network adapter is enabled for Fault Tolerance (FT) logging. This parameter is supported only on ESX/vCenter Server 4.0 and later. Specifies multiple static addresses using the following format: <IPv6>/<subnet_prefix_length> or <IPv6>. If you skip <subnet_prefix_length>, the default value of 64 is used. Indicates that the IPv6 address is obtained through DHCP. Indicates that you want to enable the network adapter for traffic management. This parameter is supported only on ESX/ESXi/vCenter Server 4.0.
false
true (ByValue)
PortGroup
String
false
false
VirtualSwitch IP
VirtualSwitchBase String
true false
false false
ConsoleNic
SwitchParameter
false
false
FaultToleranceLoggingEnabled
Boolean
false
false
IPv6
String[]
false
false
IPv6ThroughDhcp ManagementTrafficEnabled
SwitchParameter Boolean
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
162/287
7/8/13
Mtu Int32
PortId
String
false
false
Server
VIServer[]
false
false
VMotionEnabled WhatIf
Boolean SwitchParameter
false false
false false
Return Type The newly created HostVirtualNic object Notes To configure IPv6 settings, you must be working on ESX 4.0 or later and IPv 6 must be enabled on the ESX system. Examples -------------- Example 1 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s t$ v m h o s tN a m eM y V i r t u a l S w i t c h 1 N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ v m h o s tP o r t G r o u pM y V M K e r n e l P o r t G r o u p 1V i r t u a l S w i t c h$ m y V i r t u a l S w i t c hM t u4 0 0 0 Creates a VMKernel port group at the MyVirtualSwitch1 virtual switch. The IP address is obtained via DHCP. -------------- Example 2 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s t$ v m h o s tN a m eM y V i r t u a l S w i t c h 1 N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ v m h o s tP o r t G r o u pM y V M K e r n e l P o r t G r o u p 1V i r t u a l S w i t c h$ m y V i r t u a l S w i t c hI P1 9 2 . 1 6 8 . 1 6 8 . 1 1 0S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0 Creates a VMKernel port group at the MyVirtualSwitch1 virtual switch and assigns a static IP address. -------------- Example 3 --------------
$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s t$ v m h o s tN a m eM y V i r t u a l S w i t c h 1 N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ v m h o s tV i r t u a l S w i t c h$ m y V i r t u a l S w i t c hP o r t G r o u pM y V M K e r n e l P o r t G r o u p 1I P1 9 2 . 1 6 8 . 0 . 1S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0I P v 6" 0 2 0 0 Creates a VMKernel NIC that has an IPv4 address and an IPv6 address. -------------- Example 4 --------------
$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s t$ v m h o s tN a m eM y V i r t u a l S w i t c h 1 N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ v m h o s tV i r t u a l S w i t c h$ m y V i r t u a l S w i t c hP o r t G r o u pM y V M K e r n e l P o r t G r o u p 1I P1 9 2 . 1 6 8 . 0 . 1S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0A u t o m a t i c I Creates a VMKernel NIC that obtains IPv6 automatically (by router advertisement) and takes the desired IPv4 address. -------------- Example 5 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s t$ v m h o s tN a m eM y V i r t u a l S w i t c h 1 N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ v m h o s tV i r t u a l S w i t c h$ m y V i r t u a l S w i t c hP o r t G r o u pM y V M K e r n e l P o r t G r o u p 1I P v 6 T h r o u g h D h c p Creates a VMKernel NIC that obtains the IPv4 and IPv6 addresses by DHCP. -------------- Example 6 -------------$ v m h o s t=G e t V M H o s tN a m eM y V M H o s t 1 $ m y V i r t u a l S w i t c h=G e t V i r t u a l S w i t c hV M H o s t$ v m h o s tN a m eM y V i r t u a l S w i t c h 1 N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ v m h o s tP o r t G r o u pM y C o n s o l e P o r t G r o u p 1V i r t u a l S w i t c h$ m y V i r t u a l S w i t c hC o n s o l e N i c Creates a Service Console port group at the vSwitch virtual switch. The IP address is obtained via DHCP. -------------- Example 7 -------------$ m y V M H o s t=G e t V M H o s tN a m e" M y V M H o s t " $ m y V D S w i t c h=G e t V D S w i t c hN a m e" M y V D S w i t c h " N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ m y V M H o s tP o r t G r o u p" M y V D P o r t g r o u p "V i r t u a l S w i t c h$ m y V D S w i t c hI P1 9 2 . 1 6 8 . 0 . 5 0S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0 Creates a new VMKernel network adapter and connects it to the specified port group on the specified distributed switch. -------------- Example 8 -------------$ m y V M H o s t=G e t V M H o s tN a m e" M y V M H o s t " $ m y V D S w i t c h=G e t V D S w i t c hN a m e" M y V D S w i t c h " N e w V M H o s t N e t w o r k A d a p t e rV M H o s t$ m y V M H o s tV i r t u a l S w i t c h$ m y V D S w i t c hP o r t I d1 0 0I P1 9 2 . 1 6 8 . 0 . 5 0S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0 Creates a new VMKernel network adapter and connects it to a specified port on a specified distributed switch.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
163/287
7/8/13
New-VMHostProfile
Synopsis
This cmdlet creates a new host profile based on a reference host. Syntax New-VMHostProfile [-Name] <String> [-ReferenceHost] <VMHost> [-Description <String>] [-CompatibilityMode] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Export-VMHostProfile Get-VMHostProfile Import-VMHostProfile Remove-VMHostProfile Set-VMHostProfile Test-VMHostProfileCompliance Detailed Description This cmdlet creates a new host profile based on a reference host. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a name for the new host profile. Specifies the reference host, on which the new virtual machine host profile is based. If you are connected to a vCenter Server/ESX 5.0 or later, use this parameter to indicate that you want the new profile to be compatible with hosts running ESX/vCenter Server versions earlier than 5.0. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Provides a description for the new host profile. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
Description Server
String VIServer[]
false false
SwitchParameter
false
false
The newly created VMHostProfile object Notes Examples -------------- Example 1 -------------$ h=G e t V M H o s t1 0 . 2 3 . 1 3 4 . 1 3 3 N e w V M H o s t P r o f i l eN a m et e s t P r o f i l eD e s c r i p t i o n" T h i si sm yf i r s tt e s tp r o f i l e . "R e f e r e n c e H o s t$ h Creates a profile based on the virtual machine host with an IP address 10.23.134.133.
New-VMHostRoute
Synopsis
This cmdlet creates a new route in the routing table of a host. Syntax New-VMHostRoute [-VMHost] <VMHost[]> -Destination <IPAddress> -Gateway <IPAddress> -PrefixLength <Int32> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostRoute Remove-VMHostRoute Set-VMHostRoute Detailed Description This cmdlet creates a new route in the routing table of a host. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the host for which you want to create a new route. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a destination IP address for the new route.
true false
Destination
IPAddress
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
164/287
7/8/13
Gateway PrefixLength Server IPAddress Int32 VIServer[]
SwitchParameter
false
false
The one or more newly created VMHostRoute objects Notes Supported only on ESX 4.0/ vCenter Server 4.0 and later. Examples -------------- Example 1 -------------N e w V M H o s t R o u t eV M H o s t1 0 . 2 3 . 1 1 4 . 1 9 5D e s t i n a t i o n1 9 2 . 1 6 8 . 1 0 3 . 1 0 2P r e f i x L e n g t h3 2G a t e w a y1 0 . 2 3 . 8 4 . 5 3 Creates a route for the specified host.
Remove-AdvancedSetting
Synopsis
This cmdlet removes the specified advanced setting. Syntax Remove-AdvancedSetting [-AdvancedSetting] <AdvancedSetting[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AdvancedSetting New-AdvancedSetting Set-AdvancedSetting Detailed Description This cmdlet removes the specified advanced setting. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AdvancedSetting Confirm
AdvancedSetting[] SwitchParameter
Specifies the advanced settings you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
-------------- Example 1 -------------G e t A d v a n c e d S e t t i n gE n t i t y( G e t C l u s t e rN a m eC l u s t e r )|R e m o v e A d v a n c e d S e t t i n gC o n f i r m : $ f a l s e Removes the advanced settings of the cluster named Cluster.
Remove-AlarmAction
Synopsis
This cmdlet removes an alarm action. Syntax Remove-AlarmAction [-AlarmAction] <AlarmAction[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AlarmAction Get-AlarmActionTrigger Get-AlarmDefinition New-AlarmAction New-AlarmActionTrigger Remove-AlarmActionTrigger Set-AlarmDefinition
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
165/287
7/8/13
Detailed Description This cmdlet removes an alarm action. Parameters
NA ME TYPE DESCRIPTION
REQUIRED?
PIPELINE INPUT
AlarmAction Confirm
AlarmAction[] SwitchParameter
Specifies the alarm actions you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
-------------- Example 1 -------------G e t A l a r m D e f i n i t i o nN a m e" A l a r m 1 "|G e t A l a r m A c t i o n|R e m o v e A l a r m A c t i o nC o n f i r m : $ f a l s e Removes all actions for an alarm definition.
Remove-AlarmActionTrigger
Synopsis
This cmdlet removes the alarm action triggers. Syntax Remove-AlarmActionTrigger [-AlarmActionTrigger] <AlarmActionTrigger[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AlarmAction Get-AlarmActionTrigger Get-AlarmDefinition New-AlarmAction New-AlarmActionTrigger Remove-AlarmAction Set-AlarmDefinition Detailed Description This cmdlet removes the selected alarm action triggers. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AlarmActionTrigger Confirm
AlarmActionTrigger[] SwitchParameter
Specifies the alarm action triggers you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t A l a r m D e f i n i t i o nN a m e" A l a r m 1 "|G e t A l a r m A c t i o n|G e t A l a r m A c t i o n T r i g g e r|s e l e c tF i r s t1|R e m o v e A l a r m A c t i o n T r i g g e rC o n f i r m : $ f a l s e Removes the first action trigger found for an alarm definition.
Remove-CDDrive
Synopsis
This cmdlet removes virtual CD drives from their locations. Syntax Remove-CDDrive [-CD] <CDDrive[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CDDrive New-CDDrive
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
166/287
7/8/13
Set-CDDrive Detailed Description This cmdlet removes virtual CD drives from their locations. Parameters
NA ME TYPE DESCRIPTION
REQUIRED?
PIPELINE INPUT
CD Confirm
CDDrive[] SwitchParameter
Specifies the virtual CD drives you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ c d=G e t C D D r i v eV M$ v mT e m p l a t e$ t e m p l a t e R e m o v e C D D r i v eC D$ c d Removes all CD drives for the specified virtual machines and templates.
Remove-CIAccessControlRule
Synopsis
This cmdlet removes the specified access control rule. Syntax Remove-CIAccessControlRule [-AccessControlRule] <CIAccessControlRule[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIAccessControlRule New-CIAccessControlRule Set-CIAccessControlRule Detailed Description This cmdlet removes the specified access control rule. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AccessControlRule Confirm
CIAccessControlRule[] SwitchParameter
Specifies the access control rule that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t C I A c c e s s L e v e l R u l eE n t i t y' M y V A p p '|R e m o v e C I A c c e s s C o n t r o l R u l e Removes all access control rules that exist for the vApp named MyVApp.
Remove-CIVApp
Synopsis
This cmdlet removes vApps from the cloud. Syntax Remove-CIVApp [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
167/287
7/8/13
New-CIVApp Restart-CIVApp Set-CIVApp Start-CIVApp Stop-CIVApp Suspend-CIVApp Detailed Description This cmdlet removes vApps from the cloud. Parameters
NA ME TYPE DESCRIPTION
REQUIRED?
PIPELINE INPUT
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
Remove-CIVAppNetwork
Synopsis
This cmdlet removes the specified vApp networks if they are not in use. Syntax Remove-CIVAppNetwork [-VAppNetwork] <CIVAppNetwork[]> [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVAppNetwork New-CIVAppNetwork Set-CIVAppNetwork Detailed Description This cmdlet removes the specified vApp network if they are not in use. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VAppNetwork Confirm
CIVAppNetwork[] SwitchParameter
Specifies the vApp networks that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------G e t C I V A p pN a m e' M y V A p p '|G e t C I V A p p N e t w o r k|R e m o v e C I V A p p N e t w o r k Remove all vApp networks for the specified vApp.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
168/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Remove-CIVAppTemplate
Synopsis
This cmdlet removes the specified vApp template. Syntax Remove-CIVAppTemplate [-VAppTemplate] <CIVAppTemplate[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Import-CIVAppTemplate New-CIVAppTemplate Set-CIVAppTemplate Get-CIVAppTemplate Detailed Description This cmdlet removes the specified vApp template. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VAppTemplate Confirm
CIVAppTemplate[] SwitchParameter
Specifies the vApp template that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------$ c i C o n n e c t i o n=C o n n e c t C I S e r v e rS e r v e rc l o u d . e x a m p l e . c o mN a m eM y A d m i nP a s s w o r dM y P a s s w o r d R e m o v e V A p p T e m p l a t eR u n A s y n cV A p p T e m p l a t e' M y V A p p * 'S e r v e r$ c i C o n n e c t i o n Removes asynchronously all vApp templates with names starting with MyVApp. -------------- Example 2 -------------G e t C I V A p p T e m p l a t eN a m e' M y T e m p l a t e 'C a t a l o g( G e t C a t a l o g' M y C a t a l o g ' )|R e m o v e C I V A p p T e m p l a t e Removes the specified template from the specified catalog
Remove-Cluster
Synopsis
This cmdlet deletes the specified clusters. Syntax Remove-Cluster [-Cluster] <Cluster[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Cluster Move-Cluster New-Cluster Set-Cluster Detailed Description This cmdlet deletes the specified clusters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Cluster Confirm
Cluster[] SwitchParameter
Specifies the clusters you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task
true false
RunAsync
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
169/287
7/8/13
Server
VIServer[]
Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
SwitchParameter
false
false
-------------- Example 1 -------------$ c l u s t e r= N e w C l u s t e rN a m eC l u s t e rL o c a t i o nD a t a c e n t e r R e m o v e C l u s t e r$ c l u s t e rC o n f i r m : $ f a l s e Creates and then removes, without asking for user confirmation, the Custer cluster on the Datacenter datacenter.
Remove-CustomAttribute
Synopsis
This cmdlet removes custom attributes. Syntax Remove-CustomAttribute [-CustomAttribute] <CustomAttribute[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CustomAttribute New-CustomAttribute Set-CustomAttribute Get-Annotation Set-Annotation Detailed Description This cmdlet removes custom attributes. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
CustomAttribute Confirm
CustomAttribute[] SwitchParameter
Specifies the custom attributes you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e C u s t o m A t t r i b u t eC u s t o m A t t r i b u t e" C o m p a n y I D " ," O w n e r "S e r v e r$ a g e n t 0 0 7 Removes the CompanyID and Owner custom attributes from the server stored in the $agent007 variable.
Remove-CustomField
Synopsis
This cmdlet deletes the specified custom fields for the specified type of inventory items. Syntax Remove-CustomField [-Entity] <InventoryItem> [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-CustomField Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
170/287
7/8/13
Parameters
NA ME TYPE DESCRIPTION
This cmdlet is deprecated and scheduled for removal. Deletes the specified custom fields for the specified type of inventory items.
REQUIRED?
PIPELINE INPUT
Specifies the inventory items to which the custom field you want to remove belongs. Specifies the names of the custom fields you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------R e m o v e C u s t o m F i e l dE n t i t yV MN a m eC P U M a x L o a d Removes the custom field CPUMaxLoad from the virtual machine named VM. Asks for confirmation before running the task. The command returns the virtual machine VM, from which the custom field is removed.
Remove-Datacenter
Synopsis
This cmdlet removes the specified datacenters from their locations. Syntax Remove-Datacenter [-Datacenter] <Datacenter[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Datacenter New-Datacenter Move-Datacenter Set-Datacenter Detailed Description This cmdlet removes the specified datacenters and their children objects from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Datacenter Confirm
Datacenter[] SwitchParameter
Specifies the datacenters you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e D a t a c e n t e rD a t a c e n t e r Removes the Datacenter datacenter. -------------- Example 2 -------------$ t a s k=R e m o v e D a t a c e n t e rD a t a c e n t e rR u n A s y n c Asynchronously removes Datacenter08.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
171/287
7/8/13
Remove-Datastore
Synopsis
This cmdlet removes the specified datastores from their locations. Syntax Remove-Datastore [-Datastore] <Datastore[]> [-VMHost] <VMHost> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Datastore New-Datastore Set-Datastore Move-Datastore Detailed Description This cmdlet removes the specified datastores from their locations. The cmdlet permanently deletes the content of the removed datastores, unless they are shared (NFS). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the datastores you want to remove. Specifies the host to which the datastore you want to remove belongs. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e D a t a s t o r eD a t a s t o r eD a t a s t o r eV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4C o n f i r m : $ f a l s e Removes the Datastore datastore from the host.
Remove-DatastoreCluster
Synopsis
This cmdlet deletes the specified datastore clusters. Syntax Remove-DatastoreCluster [-DatastoreCluster] <DatastoreCluster[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-DatastoreCluster New-DatastoreCluster Set-DatastoreCluster Detailed Description This cmdlet deletes the specified datastore clusters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DatastoreCluster Confirm
DatastoreCluster[] SwitchParameter
Specifies the datastore cluster that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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 ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
172/287
7/8/13
Examples -------------- Example 1 --------------
G e t D a t a s t o r e C l u s t e rN a m e' M y D a t a s t o r e C l u s t e r '|R e m o v e D a t a s t o r e C l u s t e rC o n f i r m$ f a l s e Removes the specified datastore cluster without asking for confirmation.
Remove-DeployRule
Synopsis
Removes a rule from the working rule set. Syntax Remove-DeployRule [-DeployRule] <DeployRule[]> [-Delete] [-NoActivate] [<CommonParameters>] Remove-DeployRule [-At] <UInt32> [-Delete] [-NoActivate] [<CommonParameters>] Related Commands Add-DeployRule Detailed Description Removes a rule from the working rule set. By default, the working rule set is then activated. Use the "-Delete" parameter to permanently delete the rule from the Auto Deploy server. You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to remove a rule from the rule set and the "AutoDeploy.Rule.Delete" privilege to delete the rule. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
UInt32 DeployRule[]
Index in the rule set that you want to remove. Rule to remove from the working rule set. Delete the rule object. This flag will permanently delete the rule from the AutoDeploy server and remove it from any RuleSets that it was in.
SwitchParameter
Specify this parameter to only remove the rule to the working rule set. By default, the working rule set is activated after the change.
Remove-DrsRule
Synopsis
This cmdlet removes the specified DRS rules. Syntax Remove-DrsRule [-Rule] <DrsRule[]> [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-DrsRule New-DrsRule Set-DrsRule Detailed Description This cmdlet removes the specified DRS rules. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Rule Confirm
DrsRule[] SwitchParameter
Specifies the DRS rules you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
173/287
7/8/13
Notes Examples -------------- Example 1 --------------
$ r u l e s=G e t D r s R u l eC l u s t e r$ c l u s t e rN a m e" * R u l e 1 * " R e m o v e D r s R u l e$ r u l e sC o n f i r m : $ f a l s e Removes the DRS rules for the $cluster cluster, whose names contain "Rule1".
Remove-EsxSoftwareDepot
Synopsis
Syntax Remove-EsxSoftwareDepot [-SoftwareDepot] <SoftwareDepot[]> [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>] Related Commands Detailed Description Disconnects the current PowerCLI session from the specified software depots. Updates the $DefaultSoftwareDepots session variable. The depots and their VIBs and image profiles will no longer be available. If you do not specify the -SoftwareDepot parameter, PowerCLI prompts for an answer. You can type in the URL of the depot you wish to disconnect from. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
SoftwareDepot
SoftwareDepot[]
(Pipeline input, prompt) Takes one of the following forms: * URL string of the depot to remove * Single instance of a SoftwareDepot object, as returned by Add-EsxSoftwareDepot * List of SoftwareDepot objects or URL strings The depot must be connected to the session. If you specify a depot that is not connected to the session, an error message results.
true
ActionPreference String
false false
false false
---------- Example 1 ---------A d d E s x S o f t w a r e D e p o th t t p : / / w w w . v m w a r e . c o m / g o / E S X i / p a t c h e s / [ . . .d os o m e t h i n g. . . ] R e m o v e E s x S o f t w a r e D e p o th t t p : / / w w w . v m w a r e . c o m / g o / E S X i / p a t c h e s / Connect to a depot, then disconnect from it by URL. ---------- Example 2 ---------$ d e p o t=A d d E s x S o f t w a r e D e p o th t t p : / / w w w . v m w a r e . c o m / g o / E S X i / p a t c h e s / [ . . .d os o m e t h i n g. . . ] $ d e p o t|R e m o v e E s x S o f t w a r e D e p o t Connect to a depot, saving it to a variable, then disconnect from it later. Also an example of pipeline input. ---------- Example 3 ---------R e m o v e E s x S o f t w a r e D e p o t$ D e f a u l t S o f t w a r e D e p o t s Disconnect from all software depots
Remove-EsxSoftwarePackage
Synopsis
Syntax Remove-EsxSoftwarePackage [-ImageProfile] <ImageProfile> [-SoftwarePackage] <SoftwarePackage[]> [-Force] [-WarningAction <ActionPreference>] [WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
174/287
7/8/13
Removes existing packages from an image profile. The output of this cmdlet is an image profile object that you can pipe into any other cmdlet taking image profiles as input. You cannot modify an image profile if its ReadOnly property is true. ImageBuilder runs the modified image profile through all image profile validation tests. The modified image profile must have at least a boot kernel so that it can boot. You cannot remove a package if another package depends on it. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ImageProfile
ImageProfile
(pipeline input, prompt) Specifies the image profile to edit. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or the Name property of any ImageProfile object *ImageProfile object
true
SoftwarePackage
SoftwarePackage[]
List of software packages to remove from the profile. Specify packages that exist in the profiel. You can specify one or more SoftwarePackage objects, or strings representing package names.
true
---------- Example 1 ---------R e m o v e E s x S o f t w a r e P a c k a g eI m a g e P r o f i l e" M yc u s t o mp r o f i l e "S o f t w a r e P a c k a g ef o o Remove package foo from my custom profile:
Remove-FloppyDrive
Synopsis
This cmdlet removes the virtual floppy drives from their locations. Syntax Remove-FloppyDrive [-Floppy] <FloppyDrive[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-FloppyDrive New-FloppyDrive Set-FloppyDrive Detailed Description This cmdlet removes the virtual floppy drives from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Floppy Confirm
FloppyDrive[] SwitchParameter
Specifies the virtual floppy drives you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ f l o p p y=G e t F l o p p y D r i v eV MV M R e m o v e F l o p p y D r i v eF l o p p y$ f l o p p y Removes the floppy drive of the virtual machine named VM.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
175/287
7/8/13
Remove-Folder
Synopsis
This cmdlet removes the specified folders from their locations. Syntax Remove-Folder [-Folder] <Folder[]> [-DeletePermanently] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Folder Move-Folder New-Folder Set-Folder Detailed Description This cmdlet removes the specified folders and their children objects from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Folder Confirm
Folder[] SwitchParameter
Specifies the folders you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to delete from the disk any virtual machines contained in the specified folder, and not only to remove them from the inventory. This parameter is supported only for VirtualMachine folders. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
DeletePermanently
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e F o l d e rF o l d e r" t e s t F o l d e r " Removes a folder by name. -------------- Example 2 -------------G e t F o l d e rN a m e" t e s t F o l d e r "|R e m o v e F o l d e r Removes a folder by object. -------------- Example 3 -------------G e t F o l d e rN a m e" t e s t F o l d e r "|R e m o v e F o l d e rD e l e t e P e r m a n e n t l y Permanently removes a folder.
Remove-HardDisk
Synopsis
This cmdlet removes the specified virtual hard disks. Syntax Remove-HardDisk [-HardDisk] <HardDisk[]> [-DeletePermanently] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Copy-HardDisk Get-HardDisk New-HardDisk Set-HardDisk Move-HardDisk Detailed Description This cmdlet removes the specified virtual hard disks. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HardDisk Confirm
HardDisk[] SwitchParameter
Specifies the hard disks you want to remove. If the value is $true, indicates that the cmdlet asks for
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
176/287
7/8/13
SwitchParameter SwitchParameter
Indicates that you want to delete the hard disks not only from the inventory, but from the datastore as well. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
false false
-------------- Example 1 -------------G e t H a r d D i s kV M$ v m|R e m o v e H a r d D i s k Removes the hard disks of the virtual machine stored in the $vm variable.
Remove-Inventory
Synopsis
This cmdlet removes the specified inventory items from their locations. Syntax Remove-Inventory [-Item] <InventoryItem[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Inventory Move-Inventory Detailed Description This cmdlet removes the specified inventory items and their children from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Item
InventoryItem[]
Specifies the inventory items you want to remove. This parameter accepts Folder, ResourcePool, Datacenter, VirtualMachine, VMHost, Cluster, Template, and VApp objects. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
Confirm
SwitchParameter
false
false
$true
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------G e t F o l d e rF o l d e r |G e t I n v e n t o r yN o R e c u r s i o n|R e m o v e I n v e n t o r y Removes all objects from the Folder folder.
Remove-IScsiHbaTarget
Synopsis
This cmdlet removes targets from their iSCSI HBAs. Syntax Remove-IScsiHbaTarget [-Target] <IScsiHbaTarget[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-IScsiHbaTarget New-IScsiHbaTarget Set-IScsiHbaTarget
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
177/287
7/8/13
Get-VMHostHba Set-VMHostHba Detailed Description This cmdlet removes targets from their iSCSI HBAs. Parameters
NA ME TYPE DESCRIPTION
REQUIRED?
PIPELINE INPUT
Target Confirm
IScsiHbaTarget[] SwitchParameter
Specifies the iSCSI HBA targets you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t I S c s i H b a T a r g e tA d d r e s s1 0 . 2 3 . 8 4 . 7 3T y p eS e n d|R e m o v e I S c s i H b a T a r g e t Retrieves and removes the targets of type Send on the specified address. -------------- Example 2 -------------R e m o v e I S c s i H b a T a r g e tT a r g e t( G e t I S c s i H b a T a r g e tA d d r e s s1 0 . 2 3 . 8 4 . 7 3 ) Removes the specified iSCSI HBA targets.
Remove-NetworkAdapter
Synopsis
This cmdlet removes the virtual network adapters from their locations. Syntax Remove-NetworkAdapter [-NetworkAdapter] <NetworkAdapter[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-NetworkAdapter New-NetworkAdapter Set-NetworkAdapter Detailed Description This cmdlet removes the virtual network adapters from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
NetworkAdapter Confirm
NetworkAdapter[] SwitchParameter
Specifies the virtual network adapters you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
-------------- Example 1 -------------$ n i c=G e t N e t w o r k A d a p t e rV MV M R e m o v e N e t w o r k A d a p t e rN e t w o r k A d a p t e r$ n i c Removes the network adapter of the VM virtual machine.
Remove-Org
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
178/287
7/8/13
Synopsis
This cmdlet removes the specified organization. Syntax Remove-Org [-Org] <Org[]> [-Force] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-Org Set-Org Get-Org Detailed Description This cmdlet removes the specified organization. The organization must be disabled and must not contain any child objects. To automatically disable the organization before removal, set the Force parameter. Note: This cmdlet is only availabe to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Org Confirm
Org[] SwitchParameter
Specifies the organization that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the organization will be removed even if it is enabled. Setting the Force parameter will automatically disable the organization if it is enabled. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Force
SwitchParameter
false
false
Server
CIServer[]
false
false
$defaultCIServers
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t O r g" M y O r g "|R e m o v e O r g Removes the MyOrg organization. -------------- Example 2 -------------G e t O r g" M y E n a b l e d O r g "|R e m o v e O r gF o r c e Removes an enabled organization by automatically disabling it before deletion. -------------- Example 3 -------------R e m o v e O r gO r g" M y O r g * " Removes all disabled organizations that have names starting with "MyOrg".
Remove-OrgNetwork
Synopsis
This cmdlet deletes the specified organization network. Syntax Remove-OrgNetwork [-OrgNetwork] <OrgNetwork[]> [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OrgNetwork New-OrgNetwork Set-OrgNetwork Detailed Description This cmdlet deletes the specified organization network. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OrgNetwork Confirm
OrgNetwork[] SwitchParameter
Specifies the organization network that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
179/287
7/8/13
WhatIf Return Type None Notes Examples -------------- Example 1 -------------SwitchParameter
G e t O r g N e t w o r kN a m e' M y O r g N e t w o r k '|R e m o v e O r g N e t w o r k Removes the specified organization network. -------------- Example 2 -------------G e t O r g N e t w o r kN a m e' M y O r g N e t w o r k '|R e m o v e O r g N e t w o r kR u n A s y n c Removes the specified organization network asynchronously.
Remove-OrgVdc
Synopsis
This cmdlet removes organization virtual datacenters (vDCs). Syntax Remove-OrgVdc [-OrgVdc] <OrgVdc[]> [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OrgVdc New-OrgVdc Remove-OrgVdc Detailed Description This cmdlet removes organization virtual datacenters (vDCs). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OrgVdc Confirm
OrgVdc[] SwitchParameter
Specifies the organization vDC that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------G e t O r g V d c" M y O r g V d c "|R e m o v e O r g V d c Removes the organization vDC named MyOrgVdc.
Remove-OSCustomizationNicMapping
Synopsis
This cmdlet removes the specified OS customization NIC mappings. Syntax Remove-OSCustomizationNicMapping [-OSCustomizationNicMapping] <OSCustomizationNicMapping[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
180/287
7/8/13
Get-OSCustomizationNicMapping New-OSCustomizationNicMapping Set-OSCustomizationNicMapping Detailed Description
OSCustomizationNicMapping
OSCustomizationNicMapping[]
Specifies the OSCustomizationNicMapping objects you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
Confirm
SwitchParameter
false
false
$true
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ n i c M a p p i n g=G e t O S C u s t o m i z a t i o nM y C u s t o m i z a t i o n S p e c|G e t O S C u s t o m i z a t i o n N i c M a p p i n g R e m o v e O S C u s t o m i z a t i o n N i c M a p p i n g$ n i c M a p p i n gC o n f i r m : $ f a l s e Removes the NIC mappings of the specified OS customization spec without asking for confirmation.
Remove-OSCustomizationSpec
Synopsis
This cmdlet removes the specified OS customization specifications. Syntax Remove-OSCustomizationSpec [-OSCustomizationSpec] <OSCustomizationSpec[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OSCustomizationSpec New-OSCustomizationSpec Set-OSCustomizationSpec Detailed Description This cmdlet removes the specified OS customization specifications. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OSCustomizationSpec Confirm
OSCustomizationSpec[] SwitchParameter
Specifies the customization specifications you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------R e m o v e O S C u s t o m i z a t i o n S p e cS p e cC o n f i r m Removes the Spec OS customization specification from the server.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
181/287
7/8/13
Remove-PassthroughDevice
Synopsis
This cmdlet removes the specified pass-through devices. Syntax Remove-PassthroughDevice [-PassthroughDevice] <PassThroughDevice[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-PassthroughDevice Get-PassthroughDevice Detailed Description This cmdlet removes the specified pass-through devices. You can remove only those pass-through devices that are retrieved from virtual machines. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
PassthroughDevice
PassThroughDevice[]
Specifies the pass-through devices you want to remove. You can remove only those pass-through devices that are retrieved from virtual machines. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
Confirm
SwitchParameter
false
false
$true
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t P a s s t h r o u g h D e v i c eV MV M|R e m o v e P a s s t h r o u g h D e v i c e Removes all pass-through devices of the VM virtual machine.
Remove-ResourcePool
Synopsis
This cmdlet removes the specified resource pools from their locations. Syntax Remove-ResourcePool [-ResourcePool] <ResourcePool[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ResourcePool Move-ResourcePool New-ResourcePool Set-ResourcePool Detailed Description This cmdlet removes the specified resource pools and their children objects from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ResourcePool Confirm
ResourcePool[] SwitchParameter
Specifies the resource pools you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
182/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Remove-Snapshot
Synopsis
This cmdlet removes the specified virtual machine snapshots. Syntax Remove-Snapshot [-Snapshot] <Snapshot[]> [-RemoveChildren] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Snapshot New-Snapshot Set-Snapshot Detailed Description This cmdlet removes the specified virtual machine snapshots. If the value of the RemoveChildren parameter is $true, the cmdlet removes the child snapshots as well. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Snapshot Confirm
Snapshot[] SwitchParameter
Specifies the snapshots you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to remove the children of the specified snapshots as well. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RemoveChildren RunAsync
SwitchParameter SwitchParameter
false false
false false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e S n a p s h o tS n a p s h o t$ s n a p s h o t 1R e m o v e C h i l d r e n Removes the snapshot in the $snapshot variable and its children.
Remove-StatInterval
Synopsis
This cmdlet removes the statistics interval specified by the provided sampling period or name. Syntax Remove-StatInterval [-Interval] <StatInterval[]> [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Stat Get-StatType Set-StatInterval New-StatInterval Get-StatInterval Detailed Description This cmdlet removes the statistics interval specified by the provided sampling period or name. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Interval
StatInterval[]
Specifies the statistics intervals you want to remove. The values of this parameter can be statistics interval objects, names, or refresh periods in seconds. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
Server
VIServer[]
false
true (ByValue)
Confirm
SwitchParameter
false
false
$true
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
183/287
7/8/13
None Notes Examples -------------- Example 1 -------------R e m o v e S t a t I n t e r v a lI n t e r v a l*
Removes all the statistics intervals. Note that deleting statistics intervals is allowed only on VirtualCenter 2.0.
Remove-Template
Synopsis
This cmdlet removes the specified virtual machine templates from the inventory. Syntax Remove-Template [-Template] <Template[]> [-DeletePermanently] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Template New-Template Set-Template Detailed Description This cmdlet removes the specified virtual machine templates from the inventory. If the value of the DeletePermanently parameter is $true, the cmdlet removes the templates from the inventory and deletes them from the disk. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Template Confirm
Template[] SwitchParameter
Specifies the virtual machine templates you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to delete the templates not only from the inventory, but from the datastore as well. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server instances on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
DeletePermanently RunAsync
SwitchParameter SwitchParameter
false false
false false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e T e m p l a t eT e m p l a t e$ t e m p l a t e Removes the virtual machine template saved in the $template variable.
Remove-UsbDevice
Synopsis
This cmdlet removes the specified USB devices from a virtual machine. Syntax Remove-UsbDevice [-UsbDevice] <UsbDevice[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-UsbDevice Detailed Description This cmdlet removes the specified USB devices from a virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
184/287
7/8/13
UsbDevice Confirm UsbDevice[] SwitchParameter
SwitchParameter
false
false
-------------- Example 1 -------------G e t U s b D e v i c eV M( G e t V ML o c a t i o n$ v m h o s t )|R e m o v e U s b D e v i c e Retrieves the virtual machines on the host stored in the $vmhost variable and removes their USB devices.
Remove-VApp
Synopsis
This cmdlet removes vApps from the server. Syntax Remove-VApp [-DeletePermanently] [-VApp] <VApp[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Export-VApp Get-VApp Import-VApp New-VApp Set-VApp Start-VApp Stop-VApp Move-VApp Detailed Description This cmdlet removes vApps from the server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
VApp[] SwitchParameter
Specifies the vApp you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want not only to remove the vApps from the inventory, but also to delete the virtual machines they contain from the datastore. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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 ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
DeletePermanently
SwitchParameter
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------G e t V M H o s tN a m eM y V M H o s t 1|G e t V A p p|R e m o v e V A p p Retrieves and removes all vApps available on the MyVMHost1 host.
Remove-VDPortGroup
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 185/287
7/8/13
This cmdlet removes distributed port groups. Syntax
Remove-VDPortGroup [-VDPortGroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-VDPortgroup Get-VDPortgroup Set-VDPortgroup Export-VDPortgroup Detailed Description This cmdlet removes distributed port groups. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VDPortGroup Confirm
VDPortgroup[] SwitchParameter
Specifies the distributed port group that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------G e t V D P o r t G r o u pN a m e" M y V D P o r t G r o u p "|R e m o v e V D P o r t G r o u p Removes the specified distributed port group from the vSphere distributed switch that it belongs to.
Remove-VDSwitch
Synopsis
This cmdlet removes vSphere distributed switches. Syntax Remove-VDSwitch [-VDSwitch] <VDSwitch[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VDSwitch New-VDSwitch Export-VDSwitch Set-VDSwitch Detailed Description This cmdlet removes vSphere distributed switches. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VDSwitch Confirm
VDSwitch[] SwitchParameter
Specifies the vSphere distributed switches that you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
186/287
7/8/13
G e t V D S w i t c hN a m eM y V D S w i t c h|R e m o v e V D S w i t c h Removes the specified distributed switch.
Remove-VDSwitchPhysicalNetworkAdapter
Synopsis
This cmdlet removes host physical network adapters from the distributed switches they are connected to. Syntax Remove-VDSwitchPhysicalNetworkAdapter [-VMHostNetworkAdapter] <PhysicalNic[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VDSwitchPhysicalNetworkAdapter Detailed Description This cmdlet removes host physical network adapters from the distributed switches they are connected to. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHostNetworkAdapter
PhysicalNic[]
Specifies the host physical network adapters that you want to remove from the distributed switch it is connected to. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
Confirm
SwitchParameter
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t V M h o s tN a m e" M y V M h o s t "|G e t V M H o s t N e t w o r k A d a p t e rP h y s i c a lN a m ev m n i c 0|R e m o v e V D S w i t c h P h y s i c a l N e t w o r k A d a p t e r Removes the specified host physical network adapter from the distributed switch that it is connected to.
Remove-VDSwitchVMHost
Synopsis
This cmdlet removes hosts from the specified distributed switches. Syntax Remove-VDSwitchVMHost -VDSwitch <VDSwitch> -VMHost <VMHost[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VDSwitchVMHost Detailed Description This cmdlet removes hosts from the specified distributed switches. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies the distributed switch from which you want to remove hosts. Specifies the hosts that you want to remove. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
187/287
7/8/13
None Notes Examples -------------- Example 1 --------------
G e t V D S w i t c hN a m e" M y S w i t c h "|R e m o v e V D S w i t c h V M H o s tV M H o s t" V M H o s t 1 " ," V M H o s t 2 " Removes two hosts from the specified distributed switch.
Remove-VICredentialStoreItem
Synopsis
This cmdlet removes the specified credential store items. Syntax Remove-VICredentialStoreItem [-CredentialStoreItem] <VICredentialStoreItem[]> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-VICredentialStoreItem [[-Host] <String>] [[-User] <String>] [[-File] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VICredentialStoreItem New-VICredentialStoreItem Detailed Description This cmdlet removes the credential store items that match the specified Host and User parameters. At least one of the Host and User parameters must be provided. To remove all passwords, call ?Remove-VICredentialStoreItem *?, which is a wildcard matching all hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the credential store items you want to remove. Specifies a host to filter the credential store items you want to remove. Specifies a user to filter the credential store items you want to remove. Specifies the file location of the credential store items that are to be removed. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------R e m o v e V I C r e d e n t i a l S t o r e I t e mH o s t1 9 2 . 1 6 8 . 1 . 1 0 0C o n f i r m Removes all credentials for the specified host from the default credential store file. -------------- Example 2 -------------R e m o v e V I C r e d e n t i a l S t o r e I t e mU s e r' a d m i n 'H o s t' 1 9 2 . 1 6 8 . * 'F i l e' c r e d e n t i a l s . x m l 'C o n f i r m Removes all credentials for the specified user and network from a credential store file.
Remove-VIPermission
Synopsis
This cmdlet removes the specified permissions. Syntax Remove-VIPermission [-Permission] <Permission[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIPermission New-VIPermission Set-VIPermission Get-VIPrivilege Get-VIRole
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
188/287
7/8/13
New-VIRole Remove-VIRole Set-VIRole Detailed Description This cmdlet removes the specified permissions. Parameters
NA ME TYPE DESCRIPTION
REQUIRED?
PIPELINE INPUT
Permission Confirm
Permission[] SwitchParameter
Specifies the permissions you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e V I P e r m i s s i o nP e r m i s s i o n$ p e r m i s s i o nC o n f i r m : $ f a l s e Removes the $permission permission without asking for confirmation.
Remove-VIProperty
Synopsis
This cmdlet removes the extended properties from the specified object types. Syntax Remove-VIProperty [-VIProperty] <VIProperty[]> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-VIProperty [-Name] <String[]> [-ObjectType] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-VIProperty Get-VIProperty Detailed Description This cmdlet removes the extended properties from the specified object types. Changes take effect upon the next retrieval of the corresponding objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the names of the extended properties you want to remove. Specifies the extended object properties you want to remove. Specifies the object types to which the extended properties you want to remove belong. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e V I P r o p e r t yN a m e*O b j e c t T y p e* Removes all custom properties. -------------- Example 2 -------------R e m o v e V I P r o p e r t yN a m e*O b j e c t T y p eV i r t u a l M a c h i n e Removes all custom properties for the VirtualMachine object type. -------------- Example 3 -------------R e m o v e V I P r o p e r t yN a m eO v e r a l l S t a t u s ,C o n f i g S t a t u sO b j e c t T y p eV i r t u a l M a c h i n e Removes the OverallStatus and ConfigStatus for the VirtualMachine object type. -------------- Example 4 -------------R e m o v e V I P r o p e r t yN a m eO v e r a l l S t a t u sO b j e c t T y p eV i r t u a l M a c h i n e ,D a t a c e n t e r
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
189/287
7/8/13
-------------- Example 5 -------------R e m o v e V I P r o p e r t yN a m e* s t a t u s *O b j e c t T y p eV i r t *
Removes the OverallStatus property for the VirtualMachine and Datacenter types.
Removes all properties that contain "status" in their names for object types with names that start with "Virt".
Remove-VIRole
Synopsis
This cmdlet removes the specified roles. Syntax Remove-VIRole [-Role] <Role[]> [-Force] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIRole New-VIRole Set-VIRole Get-VIPrivilege Get-VIPermission New-VIPermission Remove-VIPermission Set-VIPermission Detailed Description This cmdlet removes the specified roles. To remove a role that is associated with a permission, you need to set the Force parameter to $true. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Role Confirm
Role[] SwitchParameter
Specifies the roles you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to remove the role even if it is associated with a permission. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Force Server
SwitchParameter VIServer[]
false false
false false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------G e t V I R o l eS e r v e r$ s e r v e rN a m e" C u s t o m e r * "|R e m o v e V I R o l e Removes the roles with names that start with "Customer".
Remove-VirtualPortGroup
Synopsis
This cmdlet removes the specified virtual port groups. Syntax Remove-VirtualPortGroup [-VirtualPortGroup] <VirtualPortGroup[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VirtualPortGroup New-VirtualPortGroup Set-VirtualPortGroup Detailed Description This cmdlet removes the specified virtual port groups. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VirtualPortGroup Confirm
VirtualPortGroup[] SwitchParameter
Specifies the virtual port groups you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation..
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
190/287
7/8/13
WhatIf Return Type None Notes Examples -------------- Example 1 -------------SwitchParameter
$ v s w i t c h= N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4N a m eV i r t u a l S w i t c h $ v p o r t g r o u p= N e w V i r t u a l P o r t G r o u pV i r t u a l S w i t c h$ v s w i t c hN a m eV P o r t G r o u p R e m o v e V i r t u a l P o r t G r o u pV i r t u a l P o r t G r o u p$ v p o r t g r o u p Creates a new virtual switch named VirtualSwitch and a virtual ports group VPortGroup for this switch. Then removes the virtual ports group.
Remove-VirtualSwitch
Synopsis
This cmdlet removes the specified virtual switches from their locations. Syntax Remove-VirtualSwitch [-VirtualSwitch] <VirtualSwitch[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VirtualSwitch New-VirtualSwitch Set-VirtualSwitch Detailed Description This cmdlet removes the specified virtual switches from their locations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VirtualSwitch Confirm
VirtualSwitch[] SwitchParameter
Specifies the virtual switches you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------$ v s w i t c h= N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 2 2 . 1 4 5N a m eV i r t u a l S w i t c h R e m o v e V i r t u a l S w i t c hV i r t u a l S w i t c h$ v s w i t c h Creates a new virtual switch named VirtualSwitch on the host with an IP address 10.23.122.145. Then removes the virtual switch.
Remove-VM
Synopsis
This cmdlet removes the specified virtual machines from the vCenter Server system. Syntax Remove-VM [-DeletePermanently] [-RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Move-VM New-VM Set-VM Start-VM Stop-VM Suspend-VM
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
191/287
7/8/13
Restart-VM Detailed Description
This cmdlet removes the specified virtual machines from the vCenter Server system. If the value of the DeletePermanently parameter is $true, the cmdlet not only removes the virtual machines from the inventory, but also deletes them from the disk. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to delete the virtual machines not only from the inventory, but from the datastore. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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 ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
DeletePermanently RunAsync
SwitchParameter SwitchParameter
false false
false false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e V MV MD e l e t e P e r m a n e n t l y Removes the VM virtual machine and deletes its files from the ESX host.
Remove-VMGuestRoute
Synopsis
This cmdlet removes the specified routes from the routing table of their corresponding virtual machines. Syntax Remove-VMGuestRoute [-VMGuestRoute] <VMGuestRoute[]> [-ToolsWaitSecs <Int32>] [-GuestPassword <SecureString>] [-GuestUser <String>] [-GuestCredential <PSCredential>] [-HostPassword <SecureString>] [-HostUser <String>] [-HostCredential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMGuestRoute New-VMGuestRoute Detailed Description This cmdlet removes the specified routes from the routing table of their corresponding virtual machines. This cmdlet supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMGuestRoute Confirm
VMGuestRoute[] SwitchParameter
Specifies the route you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a PSCredential object that contains credentials for authenticating with the guest OS. Do not use this parameter if the GuestUser and GuestPassword parameters are used. Specifies the password you want to use for authenticating with the guest OS. Specifies the user name you want to use for authenticating with the guest OS. Specifies a PSCredential object that contains credentials for authenticating with the host. Do not use this parameter if the HostUser and HostPassword parameters are used. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is
true false
GuestCredential
PSCredential
false
false
HostPassword
SecureString
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
192/287
7/8/13
HostUser
String
Specifies the user name you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the time in seconds to wait for a response from VMware Tools. If a non-positive value is provided, the system waits infinitely long time. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
ToolsWaitSecs
Int32
false
false
SwitchParameter
false
false
This cmdlet is experimental and might be changed or removed in a future rel ease. Examples -------------- Example 1 -------------R e m o v e V M G u e s t R o u t eG u e s t U s e ru s e rG u e s t P a s s w o r dp a s s 2V M G u e s t R o u t e$ r o u t e Removes the guest route stored in the $route variable.
Remove-VMHost
Synopsis
This cmdlet removes the specified hosts from the inventory. Syntax Remove-VMHost [-VMHost] <VMHost[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VMHost Get-VMHost Move-VMHost Restart-VMHost Set-VMHost Start-VMHost Stop-VMHost Suspend-VMHost Detailed Description This cmdlet removes the specified hosts from the inventory. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the hosts you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ m y S e r v e r=C o n n e c t V I S e r v e rS e r v e r1 0 . 2 3 . 1 1 2 . 2 3 5 G e t V M H o s tS e r v e r$ m y S e r v e rL o c a t i o nM y D a t a c e n t e r 1|R e m o v e V M H o s tC o n f i r m : $ f a l s e Removes a specified VM host from a vCenter Server system without asking for a confirmation.
Remove-VMHostAccount
Synopsis
This cmdlet removes the specified host accounts.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
193/287
7/8/13
Syntax
Remove-VMHostAccount [-HostAccount] <HostAccount[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIAccount New-VMHostAccount Set-VMHostAccount Detailed Description This cmdlet removes the specified host accounts . These can be HostGroupAccount objects, HostUserAccount objects, or both. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HostAccount Confirm
HostAccount[] SwitchParameter
Specifies the host accounts you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------G e t V M H o s t A c c o u n tG r o u pI Du s e r|R e m o v e V M H o s t A c c o u n tC o n f i r m Removes the group account with ID "user". Asks for confirmation before running the command.
Remove-VMHostNetworkAdapter
Synopsis
This cmdlet removes the specified host network adapters. Syntax Remove-VMHostNetworkAdapter [-Nic] <HostVirtualNic[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-VMHostNetworkAdapter Set-VMHostNetworkAdapter Detailed Description This cmdlet removes the specified host network adapters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Nic Confirm
HostVirtualNic[] SwitchParameter
Specifies the network adapters you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ n e t w o r k=G e t V M H o s t N e t w o r k R e m o v e V M H o s t N e t w o r k A d a p t e r$ n e t w o r k . V i r t u a l N i c [ 0 ]C o n f i r m Removes the first virtual network adapter of the host.
Remove-VMHostNtpServer
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 194/287
7/8/13
Syntax
This cmdlet removes the specified NTP servers from the NTP server list of the specified hosts. Remove-VMHostNtpServer [-NtpServer] <String[]> [-VMHost] <VMHost[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VMHostNtpServer Detailed Description This cmdlet removes the specified NTP servers from the NTP server list of the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the NTP servers you want to remove from the NTP servers list of the specified host. Specifies the host whose NTP servers you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
SwitchParameter
false
false
-------------- Example 1 -------------R e m o v e V m H o s t N t p S e r v e rN t p S e r v e r1 9 2 . 1 6 8 . 1 . 5V M H o s t$ v m h o s tC o n f i r m Removes the NTP server with an IP address 192.168.1.5 from the virtual machine hosts stored in the $vmhost variable. -------------- Example 2 -------------R e m o v e V m H o s t N t p S e r v e rN t p S e r v e r" o l d n t p s e r v e r . c o m "V M H o s t( G e t V M H o s t )C o n f i r m Removes the NTP server with a domain name "old-ntp-server.com" from the virtual machine hosts pipelined through the Get-VMHost cmdlet.
Remove-VMHostProfile
Synopsis
This cmdlet removes the specified host profiles. Syntax Remove-VMHostProfile [-Profile] <VMHostProfile[]> [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Remove-VMHostProfile -Entity <InventoryItem[]> [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Export-VMHostProfile Get-VMHostProfile Import-VMHostProfile New-VMHostProfileCompliance Set-VMHostProfile Test-VMHostProfileCompliance Detailed Description This cmdlet removes the specified host profiles. If the Entity parameter is provided, the cmdlet removes the profile association for the specified entity. Otherwise, the cmdlet removes the profile object. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Profile Server
VMHostProfile[] VIServer[]
Specifies the host profiles you want to remove. Specifies the vCenter Server systems 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-VIServer. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the host or cluster whose host profile association you want to remove. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Confirm
SwitchParameter
false
false
$true
Entity WhatIf
InventoryItem[] SwitchParameter
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
195/287
7/8/13
Examples -------------- Example 1 --------------
Remove-VMHostRoute
Synopsis
This cmdlet removes host routes. Syntax Remove-VMHostRoute [-VMHostRoute] <VMHostRoute[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostRoute New-VMHostRoute Set-VMHostRoute Detailed Description This cmdlet removes host routes. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHostRoute Confirm
VMHostRoute[] SwitchParameter
Specifies the host routes you want to remove. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
Supported only on ESX 4.0/ vCenter Server 4.0 and later. Examples -------------- Example 1 -------------$ d e s t I p L i s t=( ' 1 9 2 . 1 6 8 . 1 1 1 . 1 0 1 ' ,' 1 9 2 . 1 6 8 . 1 1 1 . 1 0 2 ' ) $ r o u t e s=G e t V M H o s t R o u t eV M H o s t( $ s c r i p t : v m h o s t 1 ,$ s c r i p t : v m h o s t 2 )|w h e r e{ $ d e s t I p L i s tc o n t a i n s$ _ . D e s t i n a t i o n . I P A d d r e s s T o S t r i n g } R e m o v e V M H o s t R o u t eV M H o s t R o u t e$ r o u t e sC o n f i r m : $ f a l s e Removes the host routes that have the specified destination IP addresses.
Repair-DeployImageCache
Synopsis
Repairs the image cache. Use this cmdlet only when working with VMware Technical Support. Syntax Repair-DeployImageCache [<CommonParameters>] Related Commands Detailed Description Use this cmdlet in the unlikely scenario that the AutoDeploy cache is damaged and the software packages that make up an image profile are lost. Make sure that the original software depots have been added to the current PowerCLI session with the "Add-ESXSoftwareDepot" cmdlet before executing this cmdlet. The cmdlet will try to download the software packages from the available depots and reupload them to the AutoDeploy server. You must have the "AutoDeploy.Profile.Create" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
196/287
7/8/13
Copyright 1998 - 2011 VMware, Inc. All rights reserved.
Repair-DeployRuleSetCompliance
Synopsis
Remediate any non-compliant associations discovered by Test-DeployRuleSetCompliance Syntax Repair-DeployRuleSetCompliance [-TestResult] <TestResult> [<CommonParameters>] Related Commands Test-DeployRuleSetCompliance Detailed Description Remediates any differences discovered by between the rules and the actual associations between hosts and their items. Use this cmdlet if you added or changed a rule and want to apply the change to all affected hosts. Run Test-DeployRuleSetCompliance to retrieve the required TestResult object. You must have the privileges necessary to perform the association operations. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
TestResult
true
true (ByValue)
Restart-CIVApp
Synopsis
This cmdlet restarts the specified vApp. Syntax Restart-CIVApp [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp New-CIVApp Remove-CIVApp Set-CIVApp Start-CIVApp Stop-CIVApp Suspend-CIVApp Detailed Description This cmdlet restarts the specified vApp. Resets all virtual machines in the vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp you want to restart. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVApp object Notes Examples -------------- Example 1 -------------$ m y V a p p=G e t C I V A p p' M y v A p p ' R e s t a r t C I V A p p$ m y V A p p
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
197/287
7/8/13
Restarts the specified vApp. -------------- Example 2 -------------$ m y V a p p=G e t C I V A p p' M y v A p p ' $ t a s k=$ m y V A p p|R e s t a r t C I V A p pR u n A s y n c Restarts the specified vApp asynchronously.
Restart-CIVAppGuest
Synopsis
This cmdlet restarts the guest operating systems of all virtual machines in the specified vApp. Syntax Restart-CIVAppGuest [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Stop-CIVAppGuest Detailed Description This cmdlet restarts the guest operating systems of all virtual machines in the specified vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp whose virtual machine guest operating systems you want to restart. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVApp object Notes Examples -------------- Example 1 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' R e s t a r t C I V A p p G u e s t$ m y V A p p Restarts the VM guest operating system in the specified vApp. -------------- Example 2 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' $ t a s k=R e s t a r t C I V A p p G u e s t$ m y V A p pR u n A s y n c Restarts the VM guest operating system in the specified vApp asynchronously.
Restart-CIVM
Synopsis
This cmdlet resets the specified virtual machine. Syntax Restart-CIVM [-VM] <CIVM[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVM Start-CIVM Stop-CIVM Suspend-CIVM Detailed Description This cmdlet resets the specified virtual machine. Parameters
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
198/287
7/8/13
NA ME TYPE DESCRIPTION
VM Confirm
CIVM[] SwitchParameter
Specifies the virtual machine you want to reset. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVM object Notes Examples -------------- Example 1 -------------$ m y V M=G e t C I V MN a m e' M y V M ' R e s t a r t C I V M$ m y V M Resets the specified virtual machine. -------------- Example 2 -------------$ m y V M=G e t C I V MN a m e' M y V M ' $ t a s k=R e s t a r t C I V M$ m y V MR u n A s y n c Resets the specified virtual machine asynchronously.
Restart-CIVMGuest
Synopsis
This cmdlet restarts the guest operating system of the specified virtual machine. Syntax Restart-CIVMGuest [-VM] <CIVM[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Stop-CIVMGuest Detailed Description This cmdlet restarts the guest operating system of the specified virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
CIVM[] SwitchParameter
Specifies the virtual machine whose guest operating system you want to restart. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVM object Notes Examples -------------- Example 1 -------------$ m y V M=G e t C I V MN a m e' M y V M ' R e s t a r t C I V M G u e s t$ m y V M Restarts the guest operating system of the specified virtual machine. -------------- Example 2 -------------$ m y V M=G e t C I V MN a m e' M y V M '
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
199/287
7/8/13
$ t a s k=R e s t a r t C I V M G u e s t$ m y V MR u n A s y n c
Restarts the guest operating system of the specified virtual machine asynchronously.
Restart-VM
Synopsis
This cmdlet restarts the specified virtual machines. Syntax Restart-VM [-RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM New-VM Remove-VM Set-VM Start-VM Stop-VM Suspend-VM Move-VM Detailed Description This cmdlet restarts the specified virtual machines. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines you want to restart. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more VirtualMachine objects Notes Examples -------------- Example 1 -------------R e s t a r t V MV MV MR u n A s y n cC o n f i r m Restarts the VM virtual machine after user confirmation. The cmdlet returns without waiting for the task to complete.
Restart-VMGuest
Synopsis
This cmdlet restarts the virtual machine guest operating systems. Syntax Restart-VMGuest [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Restart-VMGuest [[-Guest] <VMGuest[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMGuest Shutdown-VMGuest Suspend-VMGuest Detailed Description This cmdlet restarts the virtual machine guest operating systems. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Guest VM
VMGuest[] VirtualMachine[]
Specifies the virtual machine guest operating systems you want to restart. Specifies the virtual machines whose operating systems you want to restart. The specified virtual machines must have VMware Tools installed.
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
200/287
7/8/13
Server VIServer[]
Confirm
SwitchParameter
false
false
$true
WhatIf
SwitchParameter
false
false
Return Type Zero or more VMGuest objects Notes Examples -------------- Example 1 -------------G e t V MV M|R e s t a r t V M G u e s t Restarts the guest OS of the virtual machine named VM.
Restart-VMHost
Synopsis
This cmdlet restarts the specified hosts. Syntax Restart-VMHost [-VMHost] <VMHost[]> [-Force] [-Evacuate] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHost Move-VMHost Remove-VMHost Start-VMHost Stop-VMHost Suspend-VMHost Detailed Description This cmdlet restarts the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the hosts you want to restart. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that vCenter Server automatically reregisters the virtual machines that are compatible for reregistration. If they are not compatible, they remain on the rebooted host. If there are powered-on virtual machines that cannot be reregistered, the operation waits until they are powered off manually. The Evacuate parameter is valid only if the cmdlet is run against a vCenter Server system and the host is in a DRS-enabled cluster. Indicates that you want to restart the hosts even if they are not in a maintenance mode. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Evacuate
SwitchParameter
false
false
Force RunAsync
SwitchParameter SwitchParameter
false false
false false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more VMHost objects Notes Examples -------------- Example 1 -------------R e s t a r t V M H o s t1 0 . 2 3 . 1 1 2 . 2 3 5R u n A s y n cC o n f i r m Restarts the specified host after user confirmation. The cmdlet returns without waiting for the task to complete.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
201/287
7/8/13
Restart-VMHostService
Synopsis
This cmdlet restarts the specified host services. Syntax Restart-VMHostService [-HostService] <HostService[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostService Set-VMHostService Start-VMHostService Stop-VMHostService Detailed Description This cmdlet restarts the specified host services. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HostService Confirm
HostService[] SwitchParameter
Specifies the host service you want to restart. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
Zero or more HostService objects Notes Examples -------------- Example 1 -------------R e s t a r t V M H o s t S e r v i c eS e r v i c e$ v m H o s t S e r v i c eC o n f i r m : $ f a l s e Restarts a host service.
Search-Cloud
Synopsis
This cmdlet searches the cloud for objects of the specified type. Syntax Search-Cloud [-Name <String[]>] [[-Filter] <String>] [-QueryType] <QueryType> [-Property <String[]>] [-Server <CIServer[]>] [<CommonParameters>] Related Commands Online version Detailed Description This cmdlet searches the cloud for objects of the specified type. You can filter the returned objects by their properties. The cmdlet allows you to retrieve only specific properties of object. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies what types of objects you want to search for. Specifies a filter criteria for the returned objects. Specifies the names of the objects to search for. This parameter supports only the "*" wildcard. For more information about the valid filter syntax, see the vCloud API Programming Guide. Specifies the properties you want to retrieve for the specified object type. If you do not provide a value for this parameter, the cmdlet returns all properties of the objects. 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 ConnectCIServer.
Property
String[]
false
false
Server
CIServer[]
false
false
Return Type Zero or more CISearchResult objects Notes Examples -------------- Example 1 -------------S e a r c h C l o u dT y p ev A p p T e m p l a t e Searches the cloud server for virtual appliance templates. The user is connected as a cloud user. -------------- Example 2 -------------S e a r c h C l o u du s e rN a m eU s e r 1
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
202/287
7/8/13
Searches for a user by name. -------------- Example 3 --------------
S e a r c h C l o u da d m i n U s e rP r o p e r t y' N a m e ' ,' F u l l N a m e ' Gets all the Name and FullName properties for all cloud users. You must be connected as a system administrator. -------------- Example 4 -------------S e a r c h C l o u dv a p p T e m p l a t eF i l t e r' i s G o l d M a s t e r = = T r u e ; i s P u b l i s h e d = = T r u e ' Searches for public gold master vAppTemplate objects. -------------- Example 5 -------------S e a r c h C l o u dQ u e r y T y p ea d m i n V A p p T e m p l a t e Searches the cloud server for virtual appliance templates. The user is connected as a cloud administrator.
Set-AdvancedSetting
Synopsis
This cmdlet modifies the specified advanced setting. Syntax Set-AdvancedSetting [-AdvancedSetting] <AdvancedSetting[]> [-Value] <Object> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AdvancedSetting New-AdvancedSetting Remove-AdvancedSetting Detailed Description This cmdlet modifies the specified advanced setting. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a new value for the advanced setting. Specifies the advanced setting you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter
false
false
Zero or more modified AdvancedSetting objects Notes Examples -------------- Example 1 -------------G e t A d v a n c e d S e t t i n gE n t i t y( G e t C l u s t e rN a m eC l u s t e r )N a m eS e t t i n g N a m e|S e t A d v a n c e d S e t t i n gV a l u eN e w V a l u e Changes the value of the advanced setting SettingName of the Cluster cluster. -------------- Example 2 -------------G e t A d v a n c e d S e t t i n gE n t i t yS e r v e rN a m e' m a i l . s m t p . s e r v e r '|S e t A d v a n c e d S e t t i n gV a l u e' t e s t . v m w a r e . c o m ' Changes the value of the advanced setting mail.smtp.server of the specified server to test.vmware.com.
Set-AlarmDefinition
Synopsis
This cmdlet modifies the specified alarm definitions. Syntax Set-AlarmDefinition [-AlarmDefinition] <AlarmDefinition[]> [-ActionRepeatMinutes <Int32>] [-Description <String>] [-Enabled [<Boolean>]] [-Name <String>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-AlarmDefinition Get-AlarmAction
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
203/287
7/8/13
Get-AlarmActionTrigger New-AlarmAction New-AlarmActionTrigger Remove-AlarmAction Remove-AlarmActionTrigger Detailed Description This cmdlet modifies the specified alarm definitions. Parameters
NA ME TYPE
DESCRIPTION
REQUIRED?
PIPELINE INPUT
Specifies the alarm definition you want to modify. Specifies a time period in minutes to define how often the alarm action repeats if the alarm is active. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new description for the alarm definition. Indicates that the alarm definition is enabled. Specifies a new name for the alarm definition. Specifies the vCenter Server systems 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 ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter
false
false
Zero or more modified AlarmDefinition objects Notes Examples -------------- Example 1 -------------G e t A l a r m D e f i n i t i o nN a m e' a l a r m s '|S e t A l a r m D e f i n i t i o nA c t i o n R e p e a t M i n u t e s( $ _ . A c t i o n R e p e a t M i n u t e s+1 ) Increase all selected alarms action repeat minutes. -------------- Example 2 -------------G e t A l a r m D e f i n i t i o nN a m e' a l a r m '|f o r e a c h{ $ _|S e t A l a r m D e f i n i t i o nN a m e' a l a r mn e wn a m e 'D e s c r i p t i o n' n e wd e s c r i p t i o n 'E n a b l e d : $ t r u e } Changes the name, description, and the Enabled flag of the selected alarms.
Set-Annotation
Synopsis
This cmdlet modifies the value of a custom attribute. Syntax Set-Annotation [-Entity] <InventoryItem[]> [-CustomAttribute] <CustomAttribute> [-Value] <String> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Annotation Get-CustomAttribute New-CustomAttribute Remove-CustomAttribute Set-CustomAttribute Detailed Description This cmdlet modifies the value of a custom attribute that applies to one or more inventory items. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the entities to which the new annotation value applies. Specifies the custom attribute whose annotation you want to change. Specifies a new value for the annotation. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
204/287
7/8/13
Notes Examples -------------- Example 1 --------------
S e t A n n o t a t i o nE n t i t y$ v m h o s tC u s t o m A t t r i b u t e" P h y s i c a l L o c a t i o n "V a l u eO f f i c e Modifies the annotation of the PhysicalLocation custom attribute for the host stored in the $vmhost variable. -------------- Example 2 -------------G e t C l u s t e rC l u s t e r|S e t A n n o t a t i o nC u s t o m A t t r i b u t e" P h y s i c a l L o c a t i o n "V a l u eC a l i f o r n i a Modifies the annotation of the PhysicalLocation custom attribute for the Cluster cluster.
Set-CDDrive
Synopsis
This cmdlet modifies the configuration of a virtual CD drive. Syntax Set-CDDrive [-CD] <CDDrive[]> [-IsoPath <String>] [-HostDevice <String>] [-NoMedia] [-StartConnected [<Boolean>]] [-Connected [<Boolean>]] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CDDrive New-CDDrive Remove-CDDrive Detailed Description This cmdlet updates a virtual CD drive. If an ISO location is provided, sets the CD to point to the ISO. Changes the StartConnected and Connected flags if StartConnected and/or Connected is set. If NoMedia parameter is set to $true, removes the CD drive's media backing and disconnects it. Note that the Connected parameter can be specified only if the corresponding virtual machine is powered on. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
CD Confirm
CDDrive[] SwitchParameter
Specifies the virtual CD drive you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the virtual CD drive is connected after its creation. This parameter can be specified only if the corresponding virtual machine is powered on. Specifies the path to the CD drive on the host which backs this virtual CD drive. Do not use this parameter when the ISOPath and NoMedia parameters are specified. Specifies the datastore path to the ISO (CD image) file that backs the virtual CD drive. Do not use this parameter when the HostDevice and NoMedia parameters are specified. Indicates that you want to detach from the CD drive any type of connected media - ISO from datastore or host device. Do not use this parameter when the ISOPath or HostDevice parameters are specified. Indicates that the virtual CD drive starts connected when the virtual machine associated with it powers on. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Connected
Boolean
false
false
HostDevice
String
false
false
IsoPath
String
false
false
NoMedia
SwitchParameter
false
false
Boolean SwitchParameter
false false
false false
Zero or more modified CDDrive objects Notes Examples -------------- Example 1 -------------$ c d=N e w C D D r i v eV MV MI S O P a t h" [ s o f 2 0 6 6 6 e s x : s t o r a g e 1 ]I S O \ t e s t I S O . i s o " S e t C D D r i v eC D$ c dN o M e d i a Creates a CD drive on the VM virtual machine and attaches testISO.iso, previously uploaded. Then disconnects the ISO.
Set-CIAccessControlRule
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 205/287
7/8/13
This cmdlet modifies the specified access control rule. Syntax
Set-CIAccessControlRule [-AccessLevel] <AccessLevel> -AccessControlRule <CIAccessControlRule[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIAccessControlRule New-CIAccessControlRule Remove-CIAccessControlRule Detailed Description This cmdlet modifies the specified access control rule. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AccessLevel
AccessLevel
Specifies a new access level for the access control rule that you want to modify. This parameter accepts Read, ReadWrite, and FullControl values. Specifies the access control rule that you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
AccessControlRule Confirm
CIAccessControlRule[] SwitchParameter
true false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified CIAccessControlRule objects Notes Examples -------------- Example 1 -------------$ m y R u l e=G e t C I A c c e s s C o n t r o l R u l eE n t i t y' M y C a t a l o g 'U s e r' M y U s e r ' S e t C I A c c e s s C o n t r o l R u l eA c c e s s C o n t r o l R u l e$ m y R u l eA c c e s s L e v e l" F u l l C o n t r o l " Provides the MyUser user with full control access to the MyCatalog catalog.
Set-CINetworkAdapter
Synopsis
This cmdlet modifies the configuration of a virtual network adapter of a virtual machine on a vCloud Director server. Syntax Set-CINetworkAdapter [-NetworkAdapter] <CINetworkAdapter[]> [-Connected [<Boolean>]] [-IPAddress <IPAddress>] [-IPAddressAllocationMode <IPAddressAllocationMode>] [-MACAddress <String>] [-VAppNetwork <CIVAppNetwork>] [-Primary] [-Server <CIServer[]>] [-ResetMACAddress] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CINetworkAdapter Detailed Description This cmdlet modifies the configuration of a virtual network adapter of a virtual machine on a vCloud Director server. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
NetworkAdapter Confirm
CINetworkAdapter[] SwitchParameter
Specifies the virtual network adapters that you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the connection state of the virtual network adapter. For an undeployed virtual machine, indicates that the virtual network adapter will connect to the network when the virtual machine is deployed. Specifies a new IP address for the virtual network adapter. This parameter is only applicable when the IPAddressAllocationMode parameter is set to manual. Specifies a new IP address allocation mode for the virtual network adapter. This parameter accepts Pool, Dhcp, and Manual values. Specifies a new MAC address for the virtual network adapter. This parameter is not applicable when ResetMACAddress is specified. Indicates that the virtual network adapter is primary for its virtual machine. Indicates that you want to reset the MAC address of the virtual network adapter. This parameter is not applicable when MACAddress is specified.
true false
Connected
Boolean
false
false
IPAddress
IPAddress
false
false
IPAddressAllocationMode
IPAddressAllocationMode
false
false
MACAddress
String
false
false
Primary ResetMACAddress
SwitchParameter SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
206/287
7/8/13
Server CIServer[]
VAppNetwork
CIVAppNetwork
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified CINetworkAdapter objects Notes Examples -------------- Example 1 -------------$ m y V a p p N e t w o r k 2=G e t C I V A p p N e t w o r kN a m e' M y V a p p N e t w o r k 2 ' G e t C I V A p p N e t w o r kN a m e' M y V a p p N e t w o r k 1 '|G e t C I N e t w o r k A d a p t e r|S e t C I N e t w o r k A d a p t e rV A p p N e t w o r k$ m y V a p p N e t w o r k 2 Retrieves all virtual network adapters connected to the MyVappNetwork1 vApp network and connects them to the MyVappNetwork2 vApp network. -------------- Example 2 -------------G e t V A p pN a m e' M y V a p p 1 '|G e t C I V M|G e t C I N e t w o r k A d a p t e r|S e t C I N e t w o r k A d a p t e rC o n n e c t e d$ f a l s e Disconnects all virtual network adapters of all virtual machines in the specified vApp. -------------- Example 3 --------------
G e t C I V MN a m e' M y V M 1 '|G e t C I N e t w o r k A d a p t e rP r i m a r y|S e t C I N e t w o r k A d a p t e rI P A d d r e s s A l l o c a t i o n M o d eM a n u a lI P A d d r e s s1 9 2 . 1 6 8 . 1 . 1M A C A d d r e s s' F F 1 D 0 9 2 E Retrieves the primary virtual network adapter of the specified virtual machine. Changes the IP address allocation mode for the virtual network adapter to manual and assigns the virtual network adapter new IP and MAC addresses.
Set-CIVApp
Synopsis
This cmdlet modifies the configuration of the specified vApps in the cloud. Syntax Set-CIVApp [-VApp] <CIVApp[]> [-Name <String>] [-Description <String>] [-Owner <CIUser>] [-Server <CIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Set-CIVApp [-VApp] <CIVApp[]> [-Server <CIServer[]>] [-RunAsync] -DiscardSuspendedState [-WhatIf] [-Confirm] [<CommonParameters>] Set-CIVApp [-VApp] <CIVApp[]> [-Server <CIServer[]>] -RenewLease [-RuntimeLease <TimeSpan>] [-StorageLease <TimeSpan>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp Import-CIVApp New-CIVApp Remove-CIVApp Start-CIVApp Stop-CIVApp Restart-CIVApp Suspend-CIVApp Detailed Description This cmdlet modifies the configuration of the specified vApps in the cloud. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp that you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the vApp you want to configure. Indicates that you want to discard the suspended state of the specified vApp and all its virtual machines. Specifies a new name for the vApp you want to configure. Specifies a new owner for the vApp you want to configure. Indicates that you want to renew the leases of the vApp. Specifying the RenewLease parameter resets the current values of the RuntimeLease and StorageLease parameters. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more
true false
RunAsync
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
207/287
7/8/13
RuntimeLease
TimeSpan
Specifies the maximum running time for the vApp before vCloud Director stops it automatically. If you do not specify this parameter, the current value is reset. To specify that the lease is unlimited, pass $null. 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. Specifies the maximum amount of time for the vApp to remain stopped before vCloud Director automatically marks it as expired, or deletes it, depending on the organization policy. If you do not specify this parameter, the current value is reset. To specify that the lease is unlimited, pass $null. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Server
CIServer[]
false
false
StorageLease
TimeSpan
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified CIVApp objects Notes Examples -------------- Example 1 -------------$ m y V A p p s=G e t C I V A p pN a m e' M y V A p p * ' $ m y V A p p s|S e t C I V A p pD e s c r i p t i o n' T h i si so n eo fm yV A p p s . ' Retrieves all vApp with names starting with MyVapp and changes their descriptions to "This is one of my vApps." -------------- Example 2 -------------S e t C I V A p pV A p p' M y V A p p * 'D i s c a r d S u s p e n d e d S t a t e Discards the suspended state for all vApps with names starting with MyVapp. -------------- Example 3 -------------$ r u n t i m e T i m e S p a n=N e w O b j e c tS y s t e m . T i m e s p a n1 , 2 , 3# o n eh o u r ,t w om i n u t e s ,t h r e es e c o n d s S e t C I V A p pV A p p' m y V A p p * 'R e n e w L e a s eR u n t i m e L e a s e$ r u n t i m e T i m e S p a n Renews the runtime lease for all vApps with names starting with MyVapp and sets the runtime lease to one hour, two minutes and three seconds.
Set-CIVAppNetwork
Synopsis
This cmdlet modifies the configuration of the specified vApp networks. Syntax Set-CIVAppNetwork [-VAppNetwork] <CIVAppNetwork[]> [-RunAsync] [-Server <CIServer[]>] [-Description <String>] [-DnsSuffix <String>] [-PrimaryDns <IPAddress>] [SecondaryDns <IPAddress>] [-StaticIPPool <IPRangeList>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-CIVAppNetwork [-VAppNetwork] <CIVAppNetwork[]> [-RunAsync] [-Server <CIServer[]>] -ReplaceNetworkWithNewNetworkWithChangedName <String> [-WhatIf] [-Confirm] [<CommonParameters>] Set-CIVAppNetwork [-VAppNetwork] <CIVAppNetwork[]> [-RunAsync] [-Server <CIServer[]>] [-Fenced [<Boolean>]] [-FirewallEnabled [<Boolean>]] [-NatEnabled [<Boolean>]] [-ParentOrgNetwork <OrgNetwork>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVAppNetwork New-CIVAppNetwork Remove-CIVAppNetwork Detailed Description This cmdlet modifies the configuration of the specified vApp networks. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VAppNetwork
CIVAppNetwork[]
Specifies the vApp networks that you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies new descriptions for the vApp networks that you want to modify. To delete the current value of this setting, pass an empty string.
true
true (ByValue)
Confirm
SwitchParameter
false
false
Description
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
208/287
7/8/13
DnsSuffix
Fenced
Boolean
false
false
FirewallEnabled
Boolean
false
false
NatEnabled
Boolean
false
false
ParentOrgNetwork
OrgNetwork
false
false
PrimaryDns
IPAddress
false
false
ReplaceNetworkWithNewNetworkWithChangedName
String
true
false
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies new secondary DNSs for the vApp networks that you want to modify. To delete the current value of this setting, pass an empty string. 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 ConnectCIServer. Specifies new ranges of static IP addresses for the vApp networks to allocate to virtual machines. To delete the current
false
false
SecondaryDns
IPAddress
false
false
Server
CIServer[]
false
false
StaticIPPool
IPRangeList
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
209/287
7/8/13
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type Zero or more modified CIVAppNetwork objects Notes Examples -------------- Example 1 --------------
$ m y V A p p N e t w o r k=G e t C I V A p p N e t w o r kN a m e' M y V A p p N e t w o r k ' $ m y V A p p N e t w o r k|S e t C I V A p p N e t w o r k D e s c r i p t i o n' T h i sm yr o u t e dn e t w o r kw i t hu p d a t e dc o n f i g u r a t i o n . 'D n s S u f f i x' m y d o m a i n . c o m ' P r i m a r y D n s' 1 9 2 . 1 6 8 . 3 . 1 'S e Modifies the configuration of the specified vApp network. -------------- Example 2 -------------$ m y V A p p N e t w o r k=G e t C I V A p p N e t w o r kN a m e' M y V A p p N e t w o r k ' $ p a r e n t O r g N e t w o r k=G e t O r g N e t w o r kN a m e' M y P a r e n t O r g a n i z a t i o n N e t w o r k ' $ m y V A p p N e t w o r k|S e t C I V A p p N e t w o r kP a r e n t O r g N e t w o r k$ p a r e n t O r g N e t w o r k Changes the parent organization network for the specified vApp. -------------- Example 3 -------------$ m y V A p p N e t w o r k=G e t C I V A p p N e t w o r kN a m e' M y V A p p N e t w o r k ' $ m y V A p p N e t w o r k|S e t C I V A p p N e t w o r kP a r e n t O r g N e t w o r k$ n u l l Transforms the specified routed network into an isolated network. -------------- Example 4 -------------$ m y V A p p N e t w o r k=G e t C I V A p p N e t w o r kN a m e' M y V A p p N e t w o r k ' $ m y V A p p N e t w o r k|S e t C I V A p p N e t w o r k? F e n c e d : $ t r u e? F i r e w a l l E n a b l e d : $ f a l s e Turns on fence mode for the specified direct vApp network and disables the firewall service. -------------- Example 5 -------------$ m y V A p p N e t w o r k=G e t C I V A p p N e t w o r kN a m e' M y V A p p N e t w o r k ' $ m y V A p p N e t w o r k|S e t C I V A p p N e t w o r k? R e p l a c e N e t w o r k W i t h N e w N e t w o r k W i t h C h a n g e d N a m eM y R e n a m e d V A p p N e t w o r k Renames the specified network by replacing it with an identical vApp network named MyRenamedVAppNetwork.
Set-CIVAppStartRule
Synopsis
This cmdlet modifies the start rules for virtual machines in the specified vApp. Syntax Set-CIVAppStartRule [-StartRule] <CIVAppStartRule[]> [-Group <UInt16>] [-StartAction <CIVMStartAction>] [-StartDelaySeconds <UInt16>] [-StopAction <CIVMStopAction>] [-StopDelaySeconds <UInt16>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVAppStartRule Detailed Description This cmdlet modifies the start rules for virtual machines in the specified vApp. Note: You must specify at least one of the Group, StartAction, StartDelaySeconds, StopAction, or StopDelaySeconds parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
StartRule Confirm
CIVAppStartRule[] SwitchParameter
Specifies the start rule that you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new start group for the virtual machine whose start rule you want to modify. The value you pass to this parameter represents the position of the group in the start queue of the vApp. The smaller the number, the sooner vCloud Director powers on the virtual machines in the group after you start the vApp. When you stop the vApp, vCloud Director stops the virtual machines in the reverse order. Specifies a new action to be performed on the virtual machine when the vApp starts. Specifies a new amount of time to wait before performing the start action. This parameter accepts values in the range of 0 to 36000. Specifies a new action to be performed on the virtual machine when the vApp stops.
true false
Group
UInt16
false
false
StartAction StartDelaySeconds
CIVMStartAction UInt16
false false
false false
StopAction
CIVMStopAction
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
210/287
7/8/13
StopDelaySeconds UInt16
SwitchParameter
false
false
Zero or more modified CIVAppStartRule objects Notes Examples -------------- Example 1 -------------$ m y V A p p=G e t C I V A p p' M y V A p p ' $ m y V M 2=G e t C I V MN a m e' M y V M 2 'V A p p$ m y V A p p $ m y V M 2 S t a r t R u l e=G e t C I V A p p S t a r t R u l eV A p p$ m y V A p pV M$ m y V M 2 S e t C I V a p p S t a r t R u l eS t a r t R u l e$ m y V M 2 S t a r t R u l eS t a r t D e l a y S e c o n d s1 0 Modifies the delay of the start action that is performed on the specified virtual machine when the specified vApp starts. -------------- Example 2 -------------$ m y V A p p=G e t C I V A p p' M y V A p p ' $ m y V M 2=G e t C I V MN a m e' M y V M 2 'V A p p$ m y V A p p $ m y V M 2 S t a r t R u l e=G e t C I V A p p S t a r t R u l eV A p p$ m y V A p pV M$ m y V M 2 S e t C I V A p p S t a r t R u l eS t a r t R u l e$ m y V M 2 S t a r t R u l eS t a r t A c t i o nN o n e Sets the start action for the specified virtual machine to none. When the vApp starts, the virtual machine will not power on.
Set-CIVAppTemplate
Synopsis
This cmdlet modifies the configuration of the specified vApp template. Syntax Set-CIVAppTemplate [-VAppTemplate] <CIVAppTemplate[]> [-Server <CIServer[]>] [-Name <String>] [-Description <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-CIVAppTemplate [-VAppTemplate] <CIVAppTemplate[]> [-Server <CIServer[]>] [-StorageLease <TimeSpan>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVAppTemplate New-CIVAppTemplate Import-CIVAppTemplate Remove-CIVAppTemplate Detailed Description This cmdlet modifies the configuration of the specified vApp template. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VAppTemplate Confirm
CIVAppTemplate[] SwitchParameter
Specifies the vApp template you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new description for the vApp template you want to modify. Specifies a new name for the vApp template you want to modify. 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. Specifies the maximum amount of time for the vApp to remain stopped before vCloud Director automatically marks it as expired, or deletes it, depending on the organization policy. To specify that the lease is unlimited, pass $null. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
StorageLease
TimeSpan
false
false
SwitchParameter
false
false
Zero or more modified CIVAppTemplate objects Notes Examples -------------- Example 1 -------------$ t i m e S p a n=N e w O b j e c tS y s t e m . T i m e s p a n1 , 2 , 3# o n eh o u r ,t w om i n u t e s ,t h r e es e c o n d s S e t C I V A p p T e m p l a t eV A p p T e m p l a t e' M y V A p p T e m p l a t e 'S t o r a g e L e a s e$ t i m e S p a n Modifies the storage lease for the specified vApp template to one hour, two minutes, and three seconds. -------------- Example 2 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
211/287
7/8/13
Set-Cluster
Synopsis
This cmldlet modifies the configuration of a cluster. Syntax Set-Cluster [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-Cluster] <Cluster[]> [[Name] <String>] [-HAEnabled [<Boolean>]] [-HAAdmissionControlEnabled [<Boolean>]] [-HAFailoverLevel <Int32>] [-DrsEnabled [<Boolean>]] [-DrsMode <DrsMode>] [-DrsAutomationLevel <DrsAutomationLevel>] [-Profile <VMHostProfile>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Cluster New-Cluster Move-Cluster Remove-Cluster Detailed Description This cmdlet modifies the configuration of a cluster. HAEnabled is automatically set to $true if some of the HA settings, HAAdmissionControlEnabled, HAFailoverLevel, HARestartPriority, HAIsolationResponse, are specified. DrsEnabled is automatically set to $true if some of the DRS settings, DrsAutomationLevel, DrsMode, are specified. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the name of the cluster you want to configure. Specifies a new name for the cluster. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a DRS (Distributed Resource Scheduler) automation level. The valid values are FullyAutomated, Manual, and PartiallyAutomated. Indicates that VMware DRS (Distributed Resource Scheduler) is enabled. This parameter is deprecated and scheduled for removal. Use the DrsAutomationLevel parameter instead. Specifies a DRS (Distributed Resource Scheduler) mode. The valid values are FullyAutomated, Manual, and PartiallyAutomated.
DrsAutomationLevel
DrsAutomationLevel
false
false
DrsEnabled DrsMode
Boolean DrsMode
false false
false false
HAAdmissionControlEnabled
Boolean
Indicates that the virtual machines in the cluster will not start if they violate availability constraints. Indicates that VMware High Availability is enabled. Specifies a failover level. This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines. The valid values range from one to four. Specifies whether the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. The valid values are PowerOff and DoNothing. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies the cluster HA restart priority. The valid values are Disabled, Low, Medium, and High. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX/ESXi hosts. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies a host profile you want to associate with the cluster. If the value of this parameter is $null, the current profile association is removed. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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 ConnectVIServer.
false
false
HAEnabled HAFailoverLevel
Boolean Int32
false false
false false
HAIsolationResponse
HAIsolationResponse
false
false
HARestartPriority
HARestartPriority
false
false
Profile
VMHostProfile
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
212/287
7/8/13
VMSwapfilePolicy VMSwapfilePolicy
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type Zero or more modified Cluster objects Notes Examples -------------- Example 1 -------------$ c l u s t e r 1= N e w C l u s t e rN a m eC l u s t e r 1L o c a t i o nD a t a c e n t e r $ c l u s t e r 2=S e t C l u s t e rC l u s t e r$ c l u s t e r 1N a m eC l u s t e r 2 Creates a new cluster named Cluster1 on the Datacenter. Then renames the cluster to Cluster2.
Set-CustomAttribute
Synopsis
This cmdlet renames a custom attribute. Syntax Set-CustomAttribute [-CustomAttribute] <CustomAttribute[]> [-Name] <String> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CustomAttribute New-CustomAttribute Remove-CustomAttribute Get-Annotation Set-Annotation Detailed Description This cmdlet renames a custom attribute. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a new name for the custom attribute. Specifies the custom attribute you want to rename. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more modified CustomAttribute objects Notes Examples -------------- Example 1 -------------S e t C u s t o m A t t r i b u t eN a m eC r e a t i o n D e t a i l sC u s t o m A t t r i b u t eC r e a t i o n D a t e Renames a custom attribute from CreationDate to CreationDetails. -------------- Example 2 -------------G e t C u s t o m A t t r i b u t eN a m eC r e a t i o n D a t eS e r v e rs e r v e r 1 ,s e r v e r 2|S e t C u s t o m A t t r i b u t eN a m eC r e a t i o n D e t a i l s Renames the custom attributes retrieved from the specified vSphere servers from CreationDate to CreationDetails.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
213/287
7/8/13
Set-CustomField
Synopsis
This cmdlet modifies the value of a custom field for a specified inventory item. Syntax Set-CustomField [-Entity] <InventoryItem> [-Name] <String> [[-Value] <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-CustomField Remove-CustomField Detailed Description This cmdlet is deprecated and scheduled for removal. This cmdlet modifies the value of a custom field for a specified inventory item. If the custom field with this name does not exist, it is created for this type of items and then its value is set. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the inventory item to which the custom field you want to change belongs. Specifies the name of the custom field you want to change. Provides a new value for the custom field. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
WhatIf
SwitchParameter
false
false
Return Type The specified InventoryItem object Notes Examples -------------- Example 1 -------------G e t V MV M|S e t C u s t o m F i e l dN a m eC F-V a l u e1 0 Sets the value of the CF custom field of the VM virtual machine.
Set-Datacenter
Synopsis
This cmdlet modifies the properties of the specified datacenter. Syntax Set-Datacenter [-Datacenter] <Datacenter[]> [-Name] <String> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Datacenter Move-Datacenter New-Datacenter Remove-Datacenter Detailed Description This cmdlet modifies the properties of the specified datacenter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the datacenter whose properties you want to modify. Specifies a new name for the datacenter. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
214/287
7/8/13
Examples -------------- Example 1 --------------
Set-Datastore
Synopsis
This cmdlet modifies the properties of the specified datastore. Syntax Set-Datastore [-Datastore] <Datastore[]> [[-Name] <String>] [-CongestionThresholdMillisecond <Int32>] [-StorageIOControlEnabled [<Boolean>]] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-Datastore [-Datastore] <Datastore[]> -MaintenanceMode [<Boolean>] [-EvacuateAutomatically] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Datastore New-Datastore Remove-Datastore Move-Datastore Detailed Description This cmdlet modifies the properties of the specified datastore. You can use the following characters in a path, but not in a datastore name: slash (/), backslash (\), and percent (%). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Datastore Name
Datastore[] String
Specifies the datastore whose properties you want to change. Specifies a new name for the datastore. Do not use slash (/), backslash (\), and percent (%) characters in datastore names. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the latency period beyond which the storage array is considered congested. The range of this value is between 10 to 100 milliseconds. Specifies whether you want to automatically migrate all virtual machines to another datastore if the value of MaintenanceMode is $true. When the Storage DRS automation level is set to Fully Automated, you do not need to specify the EvacuateAutomatically parameter because Storage DRS will migrate all virtual machines automatically. If EvacuateAutomatically is specified, the SDRS placement and migration recommendations are automatically applied. If SDRS generates cluster DRS faults, an error report is displayed and the operation is cancelled. The report contains information about each datastore cluster DRS fault. If EvacuateAutomatically is not specified, an error report is displayed and the operation is cancelled. The error report contains information about each SDRS recommendation. If SDRS generates cluster DRS faults, an error report is displayed and the operation is cancelled. The error report contains information about each fault. If EvacuateAutomatically is explicitly set to false, the cmdlet blocks execution without displaying an error message. If SDRS generates datastore cluster DRS faults, the cmdlet stops responding and an error report is displayed. The report contains information about each cluster DRS fault.
true false
Confirm
SwitchParameter
false
false
$true
CongestionThresholdMillisecond
Int32
false
false
EvacuateAutomatically
SwitchParameter
false
false
MaintenanceMode
Boolean
Specifies whether you want to put the datastore in maintenance mode. The operation completes when no virtual machines are present and no provisioning processes are running on the datastore. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given
true
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
215/287
7/8/13
StorageIOControlEnabled WhatIf
Boolean SwitchParameter
Indicates whether you want to enable the IO control. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
false false
Return Type Zero or more modified Datastore objects Notes Examples -------------- Example 1 -------------G e t D a t a s t o r eN a m eD a t a s t o r e 1|S e t D a t a s t o r eN a m eD a t a s t o r e 2 Renames the Datastore1 datastore to Datastore2. -------------- Example 2 -------------S e t D a t a s t o r e$ d a t a s t o r e 1 ,$ d a t a s t o r e 2S t o r a g e I O C o n t r o l E n a b l e d$ t r u eC o n g e s t i o n T h r e s h o l d M i l l i s e c o n d8 0 Enables the Storage IO Control and set a congestion threshold of 80 milliseconds for the specified datastores. -------------- Example 3 -------------G e t D a t a s t o r eN a m e' M y D a t a s t o r e 1 '|S e t D a t a s t o r eM a i n t e n a n c e M o d e$ t r u eE v a c u a t e A u t o m a t i c a l l y Puts the MyDatastore1 datastore in maintenance mode and specifies that all virtual machines on the datastore will be automatically migrated to another datastore.
Set-DatastoreCluster
Synopsis
This cmdlet modifies the configuration of the specified datastore cluster. Syntax Set-DatastoreCluster -DatastoreCluster <DatastoreCluster[]> [-IOLatencyThresholdMillisecond <Int32>] [-IOLoadBalanceEnabled [<Boolean>]] [-Name <String>] [SdrsAutomationLevel <DrsAutomationLevel>] [-SpaceUtilizationThresholdPercent <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-DatastoreCluster New-DatastoreCluster Remove-DatastoreCluster Detailed Description This cmdlet modifies the configuration of the specified datastore cluster. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the datastore cluster that you want to configure. Specifies the maximum I/O latency in milliseconds allowed before Storage DRS is triggered for the datastore cluster. The parameter accepts values in the range of 5 to 100. If the value of IOLoadBalancing is $false, the setting for the I/O latency threshold is not applied. Specifies whether I/O load balancing is enabled for the datastore cluster. If the value is $false, I/O load balancing is disabled and the settings for the I/O latency threshold and utilized space threshold are not applied. Specifies a new name for the datastore cluster. Specifies the Storage DRS automation level for the datastore cluster. This parameter accepts Disabled, Manual, and FullyAutomated values. Specifies the vCenter Server systems 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-VIServer. Specifies the maximum percentage of consumed space allowed before Storage
false
false
DatastoreCluster IOLatencyThresholdMillisecond
DatastoreCluster[] Int32
true false
IOLoadBalanceEnabled
Boolean
false
false
Name SdrsAutomationLevel
String DrsAutomationLevel
false false
false false
Server
VIServer[]
false
false
SpaceUtilizationThresholdPercent
Int32
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
216/287
7/8/13
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type One or more modified DatastoreCluster objects Notes Examples -------------- Example 1 -------------S e t D a t a s t o r e C l u s t e rD a t a s t o r e C l u s t e rM y D a t a s t o r e C l u s t e r 1N a m e' M y D a t a s t o r e C l u s t e r 2 ' Changes the name of the specified datastore cluster. -------------- Example 2 -------------S e t D a t a s t o r e C l u s t e rD a t a s t o r e C l u s t e rM y D a t a s t o r e C l u s t e rI O L a t e n c y T h r e s h o l d M i l l i s e c o n d5 Sets the maximum I/O latency in milliseconds allowed before Storage DRS is triggered for the specified datastore cluster to 5 milliseconds. -------------- Example 3 -------------S e t D a t a s t o r e C l u s t e rD a t a s t o r e C l u s t e rM y D a t a s t o r e C l u s t e r-S d r s A u t o m a t i o n L e v e lF u l l y A u t o m a t e d Changes the Storage DRS automation level of the specified datastore cluster to Fully Automated.
Set-DeployRule
Synopsis
Updates an existing rule. Syntax Set-DeployRule [-DeployRule] <DeployRule> [-Name <String>] [-Pattern <String[]>] [-AllHosts] [-Item <VIObjectCore[]>] [<CommonParameters>] Related Commands Copy-DeployRule New-DeployRule Detailed Description Updates an existing rule with the specified items, patterns, or both. Rules cannot be changed once they have been used in the active rule set. Use Copy-DeployRule to make a copy of a rule with any desired changes. You must have the "AutoDeploy.Rule.Edit" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
The rule to be changed. Use the DeployRule or the Name parameter to specify the rule. Specify AllHosts to apply the changed rule to all hosts. Specify either AllHosts or Pattern. Item to apply to the specified hosts. The item can be an image profile, a host profile, or a cluster or folder in a vCenter Server system. This parameter supports object-by-name, so you can pass the name of the item. Name of the rule to apply changes to. Use the DeployRule or the Name parameter to specify the rule. Pattern that identifies the hosts to apply the rule to. Specify either AllHosts or Pattern. Pattern strings use the following syntax: <attr>==<value> Adds a pattern that exactly matches the specified value against the specified attribute. Use this syntax if you need to match a string that contains a comma. <attr>=<Val1 >[,val2,... ,valN] Adds a pattern that matches against the comma-separated list of values. Supported value types are: string Exact string match <ip1>-<ip2> Range of IPv4 addresses.
Name Pattern
String String[]
false false
false false
Return Type VMware.DeployAutomation.Types.DeployRule Notes Examples -------------- Example 1 -------------C : \ P S >S e t D e p l o y R u l e$ r u l eP a t t e r n" i p v 4 = 1 9 2 . 1 6 8 . 1 . 1 0 1 9 2 . 1 6 8 . 1 . 2 0 "
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
217/287
7/8/13
Updates the rule to apply to the hosts with IPv4 addresses in the specified range.
Set-DeployRuleSet
Synopsis
Sets the list of rules in the working rule set. Syntax Set-DeployRuleSet [-DeployRule] <DeployRule[]> [-NoActivate] [<CommonParameters>] Set-DeployRuleSet -Clear [-NoActivate] [<CommonParameters>] Related Commands Add-DeployRule Remove-DeployRule Detailed Description Explicitly sets the list of rules in the working rule set. By default, the change to the working set is immediately activated. Use the -Clear option to remove all rules from the working rule set. You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
The array of rules that will make up the rule set. Removes all rules from the working rule set. Specify the NoActivate parameter to apply the change to the working rule set but not to the active rule set.
VMware.DeployAutomation.Types.DeployRuleSet Notes Examples -------------- Example 1 -------------C : \ P S >G e t D e p l o y R u l e" t e s t r u l e " ," r u l e 2 "|S e t D e p l o y R u l e S e t Removes all rules from the working rule set and adds the rules named testrule and rule2.
Set-DrsRule
Synopsis
This cmdlet modifies an existing DRS rule. Syntax Set-DrsRule [[-Enabled] [<Boolean>]] [-Rule] <DrsRule[]> [-Name <String>] [-VM <VirtualMachine[]>] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-DrsRule New-DrsRule Remove-DrsRule Detailed Description This cmdlet modifies an existing DRS rule. Each rule defines the virtual machines that can run on the same host (affinity rule) or must run on different hosts (anti-affinity rule). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Indicates that the DRS rule is enabled. Specifies the DRS rule you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new name for the DRS rule. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies the virtual machines that can be referenced by the new DRS
Name RunAsync
String SwitchParameter
false false
false false
Server
VIServer[]
false
false
VM
VirtualMachine[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
218/287
7/8/13
rule. WhatIf Return Type Zero or more modified DrsVMAffinityRule objects Notes Examples -------------- Example 1 -------------$ v m=G e t V MD r s R u l e V M 1 * SwitchParameter
S e t D r s R u l eR u l e$ a f f i n i t y R u l eV M$ v mE n a b l e d$ t r u e ; Updates the list of virtual machines that might be referenced by the DRS rule stored in the $affinityRule variable and enables the rule.
Set-EsxImageProfile
Synopsis
Syntax Set-EsxImageProfile [-ImageProfile] <ImageProfile> [-Name <String>] [-Vendor <String>] [-SoftwarePackage <SoftwarePackage[]>] [-AcceptanceLevel <AcceptanceLevels>] [-Description <String>] [-ReadOnly] [-Force] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Detailed Description Set-EsxImageProfile is used to modify a user-created image profile. The cmdlet returns the modified ImageProfile object, which can be piped into any other cmdlet taking image profiles as input. For details on persistence, see New-EsxImageProfile. If the ReadOnly property of the image profile is true, you cannot modify the image profile. Image Builder performs all image profile validation tests on the modified image profile. The Name and Vendor of the modified image profile must be unique. If you attempt to change the Name and Vendor, and the new Name and Vendor are the same as an existing Name and Vendor, an error result. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ImageProfile
ImageProfile
(pipeline input, prompt) Specifies the image profile to edit. Takes one of the following forms: *Name of an image profile, as displayed in the Name column of Get-EsxImageProfile, or the Name property of any ImageProfile object *ImageProfile object
true
AcceptanceLevel
AcceptanceLevels
Optional. Specifies the minimum acceptance level allowed for VIBs in the image profile, one of the following: *VMwareCertified *VMwareAccepted *PartnerSupported *CommunitySupported If the acceptance level is raised above the lowest acceptance level of any VIB in the profile, an error results.
false
false
SwitchParameter String SwitchParameter Optional. Long string describing the contents or purpose of the image profile. Installs packages that break extensibility rules such as standard file path. Also bypasses dependency checks on packages. Use this option with care. Because it bypasses standard validation checks, an invalid image profile might result. String value to replace the current Name field with. Optional. Makes the image profile read only. (not modifiable). (pipeline input) One or more VIB software packages that the image profile should contain. Replaces the list of VIBs in the image profile. The value takes one of the following forms: *Name of a VIB, as displayed in the Name column of GetEsxSoftwarePackage, or the Name property of any SoftwarePackage object. The cmdlet selects the highest available version of the named package. *"<Name> <Version>", for specifying a specific version of a VIB named Name.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
219/287
7/8/13
---------- Example 1 ---------S e t E s x I m a g e P r o f i l eI m a g e P r o f i l e" P r o f i l eo faF o o l "S o f t w a r e P a c k a g ee s x b a s e , s c s i i p s , e s x t b o o t Modify the VIB list of an existing image profile ---------- Example 2 ---------$ m y p r o f i l e s=G e t E s x I m a g e P r o f i l e S e t E s x I m a g e P r o f i l eI m a g e P r o f i l e$ m y p r o f i l e s [ 2 ]A c c e p t a n c e L e v e lP a r t n e r S u p p o r t e d Change the acceptance level (maybe so that some VIB with a lower acceptance level can be added) of the third image profile from a list (index starts at 0): ---------- Example 3 ---------G e t E s x I m a g e P r o f i l e|S e t E s x I m a g e P r o f i l eR e a d O n l y Using pipelining to mark all profiles as read-only
Set-FloppyDrive
Synopsis
This cmdlet modifies the configuration of the specified virtual floppy drive. Syntax Set-FloppyDrive [-Floppy] <FloppyDrive[]> [-FloppyImagePath <String>] [-HostDevice <String>] [-NoMedia] [-StartConnected [<Boolean>]] [-Connected [<Boolean>]] [WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-FloppyDrive New-FloppyDrive Remove-FloppyDrive Detailed Description This cmdlet modifies the configuration of the specified virtual floppy drive. If a floppy image path is provided, the cmdlet sets the floppy drive to point to the image. Also, the cmdlet updates the StartConnected and Connected properties. If the value of the NoMedia parameter is $true, the cmdlet removes the floppy drive's media backing and disconnects it. The FloppyImagePath, HostDevice, and NoMedia parameters cannot be used together. The Connected parameter can be specified only if the corresponding virtual machine is powered on. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Floppy Confirm
FloppyDrive[] SwitchParameter
Specifies the virtual floppy drive you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. If the value is $true, the virtual floppy drive is connected after its creation. If the value is $false, the floppy drive is disconnected. This parameter can be specified only if the corresponding virtual machine is powered on. Specifies the datastore path to the floppy image file that backs the virtual floppy drive. Do not use this parameter when the HostDevice and NoMedia parameters are specified. Specifies the path to the floppy drive on the host that backs this virtual floppy drive. Do not use this parameter when the FloppyImagePath and NoMedia parameters are specified. Indicates that the floppy drive is to have no media (similar to removing the floppy from a physical drive). Do not use this parameter when the FloppyImagePath and HostDevice parameters are specified. If the value is $true, the virtual floppy drive starts connected when its associated virtual machine powers on. If the value is $false, it starts disconnected. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Connected
Boolean
false
false
FloppyImagePath
String
false
false
HostDevice
String
false
false
NoMedia
SwitchParameter
false
false
StartConnected
Boolean
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
220/287
7/8/13
Return Type Zero or more modified FloppyDrive objects Notes Examples -------------- Example 1 --------------
Set-Folder
Synopsis
This cmdlet modifies the properties of the specified folder. Syntax Set-Folder -Folder <Folder[]> [-Name] <String> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Folder Move-Folder New-Folder Set-Folder Remove-Folder Detailed Description This cmdlet modifies the properties of the specified folder. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Name Confirm
String SwitchParameter
Specifies a new name for the folder. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the folder whose properties you want to change. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Folder Server
Folder[] VIServer[]
true false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified Folder objects Notes Examples -------------- Example 1 -------------G e t F o l d e rN a m e" t e s t F o l d e r "|S e t F o l d e rN a m e" N e w F o l d e r N a m e " Renames the "testFolder" folder to "NewFolderName".
Set-HardDisk
Synopsis
This cmdlet modifies the properties of the specified virtual hard disk. Syntax Set-HardDisk [-HardDisk] <HardDisk[]> [[-CapacityKB] <Int64>] [-CapacityGB <Decimal>] [[-Persistence] <String>] [[-Datastore] <Datastore>] [-StorageFormat <VirtualDiskStorageFormat>] [-Controller <ScsiController>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-HardDisk [-HardDisk] <HardDisk[]> [[-CapacityKB] <Int64>] [-CapacityGB <Decimal>] [[-Persistence] <String>] [[-Datastore] <Datastore>] [-StorageFormat <VirtualDiskStorageFormat>] [-Controller <ScsiController>] [-Server <VIServer[]>] [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [-GuestCredential <PSCredential>] [-GuestUser <String>] [-GuestPassword <SecureString>] [-ToolsWaitSecs <Int32>] [-HelperVM <VirtualMachine>] [-Partition <String>] [-ResizeGuestPartition] [-WhatIf] [-Confirm] [<CommonParameters>] Set-HardDisk [-HardDisk] <HardDisk[]> [-Inflate] [-WhatIf] [-Confirm] [<CommonParameters>] Set-HardDisk [-HardDisk] <HardDisk[]> [-ZeroOut] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Copy-HardDisk Get-HardDisk New-HardDisk Remove-HardDisk Move-HardDisk Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
221/287
7/8/13
This cmdlet modifies the properties of the specified virtual hard disk. You can change the size and the persistence type, and inflate or expand the specified virtual hard disk. Do not use the Inflate parameter at the same time with the Persistence and CapacityGB parameters. If a helper virtual machine is used, all virtual machines associated with the disk and the helper virtual machine should be powered off before expanding the disk. When you resize more than one disks using a helper virtual machine, the disks are resized one by one causing the helper machine to power on and off for each virtual machine and this might slow the cmdlet performance. The guest disk resizing functionality supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit, and Redhat Enterprise 5 guest operating systems. Please consider the Set-HardDisk feature to be experimental as it might be changed or removed in a future release. To run this cmdlet to resize guest disk partitions against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet to resize guest disk partitions against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HardDisk CapacityKB
HardDisk[] Int64
Specifies the virtual hard disk you want to configure. This parameter is obsolete. Use CapacityGB instead. Specifies the updated capacity of the virtual disk in kilobytes (KB). If you are connected to a vCenter Server 2.0 or ESX 3.0 server, the size of the disk cannot be changed and the CapacityKB parameter is discarded. If you are connected to a vCenter Server 2.5 or ESX 3.5 server, the size of the disk can only be increased and the CapacityKB parameter is discarded if its value is less than the current disk size. Specifies the disk persistence mode. The valid values are Persistent, NonPersistent, IndependentPersistent, IndependentNonPersistent, and Undoable. This parameter is supported only when the disk type is rawVirtual or flat. The NonPersistent and Undoable values are deprecated and scheduled for removal. Their usage is not recommended because they do not work with snapshots and are not supported on ESX 3.5 and later. Specifies the datastore to which you want to move the specified hard disk. Moving a hard disk attached to a virtual machine to a different datastore is only supported on vCenter Server. Specifies the updated capacity of the virtual disk in gigabytes (GB). If you are connected to a vCenter Server 2.0 or ESX 3.0 server, the size of the disk cannot be changed and the CapacityGB parameter is discarded. If you are connected to a vCenter Server 2.5 or ESX 3.5 server, the size of the disk can only be increased and the CapacityGB parameter is discarded if its value is less than the current disk size. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a SCSI controller to which you want to attach the hard disk. Specifies the PSCredential object that contains the credentials you want to use for authenticating with the guest operating system. Specifies the password you want to use for authenticating with the guest operating system. Specifies the username you want to use for authenticating with the guest operating system. Specifies a helper virtual machine you want to use when expanding a Windows virtual machine system disk. LVM (logical volume manager) for Linux is not supported and Linux guest system disks cannot be expanded. When a helper virtual machine is used, all virtual machines associated with the disk and the helper virtual machine must be powered off before expanding the disk. When you resize more than one disks using a helper virtual machine, the disks are resized one by one causing the helper machine to power on and off for each virtual machine, and this might slow down the cmdlet performance. Specifies the PSCredential object that contains the credentials you want to use for authenticating with the host. Specifies the password you want to use for authenticating with the host. Specifies the username you want to use for authenticating with the host. Indicates that you want to inflate the hard disk. Specifies the partitions you want to resize. On Windows, you can specify which partition you want to resize by using the Partition parameter. If you do not specify a partition, the last partition of the disk is resized. On Linux, only the last partition can be expanded. Resizing guest partitions is supported only for Windows OS and for ext3 partitions on RHEL 5. It is
true false
Persistence
String
false
false
Datastore
Datastore
false
false
CapacityGB
Decimal
false
false
Confirm
SwitchParameter
false
false
$true
Controller GuestCredential
ScsiController PSCredential
false false
false false
HostCredential
PSCredential
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
222/287
7/8/13
ResizeGuestPartition
SwitchParameter
Indicates that you want to resize the guest partition of the disk. To use this feature, VMware Tools must be running on the virtual machine. On Windows, you can specify which partition you want to resize by using the Partition parameter. If you don't specify a partition, the last partition of the disk is resized. On Linux, only the last partition can be expanded. Resizing guest partitions is supported only for Windows OS and for ext3 partitions on RHEL 5. It is achieved by scripts, provided with the vSphere PowerCLI installation. You can modify these scripts or add new ones to support operating systems different than Windows and RHEL 5, and more specific disk resizing scenarios. The scripts are located in the "Scripts" folder in the PowerCLI installation directory and their names have the following format: GuestDiskExpansion_<OS_Identifier> <OS_Identifier> is the guest family or the guest ID (as returned by Get-VMGuest).
false
false
Server
VIServer[]
Specifies the vCenter Server systems 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-VIServer. Specifies the storage format of the relocated hard disk. This parameter is applicable only when moving a virtual machine disk to a different datastore, using the Datastore parameter. This parameter accepts Thin, Thick, and EagerZeroedThick values. Specifies the time in seconds to wait for a response from VMware Tools. If a non-positive value is provided, the system waits infinitely long time. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Specifies that you want to fill the hard disk with zeros. This parameter is supported only if you are directly connected to an ESX/ESXi host. The ZeroOut functionality is experimental.
false
false
StorageFormat
VirtualDiskStorageFormat
false
false
ToolsWaitSecs
Int32
false
false
$null
WhatIf
SwitchParameter
false
false
ZeroOut
SwitchParameter
false
false
Return Type Zero or more modified HardDisk objectsHardDisk Notes Set-HardDisk cannot inflate a hard disk that has already been inflated. Non-persistent and undoable disks are not supported. Migrating a hard disk attached to a virtual machine to a different datastor e is supported only on vCenter Server. Examples -------------- Example 1 -------------G e t H a r d D i s kV M$ v m|S e t H a r d D i s kP e r s i s t e n c e" I n d e p e n d e n t N o n P e r s i s t e n t " Changes the persistence of a hard disk to IndependentNonPersistent. -------------- Example 2 -------------S e t H a r d D i s kH a r d D i s k$ h a r d d i s kC a p a c i t y G B$ e x t e n d e d C a p a c i t yG u e s t C r e d e n t i a l$ g u e s t C r e d Extends a hard disk with the specified capacity. The command also extends the disk on the guest OS. -------------- Example 3 -------------S e t H a r d D i s kH a r d D i s k$ h a r d d i s kD a t a s t o r e$ d a t a s t o r e Moves the hard disk to the specified datastore.
Set-IScsiHbaTarget
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 223/287
7/8/13
Syntax
This cmdlet modifies the configuration of an iSCSI HBA target. Set-IScsiHbaTarget -Target <IScsiHbaTarget[]> [-ChapType <ChapType>] [-ChapName <String>] [-ChapPassword <String>] [-MutualChapEnabled [<Boolean>]] [MutualChapName <String>] [-MutualChapPassword <String>] [-InheritChap [<Boolean>]] [-InheritMutualChap [<Boolean>]] [-Server <VIServer[]>] [-WhatIf] [Confirm] [<CommonParameters>] Related Commands Online version Get-IScsiHbaTarget New-IScsiHbaTarget Remove-IScsiHbaTarget Get-VMHostHba Set-VMHostHba Detailed Description This cmdlet modifies the configuration of an iSCSI HBA target. The cmdlet modifies the CHAP and Digest properties of an iSCSI HBA target. You must specify at least one of the CHAP-related (or Mutual CHAP) parameters. Otherwise, an error message is displayed. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ChapName
String
false
false
Use the old name if any. Otherwise, use the initiator name.
ChapPassword ChapType
String ChapType
Specifies the CHAP password if CHAP is enabled. Specifies the type of the CHAP authorization. The valid values are Prohibited, Discouraged, Preferred, and Required. If you set ChapType to Discouraged, Preferred, or Required, then you must specify the ChapPassword parameter as well. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the CHAP setting is inherited from the iSCSI HBA device. Indicates that the Mutual CHAP setting is inherited from the iSCSI HBA device. Indicates that mutual CHAP is enabled. In this case, you must specify the MutualChapPassword parameter as well. Specifies the Mutual CHAP initiator name if CHAP is enabled.
false false
false false
Confirm
SwitchParameter
false
false
$true
false false false false Use the old name if any. Otherwise, use the initiator name.
MutualChapPassword Server
String VIServer[]
Specifies the Mutual CHAP password if CHAP is enabled. Specifies the vCenter Server systems 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 ConnectVIServer. Specifies the iSCSI HBA target you want to configure. To identify the target, you can provide an IScsiTarget object or use an <Address>:<Port> string. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
false false
Target
IScsiHbaTarget[]
true
true (ByValue)
SwitchParameter
false
false
Zero or more modified IScsiHbaTarget objects Notes CHAP configuration is supported only on vCenter Server/ESX 4.0 and later. Examples -------------- Example 1 -------------G e t I S c s i H b a T a r g e tA d d r e s s" 1 0 . 2 3 . 8 4 . 7 3 "T y p eS t a t i c|S e t I S c s i H b a T a r g e tC h a p T y p eP r o h i b i t e d Retrieves the targets of type Static on the specified address and sets their CHAP type to Prohibited. -------------- Example 2 -------------$ t a r g e t=G e t I S c s i H b a T a r g e tA d d r e s s" 1 0 . 2 3 . 8 4 . 7 3 "T y p eS e n d S e t I S c s i H b a T a r g e tT a r g e t$ t a r g e tC h a p T y p eR e q u i r e dC h a p P a s s w o r dp a s s 1M u t u a l C h a p E n a b l e dM u t u a l C h a p P a s s w o r dp a s s 2 Modifies the CHAP and Mutual CHAP settings of the targets of type Send on the specified address.
Set-NetworkAdapter
Synopsis
This cmdlet modifies the configuration of the virtual network adapter. Syntax Set-NetworkAdapter [-NetworkAdapter] <NetworkAdapter[]> [-MacAddress <String>] [-NetworkName <String>] [-StartConnected [<Boolean>]] [-Connected
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
224/287
7/8/13
[<Boolean>]] [-WakeOnLan [<Boolean>]] [-Type <VirtualNetworkAdapterType>] [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-NetworkAdapter [-NetworkAdapter] <NetworkAdapter[]> [-MacAddress <String>] [-StartConnected [<Boolean>]] [-Connected [<Boolean>]] [-WakeOnLan [<Boolean>]] [-Type <VirtualNetworkAdapterType>] -PortId <String> -DistributedSwitch <DistributedSwitch> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-NetworkAdapter [-NetworkAdapter] <NetworkAdapter[]> -Portgroup <VirtualPortGroupBase> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-NetworkAdapter New-NetworkAdapter Remove-NetworkAdapter Detailed Description This cmdlet modifies the configuration of the virtual network adapter. You can change the MAC address and the network name, and to configure the Connected, StartConnected, and WakeOnLan properties of the adapter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
NetworkAdapter Confirm
NetworkAdapter[] SwitchParameter
Specifies the virtual network adapter you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. If the value is $true, the virtual network adapter is connected after its creation. If the value is $false, it is disconnected. Specifies a virtual switch to which you want to connect the network adapter. Specifies an optional MAC address for the virtual network adapter. Specifies the name of the network to which you want to connect the virtual network adapter. Specifying a distributed port group name is obsolete. Use the Portgroup parameter instead. Specifies a standard or a distributed port group to which you want to connect the network adapter. Specifies the port of the virtual switch to which you want to connect the network adapter. Use this parameter only if the DistributedSwitch parameter is specified. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. If the value is $true, the virtual network adapter starts connected when its associated virtual machine powers on. If the value is $false, it starts disconnected. Specifies the type of the network adapter. The valid types are e1000, Flexible, Vmxnet, EnhancedVmxnet, and Vmxnet3, and Unknown. Indicates that wake-on-LAN is enabled on the virtual network adapter. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Connected
Boolean
false
false
Portgroup PortId
VirtualPortGroupBase String
true true
false false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
StartConnected
Boolean
false
false
Type
VirtualNetworkAdapterType
false
false
WakeOnLan WhatIf
Boolean SwitchParameter
false false
false false
Return Type Zero or more modified NetworkAdapter objcts Notes Examples -------------- Example 1 -------------G e t V MV M|G e t N e t w o r k A d a p t e r|S e t N e t w o r k A d a p t e rM a c A d d r e s s' 0 0 : 5 0 : 5 6 : a 1 : 0 0 : 0 0 'W a k e O n L a n : $ t r u e Configures the Mac address and the WakeOnLan setting of a virtual network adapter. -------------- Example 2 -------------G e t V MV M|G e t N e t w o r k A d a p t e r|S e t N e t w o r k A d a p t e rT y p eE n h a n c e d V m x n e t Sets the type of the virtual network adapter. -------------- Example 3 -------------G e t V MV M|G e t N e t w o r k A d a p t e r|S e t N e t w o r k A d a p t e rC o n n e c t e d : $ t r u e Sets the connection state of the virtual network adapter. -------------- Example 4 -------------$ m y N e t w o r k A d a p t e r s=G e t V M|G e t N e t w o r k A d a p t e rN a m e" N e t w o r ka d a p t e r1 " $ m y V D P o r t G r o u p=G e t V D P o r t g r o u pN a m eM y V D P o r t G r o u p
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
225/287
7/8/13
S e t N e t w o r k A d a p t e rN e t w o r k A d a p t e r$ m y N e t w o r k A d a p t e r sP o r t g r o u p$ m y V D P o r t G r o u p Retrieves all network adapters named "Network adapter 1" from all virtual machines and connects them to the specified distributed port group. -------------- Example 5 -------------$ m y N e t w o r k A d a p t e r=G e t V MN a m eM y V M|G e t N e t w o r k A d a p t e rN a m e" N e t w o r ka d a p t e r1 " $ m y V D S w i t c h=G e t V D S w i t c hN a m eM y V D S w i t c h S e t N e t w o r k A d a p t e rN e t w o r k A d a p t e r$ m y N e t w o r k A d a p t e rD i s t r i b u t e d S w i t c h$ M y V D S w i t c hP o r t I d1 0 0 Retrieves the network adapter named "Network adapter 1" added to the specified virtual machine and connects it to the specified port on the specified distributed switch.
Set-NicTeamingPolicy
Synopsis
This cmdlet modifies the specified NIC teaming policy. Syntax Set-NicTeamingPolicy [-VirtualSwitchPolicy] <NicTeamingVirtualSwitchPolicy[]> [-BeaconInterval <Int32>] [-LoadBalancingPolicy <LoadBalancingPolicy>] [NetworkFailoverDetectionPolicy <NetworkFailoverDetectionPolicy>] [-NotifySwitches [<Boolean>]] [-FailbackEnabled [<Boolean>]] [-MakeNicActive <PhysicalNic[]>] [MakeNicStandby <PhysicalNic[]>] [-MakeNicUnused <PhysicalNic[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-NicTeamingPolicy [-VirtualPortGroupPolicy] <NicTeamingVirtualPortGroupPolicy[]> [-InheritLoadBalancingPolicy [<Boolean>]] [-InheritNetworkFailoverDetectionPolicy [<Boolean>]] [-InheritNotifySwitches [<Boolean>]] [-InheritFailback [<Boolean>]] [-InheritFailoverOrder [<Boolean>]] [-LoadBalancingPolicy <LoadBalancingPolicy>] [NetworkFailoverDetectionPolicy <NetworkFailoverDetectionPolicy>] [-NotifySwitches [<Boolean>]] [-FailbackEnabled [<Boolean>]] [-MakeNicActive <PhysicalNic[]>] [MakeNicStandby <PhysicalNic[]>] [-MakeNicUnused <PhysicalNic[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-NicTeamingPolicy Detailed Description This cmdlet modifies the specified NIC teaming policy. You can change the load balancing and failover settings. Default NIC teaming policies are set for the entire virtual switch and can be overridden at port group level. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the virtual port group policy to configure. Specifies the virtual switch policy to configure. Specifies the interval at which the server sends out beacon probes on all NICs in the team. The value must be a positive integer. This parameter is used when the value of the NetworkFailoverDetectionPolicy parameter is BeaconProbing. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies how a physical adapter is returned to active duty after recovering from a failure. If the value is $true, the adapter is returned to active duty immediately on recovery, displacing the standby adapter that took over its slot, if any. If the value is $false, a failed adapter is left inactive even after recovery until another active adapter fails, requiring its replacement. Indicates that the value of the FailbackEnabled parameter is inherited from the virtual switch. Indicates that the value of the MakeNicActive, MakeNicStandBy, and MakeNicUnused parameters are inherited from the virtual switch. Indicates that the value of the LoadBalancingPolicy parameter is inherited from the virtual switch. Indicates that the value of the NetworkFailoverDetectionPolicy parameter is inherited from the virtual switch. Indicates that the value of the NotifySwitches parameter is
Confirm
SwitchParameter
false
false
$true
FailbackEnabled
Boolean
false
false
$true
InheritFailback
Boolean
false
false
InheritFailoverOrder
Boolean
false
false
InheritLoadBalancingPolicy
Boolean
false
false
InheritNetworkFailoverDetectionPolicy
Boolean
false
false
InheritNotifySwitches
Boolean
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
226/287
7/8/13
LoadBalancingPolicy
LoadBalancingPolicy
Determines how network traffic is distributed between the network adapters assigned to a switch. The following values are valid: LoadBalanceIP - Route based on IP hash. Choose an uplink based on a hash of the source and destination IP addresses of each packet. For non-IP packets, whatever is at those offsets is used to compute the hash. LoadBalanceSrcMac - Route based on source MAC hash. Choose an uplink based on a hash of the source Ethernet. LoadBalanceSrcId - Route based on the originating port ID. Choose an uplink based on the virtual port where the traffic entered the virtual switch. ExplicitFailover - Always use the highest order uplink from the list of Active adapters that passes failover detection criteria.
false
false
$null
MakeNicActive
PhysicalNic[]
Specifies the adapters you want to continue to use when the network adapter connectivity is available and active. Specifies the adapters you want to use if one of the active adapter's connectivity is unavailable. Specifies the adapters you do not want to use. Specifies how to reroute traffic in the event of an adapter failure. The following values are valid: LinkStatus - Relies solely on the link status that the network adapter provides. This option detects failures, such as cable pulls and physical switch power failures, but not configuration errors, such as a physical switch port being blocked by spanning tree or misconfigured to the wrong VLAN or cable pulls on the other side of a physical switch. BeaconProbing - Sends out and listens for beacon probes on all NICs in the team and uses this information, in addition to link status, to determine link failure. This option detects many of the failures mentioned above that are not detected by link status alone.
false
false
MakeNicStandby
PhysicalNic[]
false
false
MakeNicUnused NetworkFailoverDetectionPolicy
PhysicalNic[] NetworkFailoverDetectionPolicy
false false
NotifySwitches
Boolean
Indicates that whenever a virtual NIC is connected to the virtual switch or whenever that virtual NIC's traffic is routed over a different physical NIC in the team because of a failover event, a notification is sent over the network to update the lookup tables on the physical switches. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
$true
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified NicTeamingVirtualSwitchPolicy or NicTeamingVirtualPortGroupPolicy objects Notes Examples -------------- Example 1 -------------$ p o l i c y=G e t V i r t u a l S w i t c hV M H o s t( G e t V M H o s t* . 1 2 8 )N a m ev S w i t c h 1|G e t N i c T e a m i n g P o l i c y $ p o l i c y|S e t N i c T e a m i n g P o l i c yL o a d B a l a n c i n g P o l i c yL o a d B a l a n c e S r c M a c
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
227/287
7/8/13
Set-Org
Synopsis
This cmdlet modifies the configuration of the specified organization. Syntax Set-Org [-Org] <Org[]> [-Name <String>] [-FullName <String>] [-Description <String>] [-Enabled [<Boolean>]] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Org New-Org Remove-Org Detailed Description This cmdlet modifies the configuration of the specified organization. Note: This cmdlet is available only to Provider Administrators. To ensure backward compatibility, PowerCLI provides limited support for this cmdlet for Tenant Administrators against vCloud Director 5.1 environments. When you develop new tenant scripts for vCloud Director 5.1 environments, do not use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Org Confirm
Org[] SwitchParameter
Specifies the organization that you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a description for the organization you want to modify. Specifies whether you want to enable or disable the organization. Note: This parameter is only available to Provider Administrators. Specifies a new full name for the organization. Specifies a new unique name identifier for the organization. To set a new unique name identifier for organizations in a vCloud Director 5.1 environment, you need to disable the organization first. Note: This parameter is only available to Provider Administrators. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Server
CIServer[]
false
false
$defaultCIServers
SwitchParameter
false
false
Zero or more modified Organization objects Notes Examples -------------- Example 1 -------------G e t O r gN a m e" M y O r g "|S e t O r gE n a b l e d : $ f a l s e|S e t O r gN a m e" M y O r g N e w N a m e "F u l l N a m e" M y O r g F u l l N a m e 2 "D e s c r i p t i o n" U p d a t em yO r g " Disables an organization and modifies its unique name identifier, its full name and its description. -------------- Example 2 -------------G e t O r gN a m e' M y O r g '|S e t O r gF u l l N a m e' M y N e w O r g F u l l N a m e 'D e s c r i p t i o n" T h i si sm yu p d a t e do r g a n i z a t i o n . " Updates the full name and the description of the specified organization. Note: This example is supported only on vCloud Director 1.5.x environments.
Set-OrgNetwork
Synopsis
This cmdlet modifies the configuration of the specified organization network. Syntax Set-OrgNetwork [-OrgNetwork] <OrgNetwork[]> [-Name <String>] [-Description <String>] [-PrimaryDns <IPAddress>] [-SecondaryDns <IPAddress>] [-DnsSuffix <String>] [-StaticIPPool <IPRangeList>] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OrgNetwork New-OrgNetwork Remove-OrgNetwork
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
228/287
7/8/13
Detailed Description
This cmdlet modifies the configuration of the specified organization network. Note: This cmdlet is only available to Provider Administrators. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OrgNetwork Confirm
OrgNetwork[] SwitchParameter
Specifies the organization network that you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new description for the organization network that you want to configure. Specifies a new DNS suffix for the organization network that you want to configure. Specifies a new name for the organization network that you want to configure. Specifies a new primary DNS for the organization network that you want to configure. Specifies a new secondary DNS for the organization network that you want to configure. 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. Specifies a new range of static IP addresses that the organization network will allocate to virtual machines. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
StaticIPPool WhatIf
IPRangeList SwitchParameter
false false
false false
Return Type Zero or more modified OrgNetwork objects Notes Examples -------------- Example 1 -------------$ m y O r g N e t w o r k=G e t O r g N e t w o r kN a m e' M y I n t e r n a l O r g N e t w o r k ' S e t O r g N e t w o r kO r g N e t w o r k$ m y O r g N e t w o r kD n s S u f f i x" m y O r g N e w D n s "P r i m a r y D n s" 1 9 2 . 1 6 8 . 1 0 . 1 "S e c o n d a r y D n s" 1 9 2 . 1 6 8 . 1 0 . 2 " Modifies the DNS settings for the specified internal organization network. -------------- Example 2 -------------$ m y O r g N e t w o r k=G e t O r g N e t w o r kN a m e' M y I n t e r n a l O r g N e t w o r k ' S e t O r g N e t w o r kO r g N e t w o r k$ m y O r g N e t w o r kS t a t i c I p P o o l" 1 9 2 . 1 6 8 . 1 0 . 4 2 1 9 2 . 1 6 8 . 1 0 . 6 6 " Changes the range of static IP addresses that are available for the organization network to allocate to virtual machines.
Set-OrgVdc
Synopsis
This cmdlet modifies the configuration of the specified organization virtual datacenter (vDC). Syntax Set-OrgVdc [-OrgVdc] <OrgVdc[]> [-CpuAllocationGHz <Double>] [-CpuGuaranteedPercent <Int32>] [-Description <String>] [-Enabled [<Boolean>]] [MemoryAllocationGB <Decimal>] [-MemoryGuaranteedPercent <Int32>] [-Name <String>] [-NetworkMaxCount <Int32>] [-NetworkPool <NetworkPool>] [-NicMaxCount <Int32>] [-Server <CIServer[]>] [-StorageAllocationGB <Decimal>] [-ThinProvisioned [<Boolean>]] [-UseFastProvisioning [<Boolean>]] [-VMCpuCoreMHz <Int64>] [VMMaxCount <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OrgVdc New-OrgVdc Remove-OrgVdc Detailed Description This cmdlet modifies the configuration of the specified organization virtual datacenter (vDC). Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OrgVdc Confirm
OrgVdc[] SwitchParameter
Specifies the organization vDC that you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the CPU resources in gigahertz (GHz) that you want to allocate to the organization vDC. This parameter is only applicable to the Allocation Pool and Resource Pool resource allocation models. Specifies the percentage of CPU resources that are reserved for the organization vDC. This parameter accepts values in the range of 0 to 100. This parameter is only applicable to the Pay As You Go and Allocation Pool resource allocation models.
true false
CpuAllocationGHz
Double
false
false
CpuGuaranteedPercent
Int32
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
229/287
7/8/13
Description Enabled MemoryAllocationGB String Boolean Decimal
MemoryGuaranteedPercent
Int32
false
false
Name NetworkMaxCount
String Int32
false false
false false
NetworkPool
NetworkPool
false
false
NicMaxCount
Int32
false
false
Server
CIServer[]
false
false
StorageAllocationGB
Decimal
false
false
Indicates whether you want to enable thin provisioning. Indicates whether you want to enable fast provisioning. Specifies a vCPU speed in megahertz (MHz). This value defines what a virtual machine with one vCPU will consume at maximum when running within this organization vDC. A virtual machine with two vCPUs would consume a maximum of twice this value. This parameter is only applicable to the Pay As You Go resource allocation model. Specifies the maximum number of virtual machines in the organization vDC. To specify that there is no limit, pass $null. This parameter is only applicable to the Pay As You Go resource allocation model. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
VMMaxCount
Int32
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified OrgVdc objects Notes Examples -------------- Example 1 --------------
G e t O r g V d cN a m e' M y P a y A s Y o u G o O r g V d c '|S e t O r g V d cN a m e" N e w O r g V d c N a m e "D e s c r i p t i o n" T h es e t t i n g sf o rt h i so r g a n i z a t i o nv D Ch a v eb e e nm o d i f i e d . "V M M a x C o u n t Modifies the name and description of the organization vDC, and changes the maximum number of virtual machines and the vCPU speed in the organization vDC. Disables the organization vDC. -------------- Example 2 -------------$ m y N e t w o r k P o o l=G e t N e t w o r k P o o lN a m e' M y N e t w o r k P o o l ' G e t O r g V d cN a m e' M y R e s e r v a t i o n P o o l O r g V d c '|S e t O r g V d cN e t w o r k P o o l$ m y N e t w o r k P o o lN e t w o r k M a x C o u n t3N i c M a x C o u n t$ n u l l Changes the network pool, the maximum number of networks and the maximum amount of NICs in the organization vDC. -------------- Example 3 --------------
G e t O r g V d cN a m e' M y A l l o c a t i o n P o o l O r g V d c '|S e t O r g V d cM e m o r y A l l o c a t i o n G B0 . 1M e m o r y G u a r a n t e e d P e r c e n t7 5S t o r a g e A l l o c a t i o n G B0 . 1C p u A l l o c a t i o n G H z0 . 3C p u Modifies the memory, storage, and CPU allocation settings for the organization vDC, and enables thin and fast provisioning.
Set-OSCustomizationNicMapping
Synopsis
This cmdlet modifies the provided OS customization NIC mappings.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
230/287
7/8/13
Syntax
Set-OSCustomizationNicMapping -OSCustomizationNicMapping <OSCustomizationNicMapping[]> [-Position <Int32>] [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [-VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [-Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-OSCustomizationNicMapping -OSCustomizationNicMapping <OSCustomizationNicMapping[]> [-NetworkAdapterMac <String>] [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [-VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [-Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-OSCustomizationNicMapping New-OSCustomizationNicMapping Remove-OSCustomizationNicMapping Detailed Description This cmdlet modifies the provided OS customization NIC mappings. If the parent spec of the provided NIC mapping is a server-side spec, it is updated on the server. If the parent spec is client-side, the reference that is kept in the memory is updated, but the variable that is passed to the cmdlet is not modified. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
IpAddress
String
Specifies an IP address. Using this parameter automatically sets the IpMode parameter to UseStaticIp. Specifies a subnet mask. Specifies a default gateway. Specifies a DNS address. This parameter applies only to Windows operating systems. Specifies an alternate gateway. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the IP configuration mode. The valid values are UseDhcp, PromptUser, UseVCApplication, and UseStaticIP. Specifies the MAC address of the network adapter to which you want to map the OS customization specification. Specifies the OS customization NIC mapping you want to configure. Specifies the position of the mapping you want to modify. Specifies the vCenter Server systems 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-VIServer. Specifies a new argument you want to pass to VCApplication in order to obtain an IP address. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Specifies WINS servers. This parameter applies only to Windows operating systems.
false
false
AlternateGateway Confirm
String SwitchParameter
false false
IpMode
OSCustomizationIPMode
false
false
UseDhcp
NetworkAdapterMac
String
false
false
VCApplicationArgument
String
false
false
WhatIf
SwitchParameter
false
false
Wins
String[]
false
false
Return Type Zero or more modified OSCustomizationNicMapping objects Notes Examples -------------- Example 1 -------------G e t O S C u s t o m i z a t i o n S p e cS p e c|G e t O S C u s t o m i z a t i o n N i c M a p p i n g|S e t O S C u s t o m i z a t i o n N i c M a p p i n gI p A d d r e s s1 0 . 0 . 0 . 2 Modifies the IP address of the specified NIC mapping that uses static IP mode. -------------- Example 2 -------------G e t O S C u s t o m i z a t i o n S p e cS p e c|G e t O S C u s t o m i z a t i o n N i c M a p p i n g|S e t O S C u s t o m i z a t i o n N i c M a p p i n gV c A p p l i c a t i o n A r g u m e n t" s u b n e t 2 " Modifies the VCApplication argument of the specified NIC mapping. -------------- Example 3 --------------
G e t O S C u s t o m i z a t i o n S p e cS p e c|G e t O S C u s t o m i z a t i o n N i c M a p p i n g|S e t O S C u s t o m i z a t i o n N i c M a p p i n gI p M o d eU s e S t a t i c I pI p A d d r e s s1 0 . 1 0 . 0 . 1S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . Modifies the attributes of a NIC mapping. -------------- Example 4 -------------S e t O S C u s t o m i z a t i o n N i c M a p p i n gO S C u s t o m i z a t i o n N i c M a p p i n g$ n i c M a p p i n g 1 ,$ n i c M a p p i n g 2I P M o d eU s e V C A p p l i c a t i o nV c A p p l i c a t i o n A r g u m e n t" s u b n e t 2 " Modifies the specified NIC mapping using VCApplication.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
231/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Set-OSCustomizationSpec
Synopsis
This cmdlet modifies the specified OS customization specification. Syntax Set-OSCustomizationSpec [-OSCustomizationSpec] <OSCustomizationSpec[]> [-NewSpec <OSCustomizationSpec>] [-Type <OSCustomizationSpecType>] [-Server <VIServer[]>] [-Name <String>] [-DnsServer <String[]>] [-DnsSuffix <String[]>] [-Domain <String>] [-NamingScheme <String>] [-NamingPrefix <String>] [-Description <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-OSCustomizationSpec [-FullName <String>] [-OrgName <String>] [-ChangeSID [<Boolean>]] [-DeleteAccounts [<Boolean>]] [-OSCustomizationSpec] <OSCustomizationSpec[]> [-NewSpec <OSCustomizationSpec>] [-Type <OSCustomizationSpecType>] [-Server <VIServer[]>] [-Name <String>] [-DnsServer <String[]>] [-DnsSuffix <String[]>] [-GuiRunOnce <String[]>] [-AdminPassword <String>] [-TimeZone <String>] [-AutoLogonCount <Int32>] [-Domain <String>] [-Workgroup <String>] [-DomainCredentials <PSCredential>] [-DomainUsername <String>] [-DomainPassword <String>] [-ProductKey <String>] [-NamingScheme <String>] [NamingPrefix <String>] [-Description <String>] [-LicenseMode <LicenseMode>] [-LicenseMaxConnections <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-OSCustomizationSpec Detailed Description This cmdlet modifies the specified OS customization specification. The specification to be updated is identified by one or both of the Name and Spec parameters. If a Windows specification is to be updated, one of the Domain and Workgroup parameters must be provided. If a Linux specification is to be updated, the Domain parameter must be provided. This cmdlet runs only on x32 process. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
OSCustomizationSpec AdminPassword
OSCustomizationSpec[] String
Specifies the specification you want to modify. Specifies the new OS administrator's password. This parameter applies only to Windows operating systems. Specifies the number of times the virtual machine should automatically login as an administrator. The valid values are in the range between 0 and Int32.MaxValue. Specifying 0 disables auto log-on. This parameter applies only to Windows operating systems. Indicates that the customization should modify the system security identifier (SID). This parameter applies only to Windows operating systems. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to delete all user accounts. This parameter applies only to Windows operating systems. Provides a new description for the specification. Specifies the DNS server. This parameter applies only to Linux operating systems. Specifies the DNS suffix. This parameter applies only to Linux operating systems. Specifies the domain name. Specifies credentials for authentication with the specified domain. This parameter applies only to Windows operating systems. Specifies a password for authentication with the specified domain. This parameter applies only to Windows operating systems. Specifies a username for authentication with the specified domain. This parameter applies only to Windows operating systems. Specifies the administrator's full name. This parameter applies only to Windows operating systems. Provides a list of commands to run after first user login. This parameter applies only to Windows operating systems. Specifies the maximum connections for server license mode. Use this parameter only if the LicenseMode parameter is set to Perserver. This parameter applies only to Windows operating systems. Specifies the license mode of the Windows 2000/2003 guest operating system. The valid values are Perseat, Perserver, and NotSpecified. If Perserver is set, use the LicenseMaxConnection parameter to define the maximum number of connections. This parameter applies only to Windows operating systems. Specifies a new name for the OS customization specification. The behavior of this parameter is related to
true false
AutoLogonCount
Int32
false
false
ChangeSID
Boolean
false
false
Confirm
SwitchParameter
false
false
$true
DeleteAccounts
Boolean
false
false
empty string
empty string
DomainPassword
String
false
false
DomainUsername
String
false
false
FullName
String
false
false
GuiRunOnce
String[]
false
false
LicenseMaxConnections
Int32
false
false
$null
LicenseMode
LicenseMode
false
false
NotSpecified
Name NamingPrefix
String String
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
232/287
7/8/13
NamingScheme
String
Specifies the naming scheme for the virtual machine. The valid values are Custom, Fixed, Prefix, and Vm. If no other parameters are provided, this parameter specifies a specification from which to retrieve information for the updated specification. Specifies the name of the organization to which the administrator belongs. Specifies the MS product key. If the guest OS version is earlier than Vista, this parameter is required in order to make the customization unattended. For Windows Vista and later, the OS customization is unattended no matter if the ProductKey parameter is set. Specifies the vCenter Server systems 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-VIServer. Specifies the name or ID of the time zone for a Windows guest OS only. Using wildcards is supported. The following time zones are available: 000 001 002 003 004 010 015 020 025 030 033 035 040 045 050 055 056 060 065 070 073 075 080 083 085 090 095 100 105 110 113 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 193 195 200 201 203 205 207 210 215 220 225 227 230 235 240 245 250 255 260 265 270 Int'l Dateline Samoa Hawaii Alaskan Pacific Mountain (U.S. and Canada) U.S. Mountain: Arizona Central (U.S. and Canada) Canada Central Mexico Central America Eastern (U.S. and Canada) U.S. Eastern: Indiana (East) S.A. Pacific Atlantic (Canada) S.A. Western Pacific S.A. Newfoundland E. South America S.A. Eastern Greenland Mid-Atlantic Azores Cape Verde Islands GMT (Greenwich Mean Time) GMT Greenwich Central Europe Central European Romance W. Europe W. Central Africa E. Europe Egypt EET (Helsinki, Riga, Tallinn) EET (Athens, Istanbul, Minsk) Israel: Jerusalem S. Africa: Harare, Pretoria Russian Arab E. Africa Iran Arabian Caucasus Pacific (U.S. and Canada) Afghanistan Russia Yekaterinburg W. Asia India Nepal Central Asia Sri Lanka N. Central Asia Myanmar: Rangoon S.E. Asia N. Asia China Singapore Taipei W. Australia N. Asia East Korea: Seoul Tokyo Sakha Yakutsk A.U.S. Central: Darwin Central Australia A.U.S. Eastern E. Australia Tasmania Vladivostok
false
false
Vm
NewSpec
OSCustomizationSpec
false
false
OrgName ProductKey
String String
false false
Server
VIServer[]
false
false
TimeZone
String
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
233/287
7/8/13
Type
OSCustomizationSpecType
Sets the type of the OS customization specification. The valid values are Persistent and NonPersistent. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Specifies the workgroup. This parameter applies only to Windows operating systems.
WhatIf
SwitchParameter
false
false
String
false
false
empty string
Zero or more modified OSCustomizationSpec objects Notes When the ProductKey parameter is not specified, the OS customization is una ttended only if the Windows guest operating system version is Vista or late r. This cmdlet is supported only in 32-bit PowerCLI mode. Examples -------------- Example 1 -------------S e t O S C u s t o m i z a t i o n S p e cS p e cD e s c r i p t i o n' T h i si sat e s tO Sc u s t o m i z a t i o ns p e c i f i c a t i o n . ' Updates the description of the Spec OS customization specification.
Set-PowerCLIConfiguration
Synopsis
This cmdlet modifies the vSphere PowerCLI configuration. Syntax Set-PowerCLIConfiguration [-ProxyPolicy <ProxyPolicy>] [-DefaultVIServerMode <DefaultVIServerMode>] [-InvalidCertificateAction <BadCertificateAction>] [DisplayDeprecationWarnings [<Boolean>]] [-WebOperationTimeoutSeconds <Int32>] [-Scope <ConfigurationScope>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-PowerCLIConfiguration Detailed Description This cmdlet modifies the vSphere PowerCLI configuration. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the server connection mode. The new configuration takes effect immediately after you run the cmdlet. The following values are valid: - Single - Switching to "single" removes all server connections except the last established one. If no target servers are specified, cmdlets run only on the last connected server. - Multiple - All servers connected after switching to "multiple" mode are stored together with the current server connection in an array variable. If no target servers are specified, cmdlets run on the servers in the variable. For more information on default servers, see the description of Connect-VIServer.
false
false
$true
DefaultVIServerMode
DefaultVIServerMode
false
false
DisplayDeprecationWarnings InvalidCertificateAction
Boolean BadCertificateAction
Indicates whether you want to see warnings about deprecated elements. Define the action to take when an attempted connection to a server fails due to a certificate error. The following values are valid: Unset - this is the default value and it acts as a ?Warn? value for Connect-VIServer and as ?Prompt? for ?Connect-CloudServer?. Prompt - if the server certificate is not trusted the cmdlet will prompt you for a course of action before it continues. There are several options: Deny - no connection will be established. Accept for once - accept the connection only for the current PowerCLI session. You will be prompted again if you attempt to connect to the same server from other processes. Accept Permanently - the action will add this certificate as an exception in the ?SSL
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
234/287
7/8/13
ProxyPolicy
ProxyPolicy
Specifies whether vSphere PowerCLI uses a system proxy server to connect to the vCenter Server system. The valid values are NoProxy and UseSystemProxy. Specifies the scope of the setting that you want to modify. The parameter accepts Sesstion, User and All Users values. *Session - the setting is valid for the current vSphere PowerCLI session only and overrides any User and All Users settings. *User - the setting is valid for the current Windows user only, overrides All Users settings, and is applied only if a Session setting cannot be detected. *All Users - the setting is valid for all users and is applied only if Session and User settings cannot be detected. Defines the timeout for web operations. The default value is 300 sec. To specify an infinite operation timeout, pass a negative integer to this parameter. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
true (ByValue)
Scope
ConfigurationScope
false
false
WebOperationTimeoutSeconds
Int32
false
false
300
WhatIf
SwitchParameter
false
false
Return Type One or more modified PowerCLIConfiguration objects Notes Examples -------------- Example 1 -------------S e t P o w e r C L I C o n f i g u r a t i o nP r o x y P o l i c yN o P r o x yS c o p eS e s s i o n Modifies the proxy policy of vSphere PowerCLI for the Session scope. -------------- Example 2 -------------S e t P o w e r C L I C o n f i g u r a t i o nP r o x y P o l i c yN o P r o x yD e f a u l t V I S e r v e r M o d eS i n g l e Changes the default server connection mode and the proxy policy of vSphere PowerCLI for the AllUsers scope. -------------- Example 3 --------------
S e t P o w e r C L I C o n f i g u r a t i o nD e f a u l t V I S e r v e r M o d e' S i n g l e 'S c o p e( [ V M w a r e . V i m A u t o m a t i o n . V i C o r e . T y p e s . V 1 . C o n f i g u r a t i o n S c o p e ] : : U s e rb o r[ V M w a r e . V i m A u t o m a t i o n . V i C Changes the default server connection mode of vSphere PowerCLI for the User and AllUsers scopes.
Set-ResourcePool
Synopsis
This cmdlet modifies the properties of the specified resource pool. Syntax Set-ResourcePool [-ResourcePool] <ResourcePool[]> [-Name <String>] [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64>] [-CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemLimitGB <Decimal>] [-MemReservationMB <Int64>] [-MemReservationGB <Decimal>] [-MemSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ResourcePool Move-ResourcePool New-ResourcePool Remove-ResourcePool
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
235/287
7/8/13
Detailed Description
This cmdlet modifies the properties of the specified resource pool. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ResourcePool Confirm
ResourcePool[] SwitchParameter
Specifies the resource pool you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the CPU reservation can grow beyond the specified value if the parent resource pool has unreserved resources. Specifies a CPU usage limit in MHz. If this parameter is set, utilization will not exceed this limit even if there are available resources. Specifies the guaranteed available CPU in MHz. Specifies the CPU allocation level for this pool. This property is used in relative allocation between resource consumers. This parameter accepts Custom, High, Low, and Normal values. Indicates that the memory reservation can grow beyond the specified value if the parent resource pool has unreserved resources. Specifies a memory usage limit in gigabytes (GB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. This parameter is obsolete. Use MemLimitGB instead. Specifies a memory usage limit in megabytes (MB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. Specifies the guaranteed available memory in gigabytes (GB). This parameter is obsolete. Use MemReservationGB instead. Specifies the guaranteed available memory in megabytes (MB). Specifies the memory allocation level for the resource pool. This property is used in relative allocation between resource consumers. This parameter accepts Custom, High, Low, and Normal values. Specifies a new name for the resource pool. Specifies the CPU allocation level for the resource pool. This property is used in relative allocation between resource consumers. This parameter is ignored unless CpuSharesLevel is set to Custom. Specifies the memory allocation level for the resource pool. This property is used in relative allocation between resource consumers. This parameter is ignored unless MemSharesLevel is set to Custom. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
CpuExpandableReservation
Boolean
false
false
CpuLimitMhz
Int64
false
false
CpuReservationMhz CpuSharesLevel
Int64 SharesLevel
false false
false false
MemExpandableReservation
Boolean
false
false
MemLimitGB
Decimal
false
false
MemLimitMB
Int64
false
false
MemReservationGB MemReservationMB
Decimal Int64
false false
false false
MemSharesLevel
SharesLevel
false
false
Name NumCpuShares
String Int32
false false
false false
NumMemShares
Int32
false
false
Server
VIServer[]
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified ResourcePool objects Notes Examples -------------- Example 1 -------------S e t R e s o u r c e P o o lR e s o u r c e p o o lR e s o u r c e p o o lN u m C p u S h a r e s 5 1 2M e m L i m i t G B4 Sets the CPU allocation level and the limit on memory usage in GB for the resource pool named Resourcepool.
Set-ScsiController
Synopsis
This cmdlet modifies the specified SCSI controllers. Syntax Set-ScsiController [-ScsiController] <ScsiController[]> [-BusSharingMode <ScsiBusSharingMode>] [-Type <ScsiControllerType>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
236/287
7/8/13
Online version Get-ScsiController New-ScsiController Detailed Description
This cmdlet modifies the specified SCSI controllers. Set-ScsiController cannot set both the Type and BusSharing parameters at the same time. First run the cmdlet to set the type and then run it again to configure the bus sharing mode. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the SCSI controller you want to modify. Specifies the bus sharing mode of the SCSI controller. The valid values are NoSharing, Physical, and Virtual. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the type of the SCSI controller. The valid values are ParaVirtual, VirtualBusLogic, VirtualLsiLogic, and VirtualLsiLogicSAS. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Type
ScsiControllerType
false
false
SwitchParameter
false
false
Zero or more modified ScsiController objects Notes Examples -------------- Example 1 -------------G e t S c s i C o n t r o l l e rV MV M|S e t S c s i C o n t r o l l e rB u s S h a r i n g M o d eP h y s i c a l Configures the bus sharing mode of the SCSI controllers of a virtual machine to Physical mode. -------------- Example 2 -------------$ s c s i C o n t r o l l e r=G e t H a r d D i s kV MV M|S e l e c tF i r s t1|G e t S c s i C o n t r o l l e r S e t S c s i C o n t r o l l e rS c s i C o n t r o l l e r$ s c s i C o n t r o l l e rT y p eV i r t u a l L s i L o g i c Changes the type of the SCSI controller of the first hard disk of the VM virtual machine to VirtualLsiLogic.
Set-ScsiLun
Synopsis
This cmdlet modifies the configuration of a SCSI device. Syntax Set-ScsiLun [[-MultipathPolicy] <ScsiLunMultipathPolicy>] [[-PreferredPath] <ScsiLunPath>] [-ScsiLun] <ScsiLun[]> [-CommandsToSwitchPath <Int32>] [BlocksToSwitchPath <Int32>] [-NoCommandsSwitch] [-NoBlocksSwitch] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ScsiLun Get-ScsiLunPath Set-ScsiLunPath Detailed Description This cmdlet modifies the configuration of a SCSI device. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
MultipathPolicy
ScsiLunMultipathPolicy
Specifies the policy that the logical unit must use when choosing a path. The following values are valid: Fixed - uses the preferred path whenever possible. RoundRobin - load balance. MostRecentlyUsed - uses the most recently used path. Unknown - supported only when connected to vCenter Server 4.0/ESX 4.0. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.
false
true (ByValue)
PreferredPath
ScsiLunPath
Specifies the preferred path to access the SCSI logical unit. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifies the SCSI device you want to configure. Specifies the maximum number of I/O blocks to be issued on a given path before the system tries to select a different path. Modifying this setting affects all ScsiLun devices that are connected to the same ESX/ESXi host. The default value is 2048. Setting this parameter to zero (0) disables switching based on blocks.
false
true (ByValue)
ScsiLun BlocksToSwitchPath
ScsiLun[] Int32
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
237/287
7/8/13
CommandsToSwitchPath Int32
Confirm
SwitchParameter
false
false
$true
Return Type Zero or more modified ScsiLun objects Notes Examples -------------- Example 1 -------------$ s c s i l u n=G e t S c s i L u nV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0L u n T y p ed i s k S e t S c s i L u nS c s i L u n$ s c s i l u nC o m m a n d s T o S w i t c h P a t h1 0 0 Configures the SCSI Lun device of the virtual machine host, so that the maximum number of I/O requests to be issued before the system tries to select a different path is 100.
Set-ScsiLunPath
Synopsis
This cmdlet configures a vmhba path to a SCSI device. Syntax Set-ScsiLunPath [[-Active] [<Boolean>]] [-ScsiLunPath] <ScsiLunPath[]> [-Preferred] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-ScsiLunPath Get-ScsiLun Set-ScsiLun Detailed Description This cmdlet configures a vmhba path to a SCSI device. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Indicates that the specified path is active. Specifies a path to the SCSI logical unit you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the specified path is preferred. Only one path can be preferred, so when a path is made preferred, the preference is removed from the previously preferred path. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Preferred
SwitchParameter
false
false
SwitchParameter
false
false
Zero or more modified ScsiLunPath objects Notes Examples -------------- Example 1 -------------$ s c s i l u n=G e t S c s i L u nV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0L u n T y p ed i s k $ s c s i p a t h=G e t S c s i L u n P a t hS c s i L u n$ s c s i l u n S e t S c s i L u n P a t hS c s i L u n P a t h$ s c s i p a t hP r e f e r r e d$ t r u e Sets the specified SCSI Lun path as preferred.
7/8/13
Set-Snapshot
Synopsis
This cmdlet modifies the specified virtual machine snapshot. Syntax Set-Snapshot [-Snapshot] <Snapshot[]> [-Name <String>] [-Description <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Snapshot New-Snapshot Remove-Snapshot Detailed Description This cmdlet modifies the name and the description of the specified virtual machine snapshot. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Snapshot Confirm
Snapshot[] SwitchParameter
Specifies the snapshot whose properties you want to change. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Provides a new description for the snapshot. Specifies a new name for the snapshot. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Zero or more modified Snapshot objects Notes Examples -------------- Example 1 -------------S e t S n a p s h o tS n a p s h o t$ s n a p s h o tN a m eB e f o r e P a t c hD e s c r i p t i o n" B e f o r ew i n d o w su p d a t e " Sets the name and the description of the snapshot in the $snapshot variable. -------------- Example 2 -------------G e t V M|G e t S n a p s h o tN a m e" I n i t i a l S t a t e "|S e t S n a p s h o tD e s c r i p t i o n" T h i ss n a p s h o ti sc r e a t e dr i g h ta f t e rt h eO Si n s t a l l a t i o n . " Updates the description of all snapshots with name InitialState, from all virtual machines.
Set-StatInterval
Synopsis
This cmdlet changes the statistics interval that is specified by the provided parameters. Syntax Set-StatInterval [[-SamplingPeriodSecs] <Int32>] [[-StorageTimeSecs] <Int32>] [-Interval] <StatInterval[]> [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Stat Get-StatType Get-StatInterval New-StatInterval Remove-StatInterval Detailed Description This cmdlet changes the statistics interval that is specified by the provided parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a new sampling period in seconds. Specifies a new time period in seconds, for which the statistics information is kept. Specifies the statistics interval you want to change. Specifies the vCenter Server systems 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 ConnectVIServer. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
239/287
7/8/13
Return Type Zero or more modified StatInterval objects Notes Examples -------------- Example 1 --------------
S e t S t a t I n t e r v a lI n t e r v a l" p a s td a y "S t o r a g e T i m e S e c s7 0 0 0 0 0 Changes the storage time of the "past day" statistics interval.
Set-Template
Synopsis
This cmdlet modifies the specified virtual machine template. Syntax Set-Template [-Template] <Template[]> [-Name <String>] [-ToVM] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Template Get-Template New-Template Remove-Template Detailed Description This cmdlet changes the name and the description of a virtual machine template according to the provided parameters. The cmdlet can convert the template to a virtual machine if the value of the ToVM parameter is $true. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Template Confirm
Template[] SwitchParameter
Specifies the template whose properties you want to change. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new name for the template. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the template is to be converted to a virtual machine. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Name RunAsync
String SwitchParameter
false false
false false
Server
VIServer[]
false
false
SwitchParameter SwitchParameter
false false
false false
Zero or more modified Template objects or zero or more VirtualMachine objects Notes Examples -------------- Example 1 -------------S e t T e m p l a t eT e m p l a t e$ t e m p l a t eN a m eT e m p l a t e 2 Renames the template saved in the $template variable to Template2. -------------- Example 2 -------------$ v m=S e t T e m p l a t eT e m p l a t e$ t e m p l a t eT o V M Converts a template to a virtual machine.
Set-VApp
Synopsis
This cmdlet modifies the specified vApp. Syntax Set-VApp -VApp <VApp[]> [-Name <String>] [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64>] [-CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemLimitGB <Decimal>] [-MemReservationMB <Int64>] [-MemReservationGB <Decimal>] [-MemSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
240/287
7/8/13
Related Commands Online version Export-VApp Get-VApp Import-VApp New-VApp Remove-VApp Start-VApp Stop-VApp Move-VApp Detailed Description This cmdlet modifies the specified vApp. Parameters
NA ME TYPE
DESCRIPTION
REQUIRED?
PIPELINE INPUT
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the CPU reservation can grow beyond the specified value if there are available resources. Specifies a CPU usage limit in MHz. If this parameter is set, utilization will not exceed this limit even if there are available resources. Specifies the guaranteed available CPU in MHz. Specifies the CPU allocation level for this vApp. This property is used in relative allocation between resource consumers. This parameter accepts Custom, High, Low, and Normal values. Indicates that the memory reservation can grow beyond the specified value if there are available resources. Specifies a memory usage limit in gigabytes (GB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. This parameter is obsolete. Use MemLimitGB instead. Specifies a memory usage limit in megabytes (MB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. Specifies the guaranteed available memory in gigabytes (GB). This parameter is obsolete. Use MemReservationGB instead. Specifies the guaranteed available memory in megabytes (MB). Specifies the memory allocation level for the vApp. This property is used in relative allocation between resource consumers. This cmdlet accepts Custom, High, Low, and Normal values. Modifies the name of the vApp. Specifies the CPU allocation level for the vApp. This property is used in relative allocation between resource consumers. This parameter is ignored unless the CpuSharesLevel parameter is set to Custom. Specifies the memory allocation level for the resource pool. This property is used in relative allocation between resource consumers. This parameter is ignored unless the MemSharesLevel parameter is set to Custom. Specifies the vCenter Server systems 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-VIServer. Specifies the vApp that you want to configure. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
$true
CpuExpandableReservation
Boolean
false
false
CpuLimitMhz
Int64
false
false
CpuReservationMhz CpuSharesLevel
Int64 SharesLevel
false false
false false
MemExpandableReservation
Boolean
false
false
MemLimitGB
Decimal
false
false
MemLimitMB
Int64
false
false
MemReservationGB MemReservationMB
Decimal Int64
false false
false false
MemSharesLevel
SharesLevel
false
false
Name NumCpuShares
String Int32
false false
false false
NumMemShares
Int32
false
false
Server
VIServer[]
false
false
VApp WhatIf
VApp[] SwitchParameter
true false
Return Type Zero or more modified VApp objects Notes Examples -------------- Example 1 -------------G e t V A p pN a m eM y T e s t V A p p 1|S e t V A p pC p u S h a r e s L e v e lL o wM e m S h a r e s L e v e lN o r m a l Modifies the CpuSharesLevel and MemSharesLevel properties of the MyTestVApp1 virtual appliance. -------------- Example 2 -------------$ m y v A p p=G e t V A p pL o c a t i o nM y D a t a c e n t e r 1 S e t V A p pV A p p$ m y v A p pC p u E x p a n d a b l e R e s e r v a t i o n : $ t r u eC p u L i m i t M h z4 0 0 0M e m E x p a n d a b l e R e s e r v a t i o n : $ t r u eM e m L i m i t G B2 Modifies the properties of the vApps available on the MyDatacenter1 datacenter.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
241/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Set-VDPortgroup
Synopsis
This cmdlet modifies the configuration of distributed port groups. Syntax Set-VDPortgroup [-Name <String>] [-Notes <String>] [-NumPorts <Int32>] [-VlanId <Int32>] [-VlanTrunkRange <VlanRangeList>] [-PortBinding <DistributedPortGroupPortBinding>] [-DisableVlan] [-VDPortgroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VDPortgroup -RollbackConfiguration [-VDPortgroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VDPortgroup -BackupPath <String> [-VDPortgroup] <VDPortgroup[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VDPortgroup New-VDPortgroup Remove-VDPortgroup Export-VDPortgroup Detailed Description This cmdlet modifies the configuration of distributed port groups. You can set the properties of the distributed port group manually, provide a backup profile to import the port group configuration, or rollback to the last valid configuration. Note: You can import or rollback a configuration only on vSphere 5.1 and later. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VDPortgroup BackupPath
VDPortgroup[] String
Specifies the distributed port group that you want to configure. Specifies the full file path to the .zip file containing the backup configuration that you want to import. You can import only .zip files created with the ExportVDPortgroup cmdlet. Note: This parameter is only supported on vSphere 5.1 and later.
true true
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Sets the VLAN type of the distributed port group to None. Specifies a new name for the distributed port group that you want to configure. Specifies a new description for the distributed port group that you want to configure. Specifies a new number of ports on the distributed port group that you want to configure. Specifies a new port binding setting for the distributed port group that you want to configure. This parameter accepts Static, Dynamic, and Ephemeral values. Note: Dynamic port binding is deprecated. For better performance, static port binding is recommended.
false
false
NumPorts
Int32
false
false
PortBinding
DistributedPortGroupPortBinding
false
false
RollbackConfiguration
SwitchParameter
Indicates that you want to rollback the distributed port group to its last valid configuration. Note: Rollback is available only on vSphere 5.1 and later.
true
false
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies a new VLAN ID for the distributed port group that you want to configure. Valid values are integers in the range of 1 to 4094. Specifies a new VLAN trunk range for the distributed port group that you want to configure. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9". Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Server
VIServer[]
false
false
VlanId
Int32
false
false
VlanTrunkRange
VlanRangeList
false
false
WhatIf
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
242/287
7/8/13
Return Type The modified VDPortgroup objects Notes Examples -------------- Example 1 --------------
G e t V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "|S e t V D P o r t g r o u pN a m e" M y N e w V D P o r t G r o u p N a m e "N u m P o r t s5V l a n I d4 Changes the name, number of ports and the VLAN ID of all distributed port groups named "MyVDPortGroup". -------------- Example 2 -------------G e t V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "|S e t V D P o r t g r o u pV l a n T r u n k R a n g e" 1 5 ,8 1 0 " Changes the VLAN trunk range of all distributed port groups named "MyVDPortGroup". -------------- Example 3 -------------$ m y V D P o r t g r o u p=G e t V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "V D S w i t c h" M y V D S w i t c h " S e t V D P o r t g r o u pV D P o r t g r o u p$ m y V D P o r t g r o u pD i s a b l e V l a n Sets the VLAN type of the specified distributed port group to None. -------------- Example 4 -------------G e t V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "|S e t V D P o r t g r o u pR o l l b a c k C o n f i g u r a t i o n Rollbacks the configuration of all distributed port groups named "MyVDPortGroup". -------------- Example 5 -------------G e t V D P o r t g r o u pN a m e" M y V D P o r t G r o u p "|S e t V D P o r t g r o u pB a c k u p P a t h' c : \ b a c k u p . z i p ' Reconfigures all distributed port groups named "MyVDPortGroup" by importing the configuration from the specified backup profile.
Set-VDSwitch
Synopsis
This cmdlet modifies the configuration of vSphere distributed switches. Syntax Set-VDSwitch [-Name <String>] [-ContactDetails <String>] [-ContactName <String>] [-LinkDiscoveryProtocol <LinkDiscoveryProtocol>] [-LinkDiscoveryProtocolOperation <LinkDiscoveryOperation>] [-MaxPorts <Int32>] [-Mtu <Int32>] [-Notes <String>] [-NumUplinkPorts <Int32>] [-Version <String>] [-VDSwitch] <VDSwitch[]> [RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VDSwitch -BackupPath <String> [-WithoutPortGroups] [-VDSwitch] <VDSwitch[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VDSwitch -RollBackConfiguration [-VDSwitch] <VDSwitch[]> [-RunAsync] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-VDSwitch Export-VDSwitch Get-VDSwitch Remove-VDSwitch Detailed Description This cmdlet modifies the configuration of vSphere distributed switches. You can set the properties of the distributed switch manually, rollback the configuration to its previous state, or import it from a backup profile. Note: Rollback and importing are available only on vSphere 5.1 and later. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VDSwitch BackupPath
VDSwitch[] String
Specifies the vSphere distributed switch that you want to configure. Specifies the full file path to the .zip file containing the backup configuration that you want to import. You can import only .zip files created with the ExportVDSwitch cmdlet. Note: This parameter is supported only on vSphere 5.1 and later.
true true
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies new contact details of the vSphere distributed switch administrator. Specifies a new name for the vSphere distributed switch administrator. Specifies the link discovery protocol for the distributed switch that you want to configure. This parameter accepts CDP and LLDP values.
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
243/287
7/8/13
LinkDiscoveryProtocolOperation
MaxPorts
Int32
false
false
Mtu
Int32
false
false
Name
String
false
false
Notes
String
false
false
NumUplinkPorts
Int32
false
false
RollBackConfiguration
SwitchParameter
true
false
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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 ConnectVIServer. Specifies a new version for the vSphere distributed switch that you want to configure. This parameter accepts 4.0, 4.1.0, 5.0.0, and 5.1.0 values. You cannot specify a version that is incompatible with the version of the vCenter Server system you are connected to. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Indicates that the specified backup configuration is imported without its port groups. Note: This parameter is supported only on vSphere 5.1 and later.
false
false
Server
VIServer[]
false
false
Version
String
false
false
WhatIf
SwitchParameter
false
false
WithoutPortGroups
SwitchParameter
false
false
Return Type The modified VDSwitch objects Notes Examples -------------- Example 1 -------------G e t V D S w i t c hN a m e" M y V D S w i t c h "|S e t V D S w i t c hM a x P o r t s1 0 0 0N u m U p l i n k P o r t s8M t u2 0 0 0 Modifies the maximum number of ports, the number of uplink ports, and the maximum MTU size of the specified vSphere distributed switch. -------------- Example 2 -------------$ m y V D S w i t c h e s=G e t V D S w i t c hN a m eM y V D S w i t c h * S e t V D S w i t c hV D S w i t c h$ m y V D S w i t c h e sV e r s i o n' 5 . 1 . 0 ' Changes the version of all vSphere distributed switches whose names start with "MyVDSwitch". -------------- Example 3 -------------$ m y V D S w i t c h=G e t V D S w i t c hN a m e" M y V D S w i t c h " S e t V D S w i t c hV D S w i t c h$ m y V D S w i t c hL i n k D i s c o v e r y P r o t o c o lL L D PL i n k D i s c o v e r y P r o t o c o l O p e r a t i o nL i s t e n Enables link discovery protocol on the specified vSphere distributed switch, sets it to LLDP and changes the link discovery protocol operation to listen. -------------- Example 4 -------------G e t V D S w i t c hN a m e" M y V D S w i t c h "|S e t V D S w i t c hB a c k u p P a t h' c : \ M y V D S w i t c h B a c k u p s \ M y V D S w i t c h _ 1 2 _ 1 2 _ 2 0 1 2 . z i p 'W i t h o u t P o r t G r o u p s Reconfigures the specified vSphere distributed switch by importing the specified backup profile. The original port groups are not recreated. -------------- Example 5 -------------G e t V D S w i t c hN a m e" M y V D S w i t c h "|S e t V D S w i t c hR o l l b a c k C o n f i g u r a t i o n
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
244/287
7/8/13
Rollbacks the configuration of the specified vSphere distributed switch to its previous state.
Set-VIPermission
Synopsis
This cmdlet modifies the properties of the specified permissions. Syntax Set-VIPermission [-Permission] <Permission[]> [-Role <Role>] [-Propagate [<Boolean>]] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIPermission New-VIPermission Remove-VIPermission Get-VIPrivilege Get-VIRole New-VIRole Remove-VIRole Set-VIRole Detailed Description This cmdlet modifies the properties of the specified permissions. The cmdlet can change the role and define whether the permission propagates down the hierarchy to child inventory objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Permission Confirm
Permission[] SwitchParameter
Specifies the permissions you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to propagate the new permissions to the child inventory objects. Specifies a new role for the permissions. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
$true
SwitchParameter
false
false
Zero or more modified Permission objects Notes Examples -------------- Example 1 -------------S e t V I P e r m i s s i o nP e r m i s s i o n$ p e r m i s s i o nR o l eR o l eP r o p a g a t e : $ f a l s e Changes the Propagate property of the $permission permission to $false.
Set-VIRole
Synopsis
This cmdlet modifies the privileges of the provided roles. Syntax Set-VIRole [-Role] <Role[]> [-Name <String>] [-AddPrivilege <Privilege[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VIRole [-Role] <Role[]> [-Name <String>] [-RemovePrivilege <Privilege[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VIRole New-VIRole Remove-VIRole Get-VIPrivilege Get-VIPermission New-VIPermission Remove-VIPermission Set-VIPermission Detailed Description This cmdlet modifies the privileges of the provided roles. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Role AddPrivilege
Role[] Privilege[]
Specifies the roles you want to modify. Specifies privileges and privilege groups you want to add to the
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
245/287
7/8/13
provided roles. Confirm SwitchParameter
SwitchParameter
false
false
Zero or more modified Role objects Notes Examples -------------- Example 1 -------------S e t V I R o l eR o l eR o l eA d d P r i v i l e g e( G e t V I P r i v i l e g eN a m e' C r e a t eD a t a c e n t e r ' ) Adds the "Create Datacenter" privilege to the Role role.
Set-VirtualPortGroup
Synopsis
This cmdlet modifies the properties of the specified virtual port group. Syntax Set-VirtualPortGroup [-Name <String>] [-VLanId <Int32>] [-VirtualPortGroup] <VirtualPortGroup[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VirtualPortGroup New-VirtualPortGroup Remove-VirtualPortGroup Detailed Description This cmdlet modifies the properties of the specified virtual port group. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VirtualPortGroup Confirm
VirtualPortGroup[] SwitchParameter
Specifies the virtual port group whose properties you want to change. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new name for the virtual port group. Specifies the VLAN ID for ports using this port group. The following values are valid: 0 - specifies that you do not want to associate the port group with a VLAN. 1 to 4094 - specifies a VLAN ID for the port group. 4095 - specifies that the port group should use trunk mode, which allows the guest operating system to manage its own VLAN tags.
true false
Name VLanId
String Int32
false false
false false
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Zero or more modified VirtualPortGroup objects Notes Examples -------------- Example 1 -------------$ v s w i t c h= N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 2 . 3 6N a m eV S w i t c h $ v p o r t g r o u p 1= N e w V i r t u a l P o r t G r o u pV i r t u a l S w i t c h$ v s w i t c hN a m eV P o r t G r o u p 1 $ v p o r t g r o u p 2=S e t V i r t u a l P o r t G r o u pV i r t u a l P o r t G r o u p$ v p o r t g r o u p 1V L a n I d1 Creates a new virtual switch named VSwitch on the virtual machine host with IP address 10.23.112.36. Creates a new virtual port group for the new switch named VPortGroup1. Sets the VLAN ID for the ports using the Ports02_19 group.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
246/287
7/8/13
Set-VirtualSwitch
Synopsis
This cmdlet modifies the properties of the specified virtual switch. Syntax Set-VirtualSwitch [-VirtualSwitch] <VirtualSwitch[]> [[-NumPorts] <Int32>] [[-Nic] <String[]>] [[-Mtu] <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VirtualSwitch New-VirtualSwitch Remove-VirtualSwitch Detailed Description This cmdlet modifies the properties of the specified virtual switch. The server rounds the value of the NumPorts parameter up to the closest exact power of two, greater than the provided number. When updating NumPorts, the user needs to restart the ESX/ESXi host for the change to take effect. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VirtualSwitch NumPorts
VirtualSwitch[] Int32
Specifies the virtual switch you want to configure. Specifies the VirtualSwitch port number. The value is rounded to the closest exact power of two, greater than the provided number (for example, if the user specifies 67, this number is rounded to 128). The value range is between 1 and 1024. The ESX host to which the virtual switch belongs, must be restarted for the change to take effect. Note that the port number displayed in the vSphere Client might differ from the value that you specified for the NumPorts parameter. Specifies new network interface cards for the virtual switch. The old NICs are replaced by the specified ones. Specifies the maximum transmission unit (MTU) associated with the specified virtual switch (in bytes). The MTU value must be greater than 0. This parameter is valid only on VPX 2.5. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Nic Mtu
String[] Int32
false false
false false
Confirm
SwitchParameter
false
false
$true
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more modified VirtualSwitch objects Notes The MTU field is only available on VPX 2.5 and ESX 3.5. For older VPX vers ions, this field is expected to be $null. Examples -------------- Example 1 -------------$ v s w i t c h=N e w V i r t u a l S w i t c hH o s t1 0 . 2 3 . 1 1 5 . 6 7N a m eV S w i t c h S e t V i r t u a l S w i t c hV i r t u a l S w i t c h$ v s w i t c hM T U5 0 0 Creates a new virtual switch named VSwitch on the virtual machine host on IP address 10.23.115.67. Then sets the virtual switch MTU to 500. -------------- Example 2 -------------$ v s w i t c h=N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 5 . 6 7 $ n e t w o r k A d a p t e r s=G e t V M H o s t N e t w o r k A d a p t e rV M H o s t1 0 . 2 3 . 1 1 5 . 6 7P h y s i c a l $ p h N i c=$ n e t w o r k A d a p t e r s [ 0 ] $ v S w i t c h|S e t V i r t u a l S w i t c hN i c$ p h N i c Creates a new virtual switch named VSwitch on the virtual machine host on IP address 10.23.115.67. Then assigns to it a network adapter. -------------- Example 3 -------------G e t V M H o s t* . 1 2 8|G e t V i r t u a l S w i t c h|S e l e c t O b j e c tF i r s t1|S e t V i r t u a l S w i t c hN i cv m n i c 5 Add a physical network adapter named 'vmnic5' to the first switch of the host. Note that the 'vmnic5' adapter must not be assigned to other virtual switches.
Set-VM
Synopsis
This cmdlet modifies the configuration of the virtual machine.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
247/287
7/8/13
Syntax
Set-VM [-VM] <VirtualMachine[]> [-Name <String>] [-Version <VMVersion>] [-MemoryMB <Int64>] [-MemoryGB <Decimal>] [-NumCpu <Int32>] [-GuestId <String>] [AlternateGuestName <String>] [-OSCustomizationSpec <OSCustomizationSpec>] [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-DrsAutomationLevel <DrsAutomationLevel>] [-Server <VIServer[]>] [-RunAsync] [-VMSwapFilePolicy <VMSwapfilePolicy>] [-Notes <String>] [WhatIf] [-Confirm] [<CommonParameters>] Set-VM [-VM] <VirtualMachine[]> [-Name <String>] [-Snapshot <Snapshot>] [-OSCustomizationSpec <OSCustomizationSpec>] [-HARestartPriority <HARestartPriority>] [-HAIsolationResponse <HAIsolationResponse>] [-DrsAutomationLevel <DrsAutomationLevel>] [-Server <VIServer[]>] [-RunAsync] [-VMSwapFilePolicy <VMSwapfilePolicy>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VM [-VM] <VirtualMachine[]> [-Name <String>] [-Server <VIServer[]>] [-RunAsync] [-ToTemplate] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Move-VM New-VM Remove-VM Start-VM Stop-VM Suspend-VM Detailed Description This cmdlet modifies the configuration of the virtual machine. If the OSCustomizationSpec parameter is used, the cmdlet customizes the virtual machine according to the specification. In addition, the cmdlet allows you to revert a virtual machine to a snapshot and convert a virtual machine to a template. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM AlternateGuestName
VirtualMachine[] String
Specifies the virtual machine you want to configure. Specifies the full name of the guest OS for the virtual machine if the value of the GuestID parameter is set to otherGuest or otherGuest64. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a DRS (Distributed Resource Scheduler) automation level. The valid values are FullyAutomated, Manual, PartiallyAutomated, AsSpecifiedByCluster, and Disabled. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifying this parameter is only supported when the virtual machine is inside a cluster. Otherwise, an error is generated. Specifies the guest operating system of the virtual machine. The valid values for specific ESX versions are listed in the description of the VirtualMachineGuestOsIdentifier enumeration type in the vSphere API Reference available at http://www.vmware.com/support/developer/vc-sdk/. Depending on the hardware configuration of the host, some of the guest operating systems might be inapplicable. Indicates whether the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. The valid values are AsSpecifiedByCluster, PowerOff, and DoNothing. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifying this parameter is only supported when the virtual machine is inside a cluster. Otherwise, an error is generated. Specifies the virtual machine HA restart priority. The valid values are Disabled, Low, Medium, High, and ClusterRestartPriority. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX hosts. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release. Specifying this parameter is only supported when the virtual machine is inside a cluster. Otherwise, an error is generated. Specifies the memory size in gigabytes (GB). This parameter is obsolete. Use MemoryGB instead. Specifies the memory size in megabytes (MB). Specifies a new name for the virtual machine. Provide a description for the virtual machine. The alias of this parameter is Description. Specifies the number of virtual CPUs. Specifies a customization specification you want to apply to the virtual machine. This works only in 32-bit mode. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies a snapshot whose state you want to apply to the virtual machine. Indicates that you want to convert the virtual machine to a template. Specifies the version to which you want to upgrade
true false
Confirm
SwitchParameter
false
false
$true
DrsAutomationLevel
DrsAutomationLevel
false
false
GuestId
String
false
false
HAIsolationResponse
HAIsolationResponse
false
false
HARestartPriority
HARestartPriority
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
248/287
7/8/13
VMSwapFilePolicy
VMSwapfilePolicy
Specifies the swapfile placement policy. The following values are valid: InHostDataStore - Stores the swapfile in the datastore specified by the VMSwapfileDatastoreID property of the virtual machine host. If the VMSwapfileDatastoreID property is not set or indicates a datastore with insufficient free space, the swapfile is stored in the same directory as the virtual machine. This setting might degrade the VMotion performance. WithVM - Stores the swapfile in the same directory as the virtual machine.
false
false
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type Zero or more modified VirtualMachine objects or the newly created Template objects Notes Applying customization specs works only in 32-bit mode. Examples -------------- Example 1 -------------$ t e m p l a t e=G e t V MV M|S e t V MT o T e m p l a t eN a m eV M T e m p l a t e Converts the VM virtual machine to a template and stores the template in the $template variable. -------------- Example 2 -------------G e t V ML o c a t i o nR e s o u r c e P o o l 0 1|S e t V MM e m o r y G B2N u m C P U2 Upgrades the memory and CPU count of the virtual machines in ResourcePool01. -------------- Example 3 -------------S e t V MV MV MV e r s i o nv 7 Upgrades the virtual hardware version of the VM machine. -------------- Example 4 -------------$ s n a p s h o t=G e t S n a p s h o tV M$ v mN a m e" I n i t i a ls t a t e " S e t V MV M$ v mS n a p s h o t$ s n a p s h o t Revert the VM virtual machine to the "Initial state" snapshot. -------------- Example 5 -------------$ s p e c=G e t O S C u s t o m i z a t i o n S p e cN a m eF i n a n c e D e p a r t m e n t S p e c ; S e t V MV M$ v mO S C u s t o m i z a t i o n S p e c$ s p e c Apply a customization specification on the specified virtual machines. -------------- Example 6 -------------S e t V M$ v mN a m e" W e bS e r v e r "G u e s t I Dw i n N e t S t a n d a r d G u e s tD e s c r i p t i o n" C o m p a n y ' sw e bs e r v e r " Changes the name, description, and guest ID of the specified virtual machine.
Set-VMGuestNetworkInterface
Synopsis
This cmdlet configures the network settings of a virtual machine using VMware Tools. Syntax Set-VMGuestNetworkInterface -VmGuestNetworkInterface <VMGuestNetworkInterface[]> [-WinsPolicy <DhcpPolicy>] [-Wins <String[]>] [-DnsPolicy <DhcpPolicy>] [-Dns <String[]>] [-IPPolicy <DhcpPolicy>] [[-Gateway] <Object>] [[-Netmask] <String>] [[-Ip] <IPAddress>] [-ToolsWaitSecs <Int32>] [-GuestPassword <SecureString>] [GuestUser <String>] [-GuestCredential <PSCredential>] [-HostPassword <SecureString>] [-HostUser <String>] [-HostCredential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMGuestNetworkInterface Detailed Description This cmdlet configures the network settings of a virtual machine using VMware Tools. The cmdlet allows IP and routing configuration. You can modify Wins settings only for Windows virtual machines. The cmdlet sends a remote script which executes inside the virtual machine in the context of the specified user account. This cmdlet supports only Windows XP 32 SP3, Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems. To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
249/287
7/8/13
*You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege. To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Ip
IPAddress
Specifies an IP address. Use this parameter only if The IpPolicy parameter is set to Static. Specifies a network mask. Specifies a gateway. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies DNS addresses. Use this parameter only if The DnsPolicy parameter is set to Static. Specifies the DNS policy. The valid values are Static and Dhcp. Specifies a PSCredential object that contains credentials for authenticating with the guest OS. Do not use this parameter if the GuestUser and GuestPassword parameters are used. Specifies the password you want to use for authenticating with the guest OS. Specifies the user name you want to use for authenticating with the guest OS. Specifies a PSCredential object that contains credentials for authenticating with the host. Do not use this parameter if the HostUser and HostPassword parameters are used. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the user name you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. Specifies the IP policy. The valid values are Static and Dhcp. Specifies the time in seconds to wait for a response from VMware Tools. If a nonpositive value is provided, the system waits indefinitely. Specifies the guest network interface you want to configure. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. Specifies WINS servers. Use this parameter only if the WinsPolicy parameter is set to Static. Specifies the Wins policy. The valid values are Static and Dhcp.
false
false
Dns
String[]
false
false
DnsPolicy GuestCredential
DhcpPolicy PSCredential
false false
false false
HostPassword
SecureString
false
false
HostUser
String
false
false
IPPolicy ToolsWaitSecs
DhcpPolicy Int32
false false
false false
VmGuestNetworkInterface WhatIf
VMGuestNetworkInterface[] SwitchParameter
true false
Wins
String[]
false
false
DhcpPolicy
false
false
Zero or more modified VMGuestNetworkInterface objects Notes This cmdlet is experimental and might be changed or removed in a future rel ease. Examples -------------- Example 1 --------------
S e t V M G u e s t N e t w o r k I n t e r f a c eV M G u e s t N e t w o r k I n t e r f a c e$ v m G u e s t N e t w o r k I n t e r f a c eG u e s t U s e rU s e rG u e s t P a s s w o r dP a s s 0 2N e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 2 5 5G a t e w a y1 0 . 2 3 . 1 1 Changes the net mask and the gateway of the specified guest network interface.
Set-VMHost
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 250/287
7/8/13
Synopsis
This cmdlet modifies the configuration of the host. Syntax Set-VMHost [-VMHost] <VMHost[]> [[-State] <VMHostState>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-VMSwapfileDatastore <Datastore>] [-Profile <VMHostProfile>] [Evacuate] [-TimeZone <VMHostTimeZone>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VMHost Get-VMHost Move-VMHost Remove-VMHost Restart-VMHost Start-VMHost Stop-VMHost Suspend-VMHost Detailed Description This cmdlet modifies the configuration of the host. The State parameter is set to Connected. - If the host is currently connected and is not in a maintenance mode, it does nothing. - If the host is in a maintenance mode, it exits the maintenance mode. - If the host is not connected or is not responding, it tries to reconnect. The State parameter is set to Disconnected. - If the host is currently connected, it attempts to disconnect. - If the host is not connected or not responding, it does nothing. The State parameter is set to Maintenance. - If the host is currently connected and not in a maintenance mode, it enters a maintenance mode. - If the host is currently connected and in a maintenance mode, it does nothing. - If the host is not connected or not responding, it attempts to reconnect and enter maintenance mode. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
State
VMHostState
Specifies the state of the host. The valid values are Connected, Disconnected, and Maintenance. If there are powered on virtual machines on the host, you can set the host into a maintenance mode, only if it is part of a DRSenabled cluster. Before entering maintenance mode, if the host is fully automated, the cmdlet first relocates all powered on virtual machines. If the host is not automated or partially automated, you must first generate a DRS recommendation and wait until all powered on virtual machines are relocated or powered off. In this case, you must specify the RunAsync parameter, otherwise an error is thrown. Specifies the host you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. If the value is $true, vCenter automatically reregisters the virtual machines that are compatible for reregistration. If they are not compatible, they remain on the host. If there are powered-on virtual machines that cannot be reregistered the operation waits until they are powered off manually. The Evacuate parameter is valid only when connected to a vCenter Server system and the State parameter is set to Maintenance. Also, the virtual machine host must be in a DRS-enabled cluster. Specifies a host profile you want to associate with the host. If the value of this parameter is $null, the current profile association is removed. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies the time zone for the host by using its name or by providing the corresponding time zone object. Time zone names support wildcards. If the wildcards match more than one time zones, an error is reported. Time zone objects can only be applied to the hosts they originate from. Specifies a datastore that is visible to the host and can be used for storing swapfiles for the virtual machines that run on this host. Using a host-specific swap location might degrade the VMotion performance. Specifies the swapfile placement policy. The following values are valid: InHostDataStore - Stores the swapfile in the datastore specified by the VMSwapfileDatastoreID property of the virtual machine host. If the VMSwapfileDatastoreID property is not set or indicates a datastore with insufficient free space, the swapfile is stored in the same directory as the virtual machine. This setting might degrade the VMotion performance. WithVM - Stores the swapfile in the same directory as the virtual machine.
false
false
VMHost Confirm
VMHost[] SwitchParameter
true false
Evacuate
SwitchParameter
false
false
Profile
VMHostProfile
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
TimeZone
VMHostTimeZone
false
false
VMSwapfileDatastore
Datastore
false
false
VMSwapfilePolicy
VMSwapfilePolicy
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
251/287
7/8/13
WhatIf SwitchParameter
Return Type Zero or more modified VMHost objects Notes The TimeZone parameter is supported only on ESX 3.5 /VirtualCenter 2.5, ESX 4.0/vCenter Server 4.0, and later. The Evacuate parameter is valid only when connected to a vCenter Server hos t and the host is a part of a DRS-enabled cluster. Examples -------------- Example 1 -------------S e t V M H o s tV M H o s tH o s tS t a t e" D i s c o n n e c t e d " Resets the state of the Host virtual host to disconnected. -------------- Example 2 -------------$ c l u s t e r=G e t C l u s t e rV M H o s tH o s t $ t a s k=S e t V M H o s tV M H o s tH o s tS t a t e" M a i n t e n a n c e "R u n A s y n c G e t D r s R e c o m m e n d a t i o nC l u s t e r$ c l u s t e r|w h e r e{ $ _ . R e a s o ne q" H o s ti se n t e r i n gm a i n t e n a n c em o d e " }|A p p l y D r s R e c o m m e n d a t i o n $ v m h o s t=W a i t T a s k$ t a s k Activate a maintenance mode for a not automated host that is part of a DRS-enabled cluster and has powered on virtual machines on it.
Set-VMHostAccount
Synopsis
This cmdlet configures a host account. Syntax Set-VMHostAccount [-GroupAccount] <HostGroupAccount[]> [-AssignUsers <String[]>] [-UnassignUsers <String[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostAccount [-UserAccount] <HostUserAccount[]> [-Password <String>] [-Description <String>] [-AssignGroups <String[]>] [-UnassignGroups <String[]>] [GrantShellAccess [<Boolean>]] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-VMHostAccount Get-VIAccount Remove-VMHostAccount Detailed Description This cmdlet configures a host account. When configuring a host user account, you can include or exclude the user from the specified groups. When configuring a host group account, you can include or exclude the specified users from this group. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
GroupAccount
HostGroupAccount[]
Specifies the host group account you want to configure. Starting with ESXi 5.1, you cannot configure group host accounts. Specifies the host user account you want to configure. If a user host account is to be configured, specifies the group to which you want to add the account. Starting with ESXi 5.1, you cannot configure group host accounts. If a group host account is configured, specify the users you want to add to the account. Starting with ESXi 5.1, you cannot configure group host accounts. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Provides a description of the specified account. The maximum length of the text is 255 symbols. Indicates that the account is allowed to access the ESX shell. Specifies a new password for the account. Specifies the vCenter Server systems 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 ConnectVIServer. If a user host account is to be configured, specifies a group from which you want to remove the account. Starting with ESXi 5.1, you cannot configure group host accounts. If a group host account is to be configured, specifies the users you want to remove from the account. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
true (ByValue)
UserAccount AssignGroups
HostUserAccount[] String[]
true false
AssignUsers
String[]
false
false
Confirm
SwitchParameter
false
false
$true
UnassignGroups
String[]
false
false
String[] SwitchParameter
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
252/287
7/8/13
Notes
If both of the AssignUsers (AssignGroup) and UnassignUsers (UnassignGroup) parameters are specified, the Assign* parameter is applied first. If the sa me user and group are specified for Assign* and Unassign*, a terminating er ror is thrown. Starting with ESXi 5.1, you cannot configure group host accounts. Examples -------------- Example 1 -------------$ m y U s e r A c c o u n t=N e w V M H o s t A c c o u n tI DM y U s e r 1P a s s w o r dM y P a s s w o r d 1U s e r A c c o u n t $ m y G r o u p A c c o u n t=N e w V M H o s t A c c o u n tI DM y G r o u p 1G r o u p A c c o u n tA s s i g n U s e r s$ m y U s e r A c c o u n t S e t V M H o s t A c c o u n tU s e r A c c o u n t$ m y U s e r A c c o u n tU n a s s i g n G r o u p s$ m y G r o u p A c c o u n t Creates a user account with an ID MyUser1. Then creates a group account with an ID MyGroup1 and assigns the user account MyUser1 to the group account MyGroup1. Finally, excludes the MyUser1 account from the MyGroup1 account. Starting with ESXi 5.1, you cannot configure group host accounts.
Set-VMHostAdvancedConfiguration
Synopsis
This cmdlet modifies the advanced configuration settings of a host. Syntax Set-VMHostAdvancedConfiguration [[-Name] <String>] [[-Value] <Object>] [-VMHost] <VMHost[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostAdvancedConfiguration [[-NameValue] <Hashtable>] [-VMHost] <VMHost[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostAdvancedConfiguration Detailed Description This cmdlet is deprecated. Use New-AdvancedSetting, Set-AdvancedSetting, or Remove-AdvancedSetting instead. This cmdlet modifies the advanced configuration settings of a host. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the name of the host configuration setting you want to change. Provides a hash table that maps values to settings. Specifies a new value of the host configuration setting that you want to modify. Specifies the host whose advanced configuration settings you want to change. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Server
VIServer[]
false
false
SwitchParameter
false
false
The modified System.Collections.Hashtable object Notes Examples -------------- Example 1 -------------G e t V M H o s t1 0 . 2 3 . 1 2 3 . 1 4 4|S e t V m H o s t A d v a n c e d C o n f i g u r a t i o nN a m eM i g r a t e . N e t T i m e o u tV a l u e([ s y s t e m . i n t 3 2 ]1 0) Change the migration timeout for the virtual machine host with an IP address 10.23.123.144. -------------- Example 2 -------------$ m i g r a t i o n S e t t i n g s=G e t V M H o s t1 0 . 2 3 . 1 2 3 . 1 4 4 |G e t V m H o s t A d v a n c e d C o n f i g u r a t i o nN a m eM i g r a t e . * S e t V m H o s t A d v a n c e d C o n f i g u r a t i o nV M H o s t1 0 . 2 3 . 1 2 3 . 1 2 2 N a m e V a l u e$ m i g r a t i o n S e t t i n g s Gets the advanced settings concerning migration from the host with an IP address 10.23.123.144 and applies them to the virtual machine host with an IP address 10.23.123.122. -------------- Example 3 -------------S e t V M H o s t A d v a n c e d C o n f i g u r a t i o nV M H o s t1 0 . 2 3 . 1 1 2 . 1 2 0N a m eM i g r a t e . E n a b l e dV a l u e1 Enable VMotion on a host using Set-VMHostAdvancedConfiguration.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
253/287
7/8/13
Set-VMHostAuthentication
Synopsis
This cmdlet modifies the host authentication information. Syntax Set-VMHostAuthentication [-Domain] <String> [[-Username] <String>] [[-Password] <SecureString>] [-Credential <PSCredential>] -JoinDomain -VMHostAuthentication <VMHostAuthentication[]> [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostAuthentication [-Force] -LeaveDomain -VMHostAuthentication <VMHostAuthentication[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostAuthentication Detailed Description This cmdlet modifies the host authentication information. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a domain you want to join. Specifies a user name for authentication. Specifies a password for authentication. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a credential object for authentication. If the value is $true, any existing permissions on the managed objects for Active Directory users are deleted and the cmdlet completes. If the value is $false, the cmdlet cannot run if there are any existing permissions on managed objects for Active Directory users. Indicates whether you want to join the specified domain. Indicates whether you want to leave the currently joined domain. Specifies the VMHostAuthentication object you want to modify. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Credential Force
PSCredential SwitchParameter
false false
false false
Return Type Zero or more modified VMHostAuthentication objects Notes Examples -------------- Example 1 -------------$ v m h o s t|G e t V M H o s t A u t h e n t i c a t i o n|S e t V M H o s t A u t h e n t i c a t i o nJ o i n D o m a i nD o m a i n" D o m a i n N a m e . c o m "U s e r" U s e r n a m e 1 "P a s s w o r d" P a s s w o r d 1 " Include an ESX host in a domain. -------------- Example 2 -------------$ v m h o s t|G e t V M H o s t A u t h e n t i c a t i o n|S e t V M H o s t A u t h e n t i c a t i o nL e a v e D o m a i n Exclude an ESX host from a domain. -------------- Example 3 -------------$ v m h o s t|G e t V M H o s t A u t h e n t i c a t i o n|S e t V M H o s t A u t h e n t i c a t i o nL e a v e D o m a i nF o r c e Exclude an ESX host from a domain. If AD account permissions are defined on the host, they will be removed.
Set-VMHostDiagnosticPartition
Synopsis
This cmdlet activates or deactivates the diagnostic partitions of hosts. Syntax Set-VMHostDiagnosticPartition [-Active] [<Boolean>] [-VMHostDiagnosticPartition] <VMHostDiagnosticPartition[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostDiagnosticPartition Detailed Description This cmdlet activates or deactivates the diagnostic partitions of hosts. Parameters
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
254/287
7/8/13
NA ME TYPE
Active
Boolean
If the value of this parameter is $true, the partition state is changed to active. If the value is $false, the partition state is set to inactive. Specifies the host diagnostic partition you want to set. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
VMHostDiagnosticPartition Confirm
VMHostDiagnosticPartition[] SwitchParameter
true false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified VMHostDiagnosticPartition objects Notes Examples -------------- Example 1 -------------$ d i a g P a r t i t i o n=G e t V M H o s t D i a g n o s t i c P a r t i t i o nV M H o s t$ v m h o s t $ d i a g P a r t i t i o n|S e t V M H o s t D i a g n o s t i c P a r t i t i o nA c t i v e$ f a l s eC o n f i r m Deactivates the active diagnostic partition of the specified host.
Set-VMHostFirewallDefaultPolicy
Synopsis
This cmdlet sets the default policy for the specified host firewall. Syntax Set-VMHostFirewallDefaultPolicy [[-AllowIncoming] [<Boolean>]] [[-AllowOutgoing] [<Boolean>]] [-Policy] <VMHostFirewallDefaultPolicy[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostFirewallDefaultPolicy Detailed Description This cmdlet sets the default policy for the specified host firewall. This policy specifies whether outgoing or incoming connections are allowed. At least one of the AllowIncoming and AllowOutgoing parameters must be set. When you configure the default firewall policy of an ESX/ESXi host version 5.0, you must provide the same value for the AllowIncoming and AllowOutgoing parameters. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AllowIncoming
Boolean
If the value of this parameter is $true, all incoming connections are allowed. If the value is $false, all incoming connections are disallowed. If the value of this parameter is $true, all outcoming connections are allowed. If the value is $false, all outcoming connections are disallowed. Specifies the host firewall default policy you want to apply. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
AllowOutgoing
Boolean
false
false
Policy Confirm
VMHostFirewallDefaultPolicy[] SwitchParameter
true false
WhatIf
SwitchParameter
false
false
Return Type Zero or more VMHostFirewallDefaultPolicy objects Notes Firewall management functionality is not supported on ESX 3i. Examples -------------- Example 1 -------------$ f i r e w a l l p o l i c y=G e t V M H o s t F i r e w a l l D e f a u l t P o l i c yV M H o s t1 0 . 2 3 . 1 2 3 . 1 0 0 S e t V M H o s t F i r e w a l l D e f a u l t P o l i c yP o l i c y$ f i r e w a l l p o l i c yA l l o w O u t G o i n g$ t r u e|f l Changes the default firewall policy of the virtual machine host with IP address 10.23.123.100, so that the outgoing connections are allowed.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
255/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Set-VMHostFirewallException
Synopsis
This cmdlet enables or disables host firewall exceptions. Syntax Set-VMHostFirewallException [-Enabled] [<Boolean>] [-Exception] <VMHostFirewallException[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostFirewallException Detailed Description This cmdlet enables or disables host firewall exceptions. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Enabled
Boolean
If the value is $true, the specified firewall exceptions are enabled. If the value is $false, the firewall exceptions are disabled. Specifies the firewall exceptions you want to enable or disable. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
Exception Confirm
VMHostFirewallException[] SwitchParameter
true false
SwitchParameter
false
false
Zero or more modified VMHostFirewallException objects Notes Firewall management functionality is not supported on ESX 3i. Examples -------------- Example 1 -------------$ f t p F i r e w a l l E x c e p t i o n s=G e t V M H o s t F i r e w a l l E x c e p t i o nV M H o s t$ v m h o s t|w h e r e{ $ _ . N a m e . S t a r t s W i t h ( ' F T P ' ) } $ f t p F i r e w a l l E x c e p t i o n s|S e t V M H o s t F i r e w a l l E x c e p t i o nE n a b l e d$ t r u e Enables the firewall exceptions for the FTP services on the specified host.
Set-VMHostFirmware
Synopsis
This cmdlet configures hosts firmware settings. Syntax Set-VMHostFirmware [-VMHost] <VMHost[]> [-BackupConfiguration] -DestinationPath <String> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostFirmware [-VMHost] <VMHost[]> [-ResetToDefaults] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostFirmware [-VMHost] <VMHost[]> [-Restore] [-SourcePath <String>] [-Force] [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostFirmware Detailed Description This cmdlet configures hosts firmware settings. If the BackupConfiguration parameter is set, backups the host configuration and downloads the bundle to the specified DestinationPath. In order to use the Restore and ResetToDefaults parameters, the host needs to be in maintenance mode. The Backup functionality of Set-VMHostFirmware is deprecated and scheduled for removal. For making backups, use the Get-VMHostFirmware cmdlet instead. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost BackupConfiguration
VMHost[] SwitchParameter
Specifies the host whose firmware you want to configure (it must be an ESX visor). The Backup functionality of Set-VMHostFirmware is deprecated and scheduled for removal. For making backups, use the Get-VMHostFirmware cmdlet instead. Indicates that you want to backup the host firmware configuration and download the bundle to the path specified by the DestinationPath parameter.
true false
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a destination path where to download the host
false
false
$true
DestinationPath
String
true
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
256/287
7/8/13
Force
SwitchParameter
Indicates that you want to apply the configuration even if the bundle is mismatched. Use this parameter in combination with the Restore parameter. Specifies the credential object you want to use for authenticating with the host when uploading a firmware configuration bundle. Do not use this parameter if the HostUser and HostPassword parameters are specified. Specifies a password for the authenticating with the host when uploading a firmware configuration bundle. Specifies a username for authenticating with the host when uploading a firmware configuration bundle. Indicates that you want to reset all configuration settings, including the "admin" password, to the factory defaults. The host is rebooted immediately. The host needs to be in a maintenance in order to perform this operation. Indicates that you want to restore the configuration of the host to the one that is specified in the provided bundle. The bundle is uploaded to the URL retrieved via GetVMHostFirmware. This method resets all configuration options, including the "admin" password, to the values in the bundle. The host is rebooted immediately. The host needs to be in maintenance mode in order to perform this operation. Specifies the vCenter Server systems 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 ConnectVIServer. Specifies the path to the host configuration backup bundle you want to restore. The bundle is uploaded to an URL address which you can retrieve by using the GetVMHostFirmware cmdlet. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
HostCredential
PSCredential
false
false
Restore
SwitchParameter
false
false
Server
VIServer[]
false
false
SourcePath
String
false
false
SwitchParameter
false
false
Zero or more modified HostFirmware or HostFirmwareBundle objects Notes This functionality is available on ESXi Embedded only. Examples -------------- Example 1 -------------S e t V M H o s tV M H o s tH o s tS t a t e' M a i n t e n a n c e ' S e t V M H o s t F i r m w a r eV M H o s tH o s tR e s t o r e Restore the host firmware by using the default path for the firmware bundle. You can store the bundle to the default path through HTTP by using the upload URL specified in the firmware bundle object: $bundle = Get-VMHostFirmware $uploadUrl = $bundle.UploadUrl -------------- Example 2 -------------S e t V M H o s tV M H o s tH o s tS t a t e' M a i n t e n a n c e ' S e t V M H o s t F i r m w a r eV M H o s tH o s tR e s t o r eS o u r c e P a t hc : \ b u n d l e T o R e s t o r e . t g zH o s t U s e ru s e rH o s t P a s s w o r dp a s s Restore the host firmware by specifying a firmware bundle as a source path. -------------- Example 3 -------------S e t V M H o s tV M H o s tH o s tS t a t e' M a i n t e n a n c e ' S e t V M H o s t F i r m w a r eV M H o s tH o s tR e s e t T o D e f a u l t s Reset the host configuration to the factory default settings. -------------- Example 4 -------------G e t V M H o s t F i r m w a r eV M H o s tH o s t 1 ,H o s t 2B a c k u p C o n f i g u r a t i o nD e s t i n a t i o n P a t hc : \ S t o r e d B u n d l e s S e t V M H o s tV M H o s tH o s t 1 ,H o s t 2S t a t e' M a i n t e n a n c e ' G e t V M H o s tN a m eH o s t 1 ,H o s t 2|S e t V M H o s t F i r m w a r eR e s t o r eS o u r c e P a t hc : \ S t o r e d B u n d l e sH o s t U s e ru s e rH o s t P a s s w o r dp a s s Restore multiple hosts firmware by specifying the firmware bundle as a source path directory. The command determines which bundle is needed for each host by the bundle name.
Set-VMHostHba
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 257/287
7/8/13
Syntax
This cmdlet configures the CHAP properties of the specified iSCSI HBAs. Set-VMHostHba -IScsiHba <IScsiHba[]> [-IScsiName <String>] [-ChapType <ChapType>] [-ChapName <String>] [-ChapPassword <String>] [-MutualChapEnabled [<Boolean>]] [-MutualChapName <String>] [-MutualChapPassword <String>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostHba New-IScsiHbaTarget Remove-IScsiHbaTarget Set-IScsiHbaTarget Detailed Description This cmdlet configures the CHAP properties of the specified iSCSI HBAs. If (Mutual)ChapType is set to a value different than ?Prohibited?, (Mutual)ChapPassword must be set. ChapType, MutualChapType, MutualChapName, MutualChapPassword - these are only available on 4.0 or later. Note: Run Set-VmHostHba directly against ESX. When Set-VmHostHba is run against vCenter Server, changing the iScsiName property of an iSCSI adapter modifies its AuthenticationCapabilities property. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
ChapName
String
false
false
Use the old name if any. Otherwise, use the initiator name.
ChapPassword ChapType
String ChapType
Specifies the CHAP password if CHAP is enabled. Specifies the type of the CHAP authorization. The valid values are Prohibited, Discouraged, Preferred, and Required. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the iSCSI HBA device you want to configure. Specifies a new name for the host HBA device. Indicates that Mutual CHAP authorization is enabled. Specifies the Mutual CHAP initiator name if Mutual CHAP is enabled.
false false
false false
Confirm
SwitchParameter
false
false
$true
true (ByValue) false false false Use the old name if any. Otherwise, use the initiator name.
MutualChapPassword Server
String VIServer[]
Specifies the Mutual CHAP password if Mutual CHAP is enabled. Specifies the vCenter Server systems 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 ConnectVIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false false
false false
SwitchParameter
false
false
Zero or more modified IScsiHba objects Notes The ChapType, MutualChapType, MutualChapName, and MutualChapPassword parame ters are supported only on vCenter Server/ESX 4.0 or later. Examples -------------- Example 1 -------------G e t V M H o s t H b aT y p ei S c s i|S e t V M H o s t H b aC h a p T y p eR e q u i r e dC h a p N a m eA d m i nC h a p P a s s w o r dp a s s Changes the CHAP type of the available iScsi to Required. -------------- Example 2 --------------
S e t V M H o s t H b aI S c s i H b a$ i s c s iM u t u a l C h a p E n a b l e d$ t r u eC h a p T y p eR e q u i r e dC h a p N a m eA d m i nC h a p P a s s w o r dp a s sM u t u a l C h a p N a m eA d m i n i s t r a t o rM u t u a l C h a p P a s s w o r Enables Mutual CHAP for the iScsi devices stored in the $iscsi variable and changes the CHAP type to Required.
Set-VMHostModule
Synopsis
This cmdlet overrides the host module options with the given ones. Syntax Set-VMHostModule [-HostModule] <VmHostModule[]> [-Options] <String> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostModule Detailed Description This cmdlet overrides the host module options with the given ones. Parameters
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
258/287
7/8/13
NA ME TYPE DESCRIPTION
Specifies the host module you want to configure. Specifies the new options of the host module. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter
false
false
Zero or more modified VmHostModule objects Notes Supported only on ESX 4.0, ESX 4i, and later. Examples -------------- Example 1 -------------$ m o d u l e=G e t V M H o s t M o d u l eN a m eS h a p e r S e t V M H o s t M o d u l eH o s t M o d u l e$ m o d u l eO p t i o n s" N e wo p t i o n st e x t " Overrides the options of the Shaper host module with the provided ones. -------------- Example 2 -------------G e t V M H o s t M o d u l eS h a p e r|S e t V M H o s t M o d u l eO p t i o n s" N e wo p t i o n st e x t "C o n f i r m Overrides the options of the Shaper host module with the provided ones.
Set-VMHostNetwork
Synopsis
This cmdlet updates the specified virtual network. Syntax Set-VMHostNetwork [-Network] <VMHostNetworkInfo[]> [-ConsoleGateway <String>] [-VMKernelGateway <String>] [-VMKernelGatewayDevice <String>] [ConsoleGatewayDevice <String>] [-DomainName <String>] [-HostName <String>] [-DnsFromDhcp [<Boolean>]] [-DnsDhcpDevice <Object>] [-DnsAddress <String[]>] [SearchDomain <String[]>] [-IPv6Enabled [<Boolean>]] [-ConsoleV6Gateway <String>] [-ConsoleV6GatewayDevice <String>] [-VMKernelV6Gateway <String>] [VMKernelV6GatewayDevice <String>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostNetwork Detailed Description This cmdlet updates the specified virtual network. The service console and the VMkernel are often not connected to the same network, and therefore each needs its own gateway information. A gateway is needed for connectivity to machines not on the same IP subnet as the service console or VMkernel. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Network Confirm
VMHostNetworkInfo[] SwitchParameter
Specifies the host network you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new console gateway. Specifies a new console gateway device. Specifies a console V6 gateway address. Not supported on ESXi. Specifies a console V6 gateway device. Not supported on ESXi. Specifies a new DNS address. This parameter is mandatory if the value of the DnsFromDhcp parameter is 'true'. Otherwise, it is disregarded. If the DnsDhcpDevice parameter is set, the Dhcp DNS of the service console or VMKernel network adapter will override the system DNS. The parameter takes a ServiceConsoleNIC object, a VMKernelNIC object in case of an ESX visor, or the NIC name as a string. Indicates that you want to obtain the network settings from a Dhcp server. Specifies a new domain name. Specifies a new host name. Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables the ConsoleV6Gateway, ConsoleV6GatewayDevice, and VMKernelV6Gateway parameters. IPv6 is supported only on vCenter 4.0 and ESX 4.0 or later. To use IPv6 on ESX, you must restart the host after enabling IPv6.
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
259/287
7/8/13
SearchDomain VMKernelGateway VMKernelGatewayDevice VMKernelV6Gateway VMKernelV6GatewayDevice WhatIf String[] String String String String SwitchParameter
Return Type Zero or more modified VMHostNetworkInfo objects Notes If "DnsFromDhcp" is enabled ?DomainName? and ?HostName? cannot be explicitl y set. To configure IPv6 settings, you must be working on ESX 4.0 or later, and IP v6 must be enabled on the host system. The new IPv6 settings take effect af ter the host is restarted. Examples -------------- Example 1 -------------$ v m H o s t N e t w o r k I n f o=G e t V m H o s t N e t w o r kH o s tH o s t S e t V m H o s t N e t w o r kN e t w o r k$ v m H o s t N e t w o r k I n f oV M K e r n e l G a t e w a y1 0 . 2 3 . 1 1 . 1 1D o m a i n N a m ee n g . v m w a r e . c o mH o s t N a m eH o s t 1D n s F r o m D h c p$ f a l s e Gets the network configuration of the virtual machine host named Host. Sets the virtual machine kernel gateway, the domain name, the host name, and the Dhcp of the network. -------------- Example 2 -------------G e t V M H o s tH o s t|G e t V M H o s t N e t w o r k|S e t V M H o s t N e t w o r kI P v 6 E n a b l e d$ t r u e G e t V M H o s tH o s t|R e s t a r t V M H o s tF o r c eC o n f i r m : $ f a l s e Enables IPv6 support on the Host host and restarts the host. -------------- Example 3 -------------G e t V M H o s tH o s t|G e t V M H o s t N e t w o r k|S e t V M H o s t N e t w o r kC o n s o l e V 6 G a t e w a y$ i p v 6 G a t e w a y A d d r e s sC o n s o l e V 6 G a t e w a y D e v i c e" v s w i f 0 " Configures the IPv6 console default gateway on the Host host. -------------- Example 4 -------------G e t V M H o s tH o s t|G e t V M H o s t N e t w o r k|S e t V M H o s t N e t w o r kV M K e r n e l V 6 G a t e w a y$ i p v 6 G a t e w a y A d d r e s s Configures the IPv6 VMKernel default gateway on the Host host.
Set-VMHostNetworkAdapter
Synopsis
This cmdlet configures the specified host network adapter. Syntax Set-VMHostNetworkAdapter -PhysicalNic <PhysicalNic[]> [-Duplex <String>] [-BitRatePerSecMb <Int32>] [-AutoNegotiate] [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostNetworkAdapter -VirtualNic <HostVirtualNic[]> -PortGroup <DistributedPortGroup> [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostNetworkAdapter -VirtualNic <HostVirtualNic[]> [-Dhcp] [-IP <String>] [-SubnetMask <String>] [-Mac <String>] [-Mtu <Int32>] [-VMotionEnabled [<Boolean>]] [-FaultToleranceLoggingEnabled [<Boolean>]] [-ManagementTrafficEnabled [<Boolean>]] [-IPv6ThroughDhcp [<Boolean>]] [-AutomaticIPv6 [<Boolean>]] [-IPv6 <String[]>] [-IPv6Enabled [<Boolean>]] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version New-VMHostNetworkAdapter Remove-VMHostNetworkAdapter Detailed Description This cmdlet configures the specified host network adapter. For a physical NIC, you can change the duplex and the bit rate settings (10, 100, 1000, 10000). For a regular virtual NIC, you can change the IP address and the subnet mask. For a console virtual NIC, you can modify the IP and the subnet mask, or choose DHCP mode. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
AutomaticIPv6 AutoNegotiate
Boolean SwitchParameter
Indicates that the IPv6 address is obtained through a router advertisement. Indicates that the host network adapter speed/duplex settings are configured automatically. Use this parameter only if the Duplex and BitRatePerSecMb parameters are not set. Specifies the bit rate of the link. Only valid when configuring a physical NIC. Use this parameter only if the AutoNegotiate parameter is not set. Note that updating the speed (BitRatePerSec) of a physical NIC might take some time due to the hardware configuration being performed, and the returned object might still contain the current configuration instead of the updated one.
false false
false false
BitRatePerSecMb
Int32
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
260/287
7/8/13
Confirm SwitchParameter
Dhcp
SwitchParameter
false
false
Duplex
String
false
false
FaultToleranceLoggingEnabled
Boolean
false
false
IP
String
false
false
IPv6
String[]
false
false
IPv6Enabled
Boolean
false
false
IPv6ThroughDhcp Mac
Boolean String
false false
false false
ManagementTrafficEnabled
Boolean
false
false
SubnetMask
String
false
false
Return Type Zero or more modified HostNic objects Notes To configure IPv6 settings, you must be working on ESX 4.0 or later and IPv 6 must be enabled on the ESX system. Examples -------------- Example 1 -------------$ v s w i t c h= N e w V i r t u a l S w i t c hV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4 N a m eV S w i t c h $ n i c= N e w V M H o s t N e t w o r k A d a p t e rV M H o s t1 0 . 2 3 . 1 1 2 . 2 3 4P o r t G r o u pP o r t G r o u pV i r t u a l S w i t c h$ v s w i t c hI P1 0 . 2 3 . 1 2 3 . 2 3 4S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 4 . 0 S e t V M H o s t N e t w o r k A d a p t e rV i r t u a l N I C$ n i cI P1 0 . 2 3 . 1 1 2 . 2 4 5S u b n e t M a s k2 5 5 . 2 5 5 . 2 5 5 . 0M t u4 0 0 0 Updates the network adapter IP address, Subnet mask, and MTU size. -------------- Example 2 -------------G e t V M H o s tH o s t|G e t V M H o s t N e t w o r k A d a p t e rV M K e r n e l|S e t V M H o s t N e t w o r k A d a p t e rV M o t i o n E n a b l e d$ t r u e Enable VMotion on all VMKernel network adapters on the specified host. -------------- Example 3 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
261/287
7/8/13
G e t V M H o s t N e t w o r k A d a p t e r|w h e r e{$ _ . P o r t G r o u p N a m ee q" S e r v i c eC o n s o l e1 "}|S e t V M H o s t N e t w o r k A d a p t e rI P v 6 E n a b l e d$ f a l s e Disables the IPv6 support on a network adapter. -------------- Example 4 -------------G e t V M H o s t N e t w o r k A d a p t e r|w h e r e{$ _ . P o r t G r o u p N a m ee q" S e r v i c eC o n s o l e1 "}|S e t V M H o s t N e t w o r k A d a p t e rI P v 6 T h r o u g h D h c p$ t r u e Configures a network adapter to obtain IPv6 through DHCP. -------------- Example 5 -------------G e t V M H o s t N e t w o r k A d a p t e r|w h e r e{$ _ . P o r t G r o u p N a m ee q" S e r v i c eC o n s o l e1 "}|S e t V M H o s t N e t w o r k A d a p t e rA u t o m a t i c I P v 6$ t r u e Configures a network adapter to obtain IPv6 by a router advertisement. -------------- Example 6 -------------G e t V M H o s t N e t w o r k A d a p t e r|w h e r e{$ _ . P o r t G r o u p N a m ee q" S e r v i c eC o n s o l e1 "}|S e t V M H o s t N e t w o r k A d a p t e rI P v 6$ i p v 6 A d d r e s s Changes the IPv6 address of a network adapter.
Set-VMHostProfile
Synopsis
This cmdlet modifies the specified host profile. Syntax Set-VMHostProfile [[-Name] <String>] [[-ReferenceHost] <VMHost>] [-Profile] <VMHostProfile[]> [-Description <String>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Export-VMHostProfile Get-VMHostProfile Import-VMHostProfile New-VMHostProfile Remove-VMHostProfile Test-VMHostProfileCompliance Detailed Description This cmdlet modifies the specified host profile. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies a new name for the host profile. Specifies a reference host for the host profile. Specifies the host profile you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies a new description for the host profile. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Description Server
String VIServer[]
false false
false false
SwitchParameter
false
false
Zero or more VMHostProfile objects Notes Examples -------------- Example 1 -------------$ p r o f i l e=(G e t V M H o s t P r o f i l eN a m eP r o f i l e) [ 0 ] S e t V M H o s t P r o f i l eP r o f i l e$ p r o f i l eD e s c r i p t i o n" N e wd e s c r i p t i o n . " Changes the description of the Profile host profile.
Set-VMHostRoute
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 262/287
7/8/13
This cmdlet modifies a route in the host routing table. Syntax
Set-VMHostRoute [-VMHostRoute] <VMHostRoute[]> [-Destination <IPAddress>] [-Gateway <IPAddress>] [-PrefixLength <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostRoute New-VMHostRoute Remove-VMHostRoute Detailed Description This cmdlet modifies a route in the host routing table. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHostRoute Confirm
VMHostRoute[] SwitchParameter
Specifies the route you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Changes the destination IP address of the route. Changes the gateway IP address of the route. Modifies the prefix length of the destination IP address. For IPv4, the valid values are from 0 to 32, and for IPv6 - from 0 to 128. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Zero or more modified VMHostRoute objects Notes Supported only on ESX 4.0/ vCenter Server 4.0 and later. Examples -------------- Example 1 -------------$ v m h o s t r o u t e=N e w V M H o s t R o u t eV M H o s t1 0 . 2 3 . 1 1 4 . 1 8 9D e s t i n a t i o n1 9 2 . 1 6 8 . 1 0 4 . 1 0 1G a t e w a y1 0 . 2 3 . 8 4 . 6 9P r e f i x L e n g t h3 2 $ v m h o s t r o u t e|S e t V M H o s t R o u t eG a t e w a y1 0 . 2 3 . 8 4 . 7 0 Creates a new host route and modifies its gateway. -------------- Example 2 -------------$ v m h o s t r o u t e 1=N e w V M H o s t R o u t eV M H o s t1 0 . 2 3 . 1 1 4 . 1 8 9D e s t i n a t i o n1 9 2 . 1 6 8 . 1 0 4 . 1 0 1G a t e w a y1 0 . 2 3 . 8 4 . 6 9P r e f i x L e n g t h3 2 $ v m h o s t r o u t e 2=N e w V M H o s t R o u t eV M H o s t1 0 . 2 3 . 1 1 4 . 1 9 0D e s t i n a t i o n1 9 2 . 1 6 8 . 1 0 4 . 1 0 1G a t e w a y1 0 . 2 3 . 8 4 . 7 0P r e f i x L e n g t h3 2 S e t V M H o s t R o u t eV M H o s t R o u t e( $ v m h o s t r o u t e 1 ,$ v m h o s t r o u t e 2 )D e s t i n a t i o n1 9 2 . 1 6 8 . 1 0 4 . 0P r e f i x L e n g t h2 4 Modifies the destination and the prefix length of two host routes.
Set-VMHostService
Synopsis
This cmdlet modifies a host service. Syntax Set-VMHostService [-HostService] <HostService[]> [-Policy] <HostServicePolicy> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostService Start-VMHostService Stop-VMHostService Restart-VMHostService Detailed Description This cmdlet modifies a host service. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the host service you want to update. Specifies an activation policy for the host service. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
263/287
7/8/13
-------------- Example 1 --------------
G e t V M H o s t S e r v i c eV M H o s tH o s t|S e t V M H o s t S e r v i c eP o l i c y" A u t o m a t i c " Sets the policy of all services the Host virtual machine host to "Automatic".
Set-VMHostSnmp
Synopsis
This cmdlet modifies the host SNMP configuration. Syntax Set-VMHostSnmp [-HostSnmp] <VmHostSnmp[]> [-Enabled [<Boolean>]] [-Port <Int32>] [-ReadOnlyCommunity [<CommonParameters>] Set-VMHostSnmp [-HostSnmp] <VmHostSnmp[]> [-Enabled [<Boolean>]] [-Port <Int32>] [-ReadOnlyCommunity <Int32>] -TargetHost <String> -AddTarget [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostSnmp [-HostSnmp] <VmHostSnmp[]> [-Enabled [<Boolean>]] [-Port <Int32>] [-ReadOnlyCommunity <Int32>] [-TargetHost <String>] -RemoveTarget [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMHostSnmp [-HostSnmp] <VmHostSnmp[]> [-Enabled [<Boolean>]] [-Port <Int32>] [-ReadOnlyCommunity <TrapTarget> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostSNMP Test-VMHostSNMP Detailed Description This cmdlet modifies the host SNMP configuration. If specified, adds or removes a trap target (removing can be specified by either TrapTargetToRemove parameter or by any of the following parameters (or combination of them): TargetCommunity, TargetHost, TargetPort). If the user passes $null, an empty array or string to the ReadOnlyCommunities parameter, the old values of this property are erased. This results in a NULL value of this property of the output object. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
<String[]>] [-WhatIf] [-Confirm] <String[]>] -TargetCommunity <String> [-TargetPort <String[]>] [-TargetCommunity <String>] [-TargetPort <String[]>] [-RemoveTarget] -TrapTargetToRemove
HostSnmp AddTarget
VmHostSnmp[] SwitchParameter
Specifies the host Snmp object you want to modify. Indicates that you want to add a new trap target to the host SNMP configuration. A trap target consists of three elements - Community (mandatory), HostName (mandatory), Port (optional - defaults to 162), specified by the TargetCommunity, TargetHost, and TargetPort parameters. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the SNMP feature is enabled on the specified host. Specifies the port on which the host listens to SNMP messages. Provide a list of communities, identifying who is able to send SNMP requests to that host. If $null, an empty array or string are passed to this parameter, its old values are erased and the output object for the ReadOnlyCommunity property is an empty array. In PowerShell an empty array is defined by @(). Indicates that you want to remove a trap target from the host SNMP configuration. There are two ways to specify a trap target: * Pass the trap target to the TrapTargetToRemove parameter. * Use a combination of the TargetCommunity, TargetHost, and TargetPort parameters to specify a criteria (for example, remove all trap targets that are using port 162). Specifies the community identifier of the trap target. Specifies the identifier of the target host - a host name or an IP address. Specifies the port on which the target host listens to SNMP messages. Specifies the trap target you want to remove. The trap target can be obtained from the ?TrapTargets? property of the HostSNMP object (an array of TrapTarget objects). Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true true
Confirm
SwitchParameter
false
false
$true
RemoveTarget
SwitchParameter
true
false
SwitchParameter
false
false
Zero or more modified VmHostSnmp objects Notes You must be connected to the ESX/ESXi host directly. Examples -------------- Example 1 -------------$ v m h o s t S N M P=G e t V M H o s t S N M P S e t V M H o s t S N M P$ v m h o s t S N M PE n a b l e d : $ t r u eR e a d O n l y C o m m u n i t y' s e c r e t '
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
264/287
7/8/13
Enables SNMP on a virtual machine host. -------------- Example 2 --------------
G e t V M H o s t S n m p|S e t V M H o s t S n m pR e a d o n l y C o m m u n i t y@ ( ) Sets the virtual machine host Snmp by erasing the old value of the ReadOnlyCommunity parameter.
Set-VMHostStartPolicy
Synopsis
This cmdlet modifies the host default start policy. Syntax Set-VMHostStartPolicy [-VMHostStartPolicy] <VMHostStartPolicy[]> [-Enabled [<Boolean>]] [-StartDelay <Int32>] [-StopAction <VmStopAction>] [-StopDelay <Int32>] [WaitForHeartBeat [<Boolean>]] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostStartPolicy Detailed Description This cmdlet modifies the host default start policy. Start policy defines what happens to virtual machines when the server starts up or stops. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHostStartPolicy Confirm
VMHostStartPolicy[] SwitchParameter
Specifies the host start policy you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the service that controls the host start policies is enabled. If it is enabled, the default start policies and the start policies of the specified hosts are applied. If disabled, no start policy is applied. Specifies a default start delay of the virtual machines in seconds. Specifies the default action that is applied to the virtual machines when the server stops. The valid values are None, Suspend, PowerOff, or GuestShutDown. Specifies a default stop delay of the virtual machines in seconds. Specifies whether the virtual machines should start after receiving a heartbeat from the host, ignore heartbeats, and start after the StartDelay has elapsed ($true), or follow the system default before powering on ($false). When a virtual machine is next in the start order, the system either waits a specified period of time for a host to power on or it waits until it receives a successful heartbeat from a powered-on host. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Enabled
Boolean
false
false
StartDelay StopAction
Int32 VmStopAction
false false
false false
StopDelay WaitForHeartBeat
Int32 Boolean
false false
false false
SwitchParameter
false
false
Zero or more modified VMHostStartPolicy objects Notes Examples -------------- Example 1 -------------G e t V M H o s tH o s t|G e t V M H o s t S t a r t P o l i c y|S e t V M H o s t S t a r t P o l i c yE n a b l e d : $ t r u eS t a r t O r d e r2S t a r t D e l a y3 0 0S t o p A c t i o nG u e s t S h u t D o w nS t o p D e l a y3 0 0 Retrieves the start policy of the Host host and modifies its configuration settings. -------------- Example 2 -------------G e t V M H o s tH o s t|G e t V M H o s t S t a r t P o l i c y|S e t V M H o s t S t a r t P o l i c yW a i t F o r H e a r t b e a t Retrieves the start policy of the Host host and modifies its configuration settings, so that virtual machines on the specified host wait for the host heartbeat.
Set-VMHostStorage
Synopsis
This cmdlet configures a host storage. Syntax Set-VMHostStorage -VMHostStorage <VMHostStorageInfo[]> -SoftwareIScsiEnabled [<Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
265/287
7/8/13
Online version Get-VMHostStorage Detailed Description
This cmdlet configures a host storage. The cmdlet enables or disables the software iSCSI support for the specified VMHostStorage objects. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Confirm
SwitchParameter
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that on this storage, software iSCSI is enabled. Specifies the host storage you want to configure. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
$true
Return Type Zero or more modified VMHostStorageInfo objects Notes Examples -------------- Example 1 -------------G e t V M H o s t S t o r a g e1 0 . 2 3 . 1 1 2 . 2 3 4|S e t V M H o s t S t o r a g eS o f t w a r e I S c s i E n a b l e d$ t r u e Enables the iSCSI on the specified storage.
Set-VMHostSysLogServer
Synopsis
This cmdlet configures the remote syslog server of the specified hosts. Syntax Set-VMHostSysLogServer [[-SysLogServer] <NamedIPEndPoint>] [-VMHost] <VMHost[]> [-SysLogServerPort <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostSysLogServer Detailed Description This cmdlet configures the remote syslog server of the specified hosts. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
SysLogServer
NamedIPEndPoint
Specifies the sys log servers you want to configure. The parameter accepts objects of the NamedIPEndPoint, IPEndPoint, IPAddress, and String types. The accepted formats, if string is used, are DNS names and the standard IPv6/IPv4 format: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:192.168.0.1:80, where the FFFF:FFFF:FFFF:FFFF:FFFF:FFFF can be replaced by any hex value with the same structure (both upper or lower case). It is only meaningful in case of IPv6 address and is omitted for IPv4. The 192.168.0.1 part is mandatory and can be any address in the IPv4 format. The :80 part is optional. If omitted, the port must be specified through the SysLogServerPort parameter. If Syslog is set to $null, the configured syslog server, if any, is removed. Specifies the host whose syslog servers you want to configure. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Specifies the vCenter Server systems 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 ConnectVIServer. Specifies the sys log server port. Must be specified if the string that is passed to the SysLogServer parameter does not contain the port value, or the argument of the SysLogServer is an IP address. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
true (ByValue)
VMHost Confirm
VMHost[] SwitchParameter
true false
Server
VIServer[]
false
false
SysLogServerPort
Int32
false
false
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
266/287
7/8/13
S e t V M H o s t S y s L o g S e r v e rS y s L o g S e r v e r' 1 9 2 . 1 6 8 . 0 . 1 : 1 3 3 'V M H o s tH o s t Sets a SysLog server on the Host virtual machine host. -------------- Example 2 -------------S e t V M H o s t S y s L o g S e r v e rS y s L o g S e r v e r$ n u l lV M H o s tH o s t Removes the SysLog server from the Host virtual machine host.
Set-VMQuestion
Synopsis
This cmdlet answers the specified virtual machine question. Syntax Set-VMQuestion -VMQuestion <VMQuestion[]> [-Option] <Object> [-WhatIf] [-Confirm] [<CommonParameters>] Set-VMQuestion -VMQuestion <VMQuestion[]> -DefaultOption [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMQuestion Detailed Description This cmdlet answers the specified virtual machine question using the value of the Option parameter. If the DefaultOption parameter is set to $true, the cmdlet answers the question with a default option, if any. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Option
Object
Specifies an object or string to provide an option to the virtual machine question. Wildcards are supported for string values. The string can be used to specify an option ID or label. If the string does not match a valid option ID or label, or if there are multiple matches, an error is generated. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to answer the virtual machine question using a default option. If no default option exists for the question, an error is generated. Specifies the virtual machine question you want to answer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true
false
Confirm
SwitchParameter
false
false
$true
DefaultOption
SwitchParameter
true
false
VMQuestion[] SwitchParameter
true false
The modified VMQuestion object Notes You can also call this cmdlet via the Answer-VMQuestion alias. Examples -------------- Example 1 -------------S e t V M Q u e s t i o nV M Q u e s t i o n$ q u e s t i o nD e f a u l t O p t i o n Answers the question stored in the $question with a default option. -------------- Example 2 -------------S e t V M Q u e s t i o nV M Q u e s t i o n$ q u e s t i o nO p t i o n" C a n c e l " Answers the question stored in the $question variable with "cancel". -------------- Example 3 -------------G e t V MV M|G e t V M Q u e s t i o n|S e t V M Q u e s t i o nD e f a u l t O p t i o n Answers the question of VM virtual machine with a default option.
Set-VMResourceConfiguration
Synopsis
This cmdlet configures resource allocation between the virtual machines. Syntax Set-VMResourceConfiguration [-Configuration] <VMResourceConfiguration[]> [-HtCoreSharing <HTCoreSharing>] [-CpuAffinity <CpuAffinity>] [-CpuAffinityList <Int32[]>] [-CpuReservationMhz <Int64>] [-CpuLimitMhz <Int64>] [-CpuSharesLevel <SharesLevel>] [-NumCpuShares <Int32>] [-MemReservationMB <Int64>] [MemReservationGB <Decimal>] [-MemLimitMB <Int64>] [-MemLimitGB <Decimal>] [-MemSharesLevel <SharesLevel>] [-NumMemShares <Int32>] [-Disk <HardDisk[]>] [-
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
267/287
7/8/13
Related Commands Online version Get-VMResourceConfiguration Detailed Description
This cmdlet configures resource allocation between the virtual machines. To retain the current value of a setting, omit the corresponding parameter. To disable a setting (only applicable to the nullable limit settings), pass $null. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Configuration Confirm
VMResourceConfiguration[] SwitchParameter
Specifies the configuration object you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. The use of this parameter is deprecated. Use CpuAffinityList instead. Specifies the distribution of virtual machine CPUs across the physical cores or hyperthreads of the host. You must pass exactly as many arguments as the number of CPUs of the virtual machine. Each argument specifies the physical core or hyperthread that the virtual machine will use. Valid arguments are NoAffinity, Cpu1, ?, Cpu63. When the virtual machine resides in a DRS cluster, you cannot use CpuAffinity.
true false
CpuAffinity
CpuAffinity
false
false
CpuAffinityList
Int32[]
Specifies the distribution of virtual machine CPUs across the physical cores or hyperthreads of the host. You must pass exactly as many arguments as the number of CPUs of the virtual machine. Each argument specifies the physical core or hyperthread that the virtual machine will use. Valid arguments are positive integers. To clear formerly specified arguments, pass an empty array. When the virtual machine resides in a DRS cluster, you cannot use CpuAffinityList.
false
false
CpuLimitMhz
Int64
Specifies the limit on CPU usage in MHz. Utilization will not exceed this limit even if there are available resources. Specifies the number of CPU MHz that are guaranteed to be available. Specifies the CPU allocation level. Used in relative allocation between virtual machines. The valid values are Custom, High, Low, and Normal. Specifies the virtual hard disk you want to configure. Specifies the disk limit IO per second. The valid values are in the range between 16 and 2147483647. -1 means unlimited. Specifies the allocation level. The level is a simplified view of shares. Levels map to a predetermined set of numeric values for shares. If the shares value does not map to a predefined size, then the level is set as custom. Specifies whether a virtual machine is scheduled to share a physical processor core (assuming hyperthreading is enabled on the host at all). The following values are valid: Any - (default) the virtual CPUs of this virtual machine can freely share cores with other virtual CPUs of this or other virtual machines. None - the virtual CPUs of this virtual machine have exclusive use of a processor core whenever they are scheduled to it. The other hyperthread of the core is "halted" while this virtual machine is using the core. Internal - on a virtual machine with exactly two virtual processors, the two virtual processors are allowed to share one physical core (at the discretion of the ESX scheduler), but this virtual machine never shares a core with any other virtual machine. If this virtual machine has any other number of processors than two, this setting is the same as the None setting.
false
false
CpuReservationMhz CpuSharesLevel
Int64 SharesLevel
false false
false false
Disk DiskLimitIOPerSecond
HardDisk[] Int64
false false
false false
DiskSharesLevel
SharesLevel
false
false
HtCoreSharing
HTCoreSharing
false
false
MemLimitGB
Decimal
Specifies a memory usage limit in gigabytes (GB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. This parameter is obsolete. Use MemLimitGB instead. Specifies a memory usage limit in megabytes (MB). If this parameter is set, utilization will not exceed the specified limit even if there are available resources. Specifies the guaranteed available memory in gigabytes (GB). This parameter is obsolete. Use
false
false
MemLimitMB
Int64
false
false
MemReservationGB MemReservationMB
Decimal Int64
false false
false false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
268/287
7/8/13
MemSharesLevel
SharesLevel
Specifies the memory allocation level for this pool. Used in relative allocation between resource consumers. The valid values are Custom, High, Low, and Normal. Specifies the CPU allocation level for this pool. Used in relative allocation between resource consumers. This parameter is ignored unless CpuSharesLevel is set to Custom. Specifies the number of shares allocated. Used to determine resource allocation in case of resource contention. Specifies the number of memory shares allocated. Used to determine resource allocation in case of resource contention. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
NumCpuShares
Int32
false
false
NumDiskShares
Int32
false
false
NumMemShares
Int32
false
false
WhatIf
SwitchParameter
false
false
Return Type Zero or more modified VMResourceConfiguration objects Notes Examples -------------- Example 1 -------------S e t V M R e s o u r c e C o n f i g u r a t i o nC o n f i g u r a t i o n$ c o n fC p u A f f i n i t y( [ C p u A f f i n i t y ] : : C p u 1b o r[ C p u A f f i n i t y ] : : C p u 2 ) Specifies two affinities for the virtual machine resource configuration in the $conf variable. Bit Or is used.
Set-VMStartPolicy
Synopsis
This cmdlet modifies the virtual machine start policy. Syntax Set-VMStartPolicy [-StartPolicy] <VMStartPolicy[]> [-StartAction <VmStartAction>] [-StartOrder <Int32>] [-InheritStopActionFromHost] [-InheritStopDelayFromHost] [InheritWaitForHeartbeatFromHost] [-InheritStartDelayFromHost] [-UnspecifiedStartOrder] [-StartDelay <Int32>] [-StopAction <VmStopAction>] [-StopDelay <Int32>] [WaitForHeartBeat [<Boolean>]] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMStartPolicy Detailed Description This cmdlet modifies the virtual machine start policy. Start policy defines what happens to virtual machines when the server starts up or stops. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
StartPolicy Confirm
VMStartPolicy[] SwitchParameter
Specifies the virtual machine start policy you want to modify. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the virtual machine uses the value of the StartDelay parameter of the host. Indicates that the virtual machine uses the value of the StopAction parameter of the host. Indicates that the virtual machine uses the value of the StopDelay parameter of the host. Indicates that the virtual machine uses the value of the WaitforHeartbeat parameter of the host. Specifies a start action for virtual machines. It can be None or PowerOn. Specifies a default start delay in seconds. Specifies a number to define the virtual machines start order. Specifies the default action of the virtual machine when the server stops. The valid values are None, Suspend, PowerOff, and GuestShutDown. Specifies the default stop delay in seconds. Indicates that no order is defined for starting the virtual machines. Indicates whether the virtual machine should
true false
InheritStartDelayFromHost
SwitchParameter
false
false
InheritStopActionFromHost
SwitchParameter
false
false
InheritStopDelayFromHost
SwitchParameter
false
false
InheritWaitForHeartbeatFromHost
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
269/287
7/8/13
WhatIf
SwitchParameter
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
Return Type Zero or more modified VMStartPolicy objects Notes Examples -------------- Example 1 -------------$ v m s t a r t p o l i c y=G e t V M S t a r t P o l i c yV MV M S e t V M S t a r t P o l i c yS t a r t P o l i c y$ v m s t a r t p o l i c yS t a r t A c t i o nP o w e r O n Retrieves the start policy of the VM virtual machine and defines that when the server starts, the virtual machine is powered on. -------------- Example 2 -------------G e t V MV M|G e t V M S t a r t P o l i c y|S e t V M S t a r t p o l i c yI n h e r i t S t o p A c t i o n F r o m H o s tI n h e r i t S t o p D e l a y F r o m H o s t Reconfigures the start policy of the VM virtual machine to inherit the values of the StopAction and StopDelay from the host. -------------- Example 3 -------------G e t V MV M|G e t V M S t a r t P o l i c y|S e t V M S t a r t p o l i c yS t a r t A c t i o nP o w e r O nS t a r t O r d e r2S t a r t D e l a y3 0 0S t o p A c t i o nG u e s t S h u t D o w nS t o p D e l a y3 0 0 Retrieve the start policy of the specified virtual machine and modify its configuration settings.
Shutdown-VMGuest
Synopsis
This cmdlet shuts down the specified virtual machine guest OS. Syntax Shutdown-VMGuest [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Shutdown-VMGuest [[-Guest] <VMGuest[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMGuest Restart-VMGuest Suspend-VMGuest Detailed Description This cmdlet issues a command to the guest operating system asking it to prepare for a shutdown operation. Returns immediately and does not wait for the guest operating system to complete the operation. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Guest VM Server
Specifies the virtual machine guests you want to shut down. Specifies the virtual machines whose operating systems you want to shut down. The virtual machines must have VMware Tools installed. Specifies the vCenter Server systems 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-VIServer. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
WhatIf
SwitchParameter
false
false
Return Type Zero or more shutdown VMGuest objects Notes Examples -------------- Example 1 -------------G e t V MV M|S h u t d o w n V M G u e s t Shutdowns the guest OS of the virtual machine named VM.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
270/287
7/8/13
Start-CIVApp
Synopsis
This cmdlet starts the specified vApp. Syntax Start-CIVApp [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp New-CIVapp Remove-CIVapp Restart-CIVapp Set-CIVapp Stop-CIVapp Suspend-CIVapp Detailed Description This cmdlet starts the specified vApp. Powers on all virtual machines in the vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp you want to start. The operation applies the start policy for the vApp, if any. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVApp objects Notes Examples -------------- Example 1 -------------$ m y V a p p=G e t C I V A p p' M y v A p p ' S t a r t C I V A p p$ m y V A p p Starts the specified vApp. -------------- Example 2 -------------$ m y V a p p=G e t C I V A p p' M y v A p p ' $ t a s k=$ m y V A p p|S t a r t C I V A p pR u n A s y n c Starts the specified vApp asynchronously.
Start-CIVM
Synopsis
This cmdlet powers on the specified virtual machine. Syntax Start-CIVM [-VM] <CIVM[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVM Restart-CIVM Stop-CIVM Suspend-CIVM Detailed Description This cmdlet powers on the specified virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
CIVM[] SwitchParameter
Specifies the virtual machine you want to power on. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.
true false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
271/287
7/8/13
RunAsync SwitchParameter
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVM objects Notes Examples -------------- Example 1 -------------$ m y V M=G e t C I V MN a m e' M y V M ' S t a r t C I V M$ m y V M Powers on the specified virtual machine. -------------- Example 2 -------------$ m y V M=G e t C I V MN a m e' M y V M ' $ t a s k=S t a r t C I V M$ m y V MR u n A s y n c Powers on the specified virtual machine asynchronously.
Start-VApp
Synopsis
This cmdlet starts vApps. Syntax Start-VApp [-VApp] <VApp[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Export-VApp Get-VApp Import-VApp New-VApp Remove-VApp Set-VApp Stop-VApp Move-VApp Detailed Description This cmdlet starts vApps. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
VApp[] SwitchParameter
Specifies the vApp that you want to start. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more started VApp objects Notes Examples -------------- Example 1 -------------G e t V M H o s tM y V M H o s t 1|G e t V A p p|S t a r t V A p p Starts all vApps on the specified host.
7/8/13
Start-VM
Synopsis
This cmdlet powers on virtual machines. Syntax Start-VM [-RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Move-VM New-VM Remove-VM Set-VM Stop-VM Suspend-VM Move-VApp Detailed Description This cmdlet powers on the virtual machines specified by the VM parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines you want to power on. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more powered-on VirtualMachine objects Notes Examples -------------- Example 1 -------------S t a r t V MV MV MC o n f i r mR u n A s y n c Asynchronously starts the virtual machine named VM. Before initializing the task, asks for confirmation.
Start-VMHost
Synopsis
This cmdlet starts the specified hosts. Syntax Start-VMHost [-VMHost] <VMHost[]> [-TimeoutSeconds <Int32>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VMHost Get-VMHost Move-VMHost Remove-VMHost Restart-VMHost Set-VMHost Stop-VMHost Suspend-VMHost Detailed Description This cmdlet starts the specified hosts. The task completes when the host successfully exits standby state and sends a heartbeat signal. If nothing is received from the host for the time defined by the TimeoutSeconds parameter, the host is declared timed out, and the task is assumed failed. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the hosts you want to start. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems on which you want to run
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
273/287
7/8/13
TimeoutSeconds
Int32
Specifies a time period in seconds to wait for a heartbeat signal from the host. If nothing is received from the host for the specified time, the host is declared timed out, and the task is assumed failed. The default value is 300. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
false
false
300
SwitchParameter
false
false
Zero or more powered-on VMHost objects Notes Examples -------------- Example 1 -------------S t a r t V M H o s t1 0 . 2 3 . 1 1 2 . 2 3 5R u n A s y n c Starts the specified host. The command returns without waiting for the task to complete.
Start-VMHostService
Synopsis
This cmdlet starts the specified host services. Syntax Start-VMHostService [-HostService] <HostService[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostService Set-VMHostService Stop-VMHostService Restart-VMHostService Detailed Description This cmdlet starts the specified host services. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HostService Confirm
HostService[] SwitchParameter
Specifies the host services you want to start. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
Zero or more restarted HostService objects Notes Examples -------------- Example 1 -------------S t a r t V M H o s t S e r v i c eS e r v i c e$ v m H o s t S e r v i c e Starts a host service.
Stop-CIVApp
Synopsis
This cmdlet stops the specified vApp. Syntax Stop-CIVApp [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp New-CIVApp Remove-CIVApp Restart-CIVApp Set-CIVApp Start-CIVApp Suspend-CIVApp Detailed Description
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
274/287
7/8/13
Parameters
NA ME TYPE DESCRIPTION
This cmdlet stops the specified vApp. Powers off all virtual machines in the vApp.
REQUIRED?
PIPELINE INPUT
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp you want to stop. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVApp objects Notes Examples -------------- Example 1 -------------$ m y V a p p=G e t C I V A p p' M y v A p p ' S t o p C I V A p p$ m y V A p p Stops the specified vApp. -------------- Example 2 -------------$ m y V a p p=G e t C I V A p p' M y v A p p ' $ t a s k=$ m y V A p p|S t o p C I V A p pR u n A s y n c Stops the specified vApp asynchronously.
Stop-CIVAppGuest
Synopsis
This cmdlet shuts down the guest operating systems of all virtual machines in the specified vApp. Syntax Stop-CIVAppGuest [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Restart-CIVAppGuest Detailed Description This cmdlet shuts down the guest operating systems of all virtual machines in the specified vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp whose virtual machine guest operating systems you want to shut down. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVApp objects Notes Examples -------------- Example 1 -------------$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' S t o p C I V A p p G u e s t$ m y V A p p Shuts down the guest operating systems of all virtual machines in the specified vApp. -------------- Example 2 --------------
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
275/287
7/8/13
$ m y V A p p=G e t C I V A p pN a m e' M y V A p p ' $ t a s k=$ m y V A p p|S t o p C I V A p p G u e s tR u n A s y n c
Shuts down the guest operating systems of all virtual machines in the specified vApp asynchronously.
Stop-CIVM
Synopsis
This cmdlet powers off the specified virtual machine. Syntax Stop-CIVM [-VM] <CIVM[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVM Restart-CIVM Start-CIVM Suspend-CIVM Detailed Description This cmdlet powers off the specified virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
CIVM[] SwitchParameter
Specifies the virtual machine you want to power off. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVM objects Notes Examples -------------- Example 1 -------------$ m y V M=G e t C I V MN a m e' M y V M ' S t o p C I V M$ m y V M Powers off the specified virtual machine. -------------- Example 2 -------------$ m y V M=G e t C I V MN a m e' M y V M ' $ t a s k=S t o p C I V M$ m y V MR u n A s y n c Powers off the specified virtual machine asynchronously.
Stop-CIVMGuest
Synopsis
This cmdlet shuts down the guest operating system of the specified virtual machine. Syntax Stop-CIVMGuest [-VM] <CIVM[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Restart-CIVMGuest Detailed Description This cmdlet shuts down the guest operating system of the specified virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM
CIVM[]
Specifies the virtual machine whose guest operating system you want to shut down.
true
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
276/287
7/8/13
Confirm SwitchParameter
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVM objects Notes Examples -------------- Example 1 -------------$ m y V M=G e t C I V MN a m e' M y V M ' S t o p C I V M G u e s t$ m y V M Shuts down the guest operating system of the specified virtual machine. -------------- Example 2 -------------$ m y V M=G e t C I V MN a m e' M y V M ' $ t a s k=$ m y V M|S h u t d o w n C I V MR u n A s y n c Shuts down the guest operating system of the specified virtual machine asynchronously.
Stop-Task
Synopsis
This cmdlet stops the specified tasks. Syntax Stop-Task [-Task] <Task[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-Task Wait-Task Detailed Description This cmdlet stops the tasks specified by the Task parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Task Confirm
Task[] SwitchParameter
Specifies the tasks you want to stop. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
WhatIf
SwitchParameter
false
false
Return Type None Notes Examples -------------- Example 1 -------------$ v m=G e t V MN a m e" V M 1 " $ d a t a c e n t e r=G e t D a t a c e n t e rN a m e" D a t a c e n t e r 1 " $ t a s k=N e w T e m p l a t eN a m e" T e m p l a t e 1 "L o c a t i o n$ d a t a c e n t e rV M$ v mR u n A s y n c S t o p T a s kT a s k$ t a s k Stops the process of creating a new template from a virtual machine.
Stop-VApp
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
277/287
7/8/13
Synopsis
This cmdlet stops vApps. Syntax Stop-VApp [-Force] [-VApp] <VApp[]> [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Export-VApp Get-VApp Import-VApp New-VApp Remove-VApp Set-VApp Start-VApp Move-VApp Detailed Description This cmdlet stops vApps. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
VApp[] SwitchParameter
Specifies the vApp that you want to stop. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the virtual machines are powered off regardless of the auto-start configuration of the vApps. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Force RunAsync
SwitchParameter SwitchParameter
false false
false false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more stopped VApp objects Notes Examples -------------- Example 1 -------------G e t V M H o s tM y V M H o s t 1|G e t V A p p|S t o p V A p p Stops all virtual appliances on the specified host.
Stop-VM
Synopsis
This cmdlet powers off virtual machines. Syntax Stop-VM [-Kill] [-RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Move-VM New-VM Remove-VM Set-VM Start-VM Suspend-VM Detailed Description This cmdlet stops the virtual machines specified by the VM parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines you want to power off. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to stop the specified virtual machines by terminating their processes running on the ESX. You can use this parameter to stop a virtual machine that is not responding and cannot be stopped or restarted in other ways. To use the Kill parameter, you need to have a direct connection to ESX 4.1 or later. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console.
true false
Kill
SwitchParameter
false
false
RunAsync
SwitchParameter
false
false
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
278/287
7/8/13
Server VIServer[]
SwitchParameter
false
false
Zero or more powered-off VirtualMachine objects Notes Examples -------------- Example 1 -------------S t o p V MV MV MC o n f i r m Stops the virtual machine named VM after confirmation by the user. -------------- Example 2 -------------S t o p V MV MV MK i l lC o n f i r m : $ f a l s e Stops the virtual machine VM by terminating its process running on the ESX.
Stop-VMHost
Synopsis
This cmdlet powers off the specified hosts. Syntax Stop-VMHost [-VMHost] <VMHost[]> [-Force] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VMHost Get-VMHost Move-VMHost Remove-VMHost Restart-VMHost Start-VMHost Suspend-VMHost Detailed Description This cmdlet powers off the specified hosts. When the cmdlet runs asynchronously (with the RunAsync parameter) and you are connected directly to the host, the returned task object contains no indicator of success. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the hosts you want to power off. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that you want to stop the hosts even if they are not in a maintenance mode. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Force RunAsync
SwitchParameter SwitchParameter
false false
false false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more powered-off VMHost objects Notes Examples -------------- Example 1 -------------S t o p V M H o s t1 0 . 2 3 . 1 1 2 . 2 3 5C o n f i r m Shutdowns the specified host after user confirmation.
Stop-VMHostService
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 279/287
7/8/13
Synopsis
This cmdlet stops the specified host services. Syntax Stop-VMHostService [-HostService] <HostService[]> [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMHostService Start-VMHostService Set-VMHostService Restart-VMHostService Detailed Description This cmdlet stops the host service specified by the Service parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
HostService Confirm
HostService[] SwitchParameter
Specifies the host services you want to stop. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
SwitchParameter
false
false
Zero or more stopped HostService objects Notes Examples -------------- Example 1 -------------S t a r t V M H o s t S e r v i c eS e r v i c e$ v m H o s t S e r v i c e Stops a host service.
Suspend-CIVApp
Synopsis
This cmdlet suspends the specified vApp. Syntax Suspend-CIVApp [-VApp] <CIVApp[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVApp New-CIVApp Remove-CIVApp Restart-CIVApp Set-CIVApp Start-CIVApp Stop-CIVApp Detailed Description This cmdlet suspends the specified vApp. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VApp Confirm
CIVApp[] SwitchParameter
Specifies the vApp you want to suspend. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVApp objects Notes Examples -------------- Example 1 -------------G e t C I V A p pN a m e' M y V A p p '|S u s p e n d C I V A p p Suspends the specified vApp.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
280/287
7/8/13
-------------- Example 2 --------------
Suspend-CIVM
Synopsis
This cmdlet suspends the specified virtual machine. Syntax Suspend-CIVM [-VM] <CIVM[]> [-RunAsync] [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-CIVM Restart-CIVM Start-CIVM Stop-CIVM Detailed Description This cmdlet suspends the specified virtual machine. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VM Confirm
CIVM[] SwitchParameter
Specifies the virtual machine you want to suspend. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. 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. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
CIServer[]
false
false
SwitchParameter
false
false
The specified CIVM objects Notes Examples -------------- Example 1 -------------G e t C I V MN a m e' M y V M '|S u s p e n d C I V M Suspend the specified virtual machine. -------------- Example 2 -------------$ t a s k=( G e t C I V MN a m e' M y V M ' )|S u s p e n d C I V MR u n A s y n c Suspends the specified virtual machine asynchronously.
Suspend-VM
Synopsis
This cmdlet suspends virtual machines. Syntax Suspend-VM [-RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VM Move-VM New-VM Remove-VM Set-VM Start-VM Stop-VM Detailed Description This cmdlet suspends the virtual machines specified by the VM parameter. You can use the suspend feature to make resources available on a short-term basis or for other situations in which you want to put a virtual machine on hold without powering it down. Using wildcards is supported with virtual machine names.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
281/287
7/8/13
Parameters
NA ME TYPE DESCRIPTION
VM Confirm
VirtualMachine[] SwitchParameter
Specifies the virtual machines you want to suspend. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
SwitchParameter
false
false
Zero or more suspended VirtualMachine objects Notes Examples -------------- Example 1 -------------G e t V MV M|S u s p e n d V M Suspends the virtual machine named VM.
Suspend-VMGuest
Synopsis
This cmdlet suspends the specified guest operating systems. Syntax Suspend-VMGuest [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Suspend-VMGuest [[-Guest] <VMGuest[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Get-VMGuest Restart-VMGuest Shutdown-VMGuest Detailed Description This cmdlet issues a command to the specified guest operating system asking it to prepare for a suspend operation. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Guest VM Server
Specifies the guest operating systems you want to suspend. Specifies the virtual machines whose operating systems you want to suspend. The virtual machines must have VMware Tools installed. Specifies the vCenter Server systems 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-VIServer. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
Confirm
SwitchParameter
false
false
$true
WhatIf
SwitchParameter
false
false
Return Type Zero or more suspended VMGuest objects Notes Examples -------------- Example 1 -------------G e t V MV M |S u s p e n d V M G u e s t Suspends the guest OS of the virtual machine named VM.
Suspend-VMHost
Synopsis
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 282/287
7/8/13
This cmdlet suspends hosts. Syntax
Suspend-VMHost [-VMHost] <VMHost[]> [-TimeoutSeconds <Int32>] [-Evacuate] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Online version Add-VMHost Get-VMHost Move-VMHost Remove-VMHost Restart-VMHost Start-VMHost Stop-VMHost Detailed Description This cmdlet puts the specified host machines in standby mode. You can use the suspend feature to make resources available on a short-term basis or for other situations in which you want to put a host on hold without powering it off. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost Confirm
VMHost[] SwitchParameter
Specifies the hosts you want to suspend. If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. If the value is $true, vCenter Server automatically reregisters the virtual machines that are compatible for reregistration. If they are not compatible, they remain on the suspended host. If there are powered-on virtual machines that cannot be reregistered, the operation waits until they are powered off manually. The Evacuate parameter is valid only when connected to a vCenter Server system and the virtual machine host is part of a DRS-enabled cluster. Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. Specifies the vCenter Server systems 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-VIServer. Specifies a time period in seconds to wait for the host to enter standby mode. If the host is not suspended for the specified time, the host is declared timed out, and the task is assumed failed. The default value is 300. Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.
true false
Evacuate
SwitchParameter
false
false
RunAsync
SwitchParameter
false
false
Server
VIServer[]
false
false
TimeoutSeconds
Int32
false
false
300
SwitchParameter
false
false
Zero or more suspended VMHost objects Notes Works only against vCenter Server 4.0 and later. The host should be config ured to support standby mode using Wake-on-Lan or the Intelligent Platform Management Interface Protocol (IPMI) protocol (vCenter Server 4.0). The Evacuate parameter is valid only when the host is a part of a DRS-enabl ed cluster. Examples -------------- Example 1 -------------S u s p e n d V M H o s t1 0 . 2 3 . 1 1 2 . 5 4T i m e O u t S e c o n d s6 0C o n f i r m Suspends the specified host after user confirmation. If the host is not suspended within 60 seconds, the task is reported failed.
Switch-ActiveDeployRuleSet
Synopsis
Activates a rule set. Syntax Switch-ActiveDeployRuleSet [[-DeployRuleSet] <DeployRuleSet>] [<CommonParameters>] Related Commands Get-DeployRuleSet Detailed Description Activates a rule set so that new PXE requests are evaluated through the rule set. By default, the cmdlet activates the working rule set. You must have the "AutoDeploy.RuleSet.Activate" privilege on the root folder of vCenter Server to use this cmdlet. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
DeployRuleSet
false
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
283/287
7/8/13
Test-DeployRuleSetCompliance
Synopsis
Checks whether hosts are compliant with rules. Syntax Test-DeployRuleSetCompliance [-DeployRuleSet <DeployRuleSet>] [-VMHost] <VMHost[]> [<CommonParameters>] Related Commands Get-DeployRuleSet Repair-DeployRuleSetCompliance Detailed Description Checks whether the specified hosts are compliant with a specified rule set. If not rule set is specified, the currently active rule set is used. For example, if a rule specifies a particular host profile should be attached to a host, and a different host profile is actually attached to that host, the host is out of compliance. The output of this cmdlet is a TestResult object that contains the VMHost object and a list containing the current item associated with the host and the expected item, according to the rules. If the list of items is empty, the host is in compliance with the rule set. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VMHost DeployRuleSet
Host to check for compliance. Rule set to use for checking compliance. The active rule set is used by default.
true false
VMware.DeployAutomation.Types.TestResult[] Notes Examples -------------- Example 1 -------------C : \ P S >T e s t D e p l o y R u l e S e t C o m p l i a n c eh 1 Check the compliance of ESXi host "h1" against the active rule set. -------------- Example 2 -------------C : \ P S >G e t V M H o s th 1|T e s t D e p l o y R u l e S e t C o m p l i a n c e Check the compliance of ESXi host "h1" against the active rule set.
Test-VMHostProfileCompliance
Synopsis
This cmdlet tests hosts for profile compliance. Syntax Test-VMHostProfileCompliance [-VMHost] <VMHost[]> [-UseCache] [[-Server] <VIServer[]>] [<CommonParameters>] Test-VMHostProfileCompliance [-Profile] <VMHostProfile[]> [-UseCache] [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version Apply-VMHostProfile Export-VMHostProfile Get-VMHostProfile Import-VMHostProfile New-VMHostProfile Remove-VMHostProfile Set-VMHostProfile Detailed Description This cmdlet tests hosts for profile compliance. The Profile and VMHost parameters cannot be set at the same time. If the Profile parameter is set, the specified host profile is tested for compliance with the hosts, to which it is associated. If the VMHost parameter is specified, the host is tested for compliance with the profiles associated with it. If no profiles are associated with the host, then the profile associated with the cluster is applied. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Profile
VMHostProfile[]
Specifies a host profile against which to test the specified host for compliance with the host to which it is associated. Do not set this parameter if the VMHost parameter is set. Specifies the host you want to test for profile compliance with the profile associated with it. If no profile is associated with it, the host is tested for compliance with the profile associated with the cluster, to which the host belongs. Do not set this parameter if the Profile parameter is set.
true
true (ByValue)
VMHost
VMHost[]
true
true (ByValue)
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
284/287
7/8/13
Server VIServer[]
UseCache
SwitchParameter
false
false
Return Type Zero or more VMHostProfileIncompliance objects Notes Examples -------------- Example 2 -------------T e s t V M H o s t P r o f i l e C o m p l i a n c eV M H o s tH o s t Tests the specified host for compliance with the profiles associated with it. -------------- Example 3 -------------$ p r o f i l e=G e t V M H o s t P r o f i l eN a m eP r o f i l e A p p l y V M H o s t P r o f i l eA s s o c i a t e O n l yP r o f i l e$ p r o f i l eE n t i t y1 0 . 0 . 0 . 1 2 6 T e s t V M H o s t P r o f i l e C o m p l i a n c eV M H o s t1 0 . 0 . 0 . 1 2 6|f l* Test the profile compliance of a non-compliant virtual machine host associated with the profile. -------------- Example 4 -------------T e s t V M H o s t P r o f i l e C o m p l i a n c eP r o f i l e$ p r o f i l e|f l* Test the profile compliance of a virtual machine host profile with the hosts it is associated with.
Test-VMHostSnmp
Synopsis
This cmdlet tests the host SNMP. Syntax Test-VMHostSnmp [-HostSnmp] <VmHostSnmp[]> [<CommonParameters>] Related Commands Online version Get-VMHostSNMP Set-VMHostSNMP Detailed Description This cmdlet tests the host SNMP specified by the HostSNMP parameter. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
VmHostSnmp[]
true
true (ByValue)
Zero or more VmHostSnmp objects Notes Examples -------------- Example 1 -------------T e s t V M H o s t S N M PH o s t S N M P( G e t V M H o s t S N M P ) Retrieves and tests the SNMP of the default server.
Update-Tools
Synopsis
This cmdlet upgrades VMware Tools on the specified virtual machine guest OS. Syntax Update-Tools [-NoReboot] [-RunAsync] [[-Guest] <VMGuest[]>] [<CommonParameters>] Update-Tools [-NoReboot] [-RunAsync] [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [<CommonParameters>] Related Commands Online version
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
285/287
7/8/13
Mount-Tools Dismount-Tools Wait-Tools Detailed Description
This cmdlet upgrades the VMware Tools on the specified virtual machine guest OS. VMware Tools must be installed prior to updating it. After VMware Tools is updated, the virtual machine is restarted unless the NoReboot parameter is specified. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Guest VM Server
Specifies the guest operating systems on which you want to update VMware Tools. Specifies a list of the virtual machines whose VMware Tools you want to upgrade. Specifies the vCenter Server systems 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-VIServer. Indicates that you do not want to reboot the system after updating VMware Tools. This parameter is supported only for Windows operating systems. NoReboot passes the following set of options to the VMware Tools installer on the guest OS: /s /v"/qn REBOOT=ReallySuppress? However, the virtual machine might still reboot after updating VMware Tools, depending on the currently installed VMware Tools version, the VMware Tools version to which you want to upgrade, and the vCenter Center/ESX versions.
NoReboot
SwitchParameter
false
false
RunAsync
SwitchParameter
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console.
false
false
Return Type None Notes On non-Windows operating systems, Update-Tools might not be able to perform automatic upgrade of VMware Tools. In such cases, the cmdlet only mounts t he VMware Tools installation drive and you must do the upgrade manually. Examples -------------- Example 1 -------------U p d a t e T o o l sV M Updates the VMware Tools on the specified virtual machine. The virtual machine must be powered on. -------------- Example 2 -------------G e t V M G u e s tV M|U p d a t e T o o l s Updates the VMware Tools on the virtual machine specified by its guest operating system. The virtual machine must be powered on.
Wait-Task
Synopsis
This cmdlet waits for the completion of the specified tasks. Syntax Wait-Task [-Task] <Task[]> [<CommonParameters>] Related Commands Online version Get-Task Stop-Task Detailed Description This cmdlet waits for the specified tasks to complete or fail before allowing the next command input. The task progress is observed in real time on the console screen. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Task
Task[]
true
true (ByValue)
Return Type The output of the operation specified by the Task parameter Notes Examples -------------- Example 1 -------------$ t a s k=R e m o v e V MV MV MC o n f i r mR u n A s y n c W a i t T a s kT a s k$ t a s k Waits for the virtual machine to be removed before allowing the next command input.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
286/287
7/8/13
Copyright 1998 - 2013 VMware, Inc. All rights reserved.
Wait-Tools
Synopsis
This cmdlet waits for VMware Tools on the specified virtual machines to load. Syntax Wait-Tools [-VM] <VirtualMachine[]> [[-TimeoutSeconds] <Int32>] [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [-Server <VIServer[]>] [<CommonParameters>] Wait-Tools [[-TimeoutSeconds] <Int32>] [-HostCredential <PSCredential>] [-HostUser <String>] [-HostPassword <SecureString>] [-Guest] <VMGuest[]> [<CommonParameters>] Related Commands Online version Mount-Tools Dismount-Tools Update-Tools Detailed Description This cmdlet waits for VMware Tools of the specified virtual machines to load. The cmdlet returns the virtual machines or guests on which VMware Tools have loaded successfully within the specified time limits. You can cancel the operation before completion using Ctrl+C. The successful completion of Wait-Tools means that VMware Tools have loaded, but it does not guarantee for the start of other services. Updating the returned VMGuest objects requires additional communication with VMware Tools and some of their properties (OSFullName, IPAddress, HostName, and other) might be still empty right after the completion of Wait-Tools. Parameters
NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE
Specifies the time period in seconds to wait for VMware Tools to start before cancelling the operation. Specifies the guest operating systems for which you want to wait VMware Tools to load. Specifies the virtual machines for which you want to wait VMware Tools to load. Specifies credentials for authenticating with the ESX/ESXi host of the specified virtual machine. This parameter is needed only if you have authenticated with vCenter Server via SSPI. If SSPI is not used, the credentials for authentication with vCenter Server are used. Specifies a password for authenticating with the ESX host of the specified virtual machine. This parameter is needed only if you have authenticated with the vCenter Server via SSPI. If no SSPI is used, the password for authentication with vCenter Server is used. Specifies a username for authenticating with the ESX/ESXi host of the specified virtual machine. This parameter is needed only if you have authenticated with vCenter Server via SSPI. If SSPI is not used, the username for authentication with vCenter Server is used. Specifies the vCenter Server systems 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-VIServer.
HostPassword
SecureString
false
false
HostUser
String
false
false
Server
VIServer[]
false
false
Return Type Zero or more VirtualMachine or VMGuest objects Notes Examples -------------- Example 1 -------------$ v m=S t a r t V MV M *|W a i t T o o l s Starts the virtual machines with names starting with VM and Waits for their VMware Tools to load. -------------- Example 2 -------------W a i t T o o l sV M$ v mT i m e o u t S e c o n d s1 8 0 Waits for the VMware Tools of the virtual machines in the $vm variable to start. If VMware Tools do not load after 180 seconds, the operation is aborted. -------------- Example 3 -------------W a i t T o o l sV MV M *T i m e o u t S e c o n d s1 2 0H o s t C r e d e n t i a l$ v m h o s t C r e d e n t i a l Waits for the VMware Tools of the virtual machines in the $vm variable to start. If VMware Tools do not load after 120 seconds, the operation is aborted. Host credentials are required when you run the cmdlet on environments older than vSphere 4.0. -------------- Example 4 -------------R e s t a r t V M G u e s tW i n d o w s X P|W a i t T o o l s Restart the guest operating system WindowsXP and waits for the VMware Tools to load.
pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0
287/287