When VMware released vSphere they also released what VMware is calling The VMware vSphere PowerCLI. This is an update and rename of the VMware VI Toolkit. With this release, VMware has added 39 new and 15 updated cmdlets that will make our life, as an administrator, easier going forward. I have installed the new PowerCLI and have it working great in my vWire lab. I look forward utilizing the capabilities of the new cmdlets. Coming up in my next blog post I will present one of the new cmdlets, as an example, to set the time servers on the VMware ESX / ESXi hosts but first wanted to make sure everyone knew that there was a new version out there and that they should check it out as soon they get a chance. If you are curious what is new and what has been enhanced I have pulled the info from the release notes and posted it below.
| Cmdlet Name | Description |
| Add-VMHostNtpServer | 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. |
| Apply-VMHostProfile | Applies a virtual machine host profile to the specified entity. If the Profile parameter is not set, then the profile associated with the virtual machine host or cluster is applied. |
| Export-VMHostProfile | Exports the specified virtual machine host profile to a file. If the Force parameter is not specified and the destination file exists or the target parent directory does not exist, a terminating error is generated. If the Force parameter is specified, the existing destination file is overwritten and directories to complete the specified file path are created. |
| Get-DrsRule | 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). |
| Get-ScsiLun | Retrieves SCSI devices from the specified virtual machine hosts. Examples of SCSI logical unit objects include disks which might 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. |
| Get-ScsiLunPath | Retrieves the list of vmhba paths to a specified SCSI device. |
| Get-StatInterval | Retrieves the available statistics intervals and filters them using the provided parameters. |
| Get-StatType | Retrieves the available statistics types for a given inventory object. The inventory object must be 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. |
| Get-VICredentialStoreItem | Retrieves 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 no of the Host and User parameters are specified, all available credential store items are returned. If they are specified and do not contain 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. |
| Get-VMHostAdvancedConfiguration | Retrieves the advanced configuration of the specified virtual machine host. For each of the specified hosts, returns a hash table mapping setting names to setting values. |
| Get-VMHostDiagnosticPartition | Retrieves a list of diagnostic partitions for the specified virtual machine hosts. The server provides the list in order of preference. In general, local diagnostic partitions are better than shared diagnostic partitions because of the impossibility of multiple servers sharing the same partition. The most preferred diagnostic partition will be first in the array. |
| Get-VMHostFirewallDefaultPolicy | Gets the firewall default policy for the specified virtual machine hosts. Shows whether the outgoing and incoming connections are allowed. |
| Get-VMHostFirewallException | Retrieves the firewall exceptions of the hosts. The exceptions can be filtered using the VMHost, Name, Port, and Enabled parameters. |
| Get-VMHostNtpServer | Retrieves the NTP servers of the specified virtual machine hosts. |
| Get-VMHostProfile | Retrieves a virtual machine host profile. |
| Get-VMHostSysLogServer | Displays the remote syslog servers of the specified hosts. |
| Get-VMResourceConfiguration | Retrieves information about resource allocation between the virtual machines. |
| Invoke-VMScript | Runs the specified PowerShell script in the guest OS of each of the specified virtual machines. The virtual machines must be powered on and have PowerShell and VMware Tools installed. In order to authenticate with the host or the guest OS, one of the HostUser/HostPassword (GuestUser/GuestPassword) pair and HostCredential (GuestCredential) parameters must be provided. |
| New-DrsRule | 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). |
| New-StatInterval | Creates a statistics interval with the specified parameters. |
| New-VICredentialStoreItem | 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. The credential store is not designed to be a secure password repository. Although the passwords added to the credential store are obfuscated, they can be recovered by anyone who can access the credential store file. By default, only the user who has created the credential store file has rights to read it. |
| New-VMHostProfile | 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. The credential store is not designed to be a secure password repository. Although the passwords added to the credential store are obfuscated, they can be recovered by anyone who can access the credential store file. By default, only the user who has created the credential store file has rights to read it. |
| Remove-DrsRule | Removes the specified DRS rules. |
| Remove-StatInterval | Removes the statistics interval specified by the provided sampling period or name. |
| Remove-VICredentialStoreItem | Removes credential store items that match the specified Host and User filters. Both Host and User parameters accept wildcards. At least one of the Host and User parameters must be must be given values or a terminating error is reported. To remove all passwords, call Remove-VICredentialStoreItem *, which is a wildcard matching all hosts. |
| Remove-VMHostNtpServer | Removes the specified NTP servers from the NTP server list of the specified hosts. |
| Remove-VMHostProfile | Removes the specified virtual machine host profile. If the Entity parameter is set, the cmdlet removes the profile association for the specified entity. Otherwise, it removes the profile object. |
| Set-DrsRule | Modifies an existing DRS rule. Each rule defines the virtual machines that can run on the same host (affinity) or must run on different hosts (anti-affinity). |
| Set-ScsiLun | Configures a SCSI device. |
| Set-ScsiLunPath | Configures a vmhba path to a SCSI device. |
| Set-StatInterval | Updates the statistics interval specified by the provided parameters. |
| Set-VMHostAdvancedConfiguration | Updates the advanced configuration settings of the virtual machine hosts. |
| Set-VMHostDiagnosticPartition | Activates or deactivates the diagnostic partitions of virtual machine hosts. |
| Set-VMHostFirewallDefaultPolicy | Sets the default policy for the specified virtual machine host firewall. Specifies whether outgoing or incoming connections are allowed. At least one of the AllowIncoming and AllowOutgoing parameters must be given values. |
| Set-VMHostFirewallException | Enables or disables virtual machine host firewall exceptions. |
| Set-VMHostProfile | Modifies the specified virtual machine host profiles. |
| Set-VMHostSysLogServer | Configures the remote syslog server of the specified hosts. |
| Set-VMResourceConfiguration | 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 as a value. |
| Test-VMHostProfileCompliance | Tests virtual machine 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 virtual machine 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 to the host, then the profile associated with the cluster is applied. |
Until next time Happy Scripting!!
PowerCLI, powershell, vmware, vSphere, vWire
Previous Post
vWire Developer Videos Are Here!
Next Post
vWire Passed it Stress Test
This entry was posted on Tuesday, June 16th, 2009 at 9:40 am and is filed under Virtual Tech. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.







June 16th, 2009 12:48 pm
Nice post Steve, really usefull !
June 16th, 2009 12:50 pm
Thanks!!
June 19th, 2009 6:24 am
As someone who has been getting into PowerShell scripting lately, I welcome these new updates. Very useful for automation. Thanks!
June 29th, 2009 3:50 pm
Hi and thanks,
But anyone knows how get files remothly (Download files from ESX Server to Windows Server ie.) with PowerCLI?
Thks,