Documente Academic
Documente Profesional
Documente Cultură
0
Network Operations
Get-iScsiHbaTarget New-iScsiHbaTarget Remove-iScsiHbaTarget Set-iScsiHbaTarget Get-NicTeamingPolicy Set-NicTeamingPolicy Get-OSCustomizationNicMapping New-OSCustomizationNicMapping Remove-OSCustomizationNicMapping Set-OSCustomizationNicMapping Get-ScsiController New-ScsiController Set-ScsiController Get-ScsiLun Set-ScsiLun Get-ScsiLunPath Set-ScsiLunPath Get-VirtualPortGroup New-VirtualPortGroup Remove-VirtualPortGroup Set-VirtualPortGroup Get-VirtualSwitch New-VirtualSwitch Remove-VirtualSwitch Set-VirtualSwitch Get-VMGuestNetworkInterface Set-VMGuestNetworkInterface Get-VMGuestRoute New-VMGuestRoute Remove-VMGuestRoute Get-VMHostFirewallDefaultPolicy Set-VMHostFirewallDefaultPolicy Get-VMHostFirewallException Set-VMHostFirewallException Get-VMHostHba Set-VMHostHba Get-VMHostNetwork Set-VMHostNetwork Get-VMHostNetworkAdapter New-VMHostNetworkAdapter Remove-VMHostNetworkAdapter Set-VMHostNetworkAdapter Add-VmHostNtpServer Get-VMHostNtpServer Remove-VMHostNtpServer Test-VMHostSnmp Get-VMHostSnmp Set-VMHostSnmp
Logs/Reporting/Conguration
Get-ErrorReport Get-Log Get-LogType Get-OSCustomizationSpec New-OSCustomizationSpec Remove-OSCustomizationSpec Set-OSCustomizationSpec Get-Stat Get-StatInterval New-StatInterval Remove-StatInterval Set-StatInterval Get-StatType Get-VICredentialStoreItem New-VICredentialStoreItem Remove-VICredentialStoreItem Get-VMHostSysLogServer Set-VMHostSysLogServer Get-VMResourceConguration Get-VIEvent Get-VIProperty New-VIProperty
vCloud Operations
Connect-Cloud Disconnect-Cloud Search-Cloud Get-CloudCatalog Get-CloudExternalNetwork Get-CloudUserGroup Get-CloudMedia Get-CloudNetworkPool Get-CloudOrganization Get-CloudOrganizationNetwork Get-CloudOrganizationVDC Get-CloudProviderVDC Get-CloudUserRole Get-CloudUser Import-CloudVAppTemplate Get-CloudVAppTemplate Get-CloudVApp Import-CloudVApp Get-CloudView Get-ViewByCloudView Get-CloudVM
vApps
Export-vApp Get-vApp Import-vApp Move-Vapp New-vApp Remove-vApp Set-vApp Start-vApp Stop-vApp
Host Proles
Apply-VMHostProle Export-VMHostProle Get-VMHostProle Import-VMHostProle New-VMHostProle Remove-VMHostProle Set-VMHostProle Test-VMHostProleCompliance
vSphere
vCloud
Licensing
Update Manager
Guest OS
Dismount-Tools Mount-Tools Update-Tools Wait-Tools Get-VMGuest Restart-VMGuest Shutdown-VMGuest Suspend-VMGuest Copy-VMGuestFile Get-VMGuestNetworkInterface Set-VMGuestNetworkInterface Get-VMGuestRoute New-VMGuestRoute Remove-VMGuestRoute Invoke-VMScript
Datacenter Operations
Get-Datacenter Move-Datacenter New-Datacenter Remove-Datacenter Set-Datacenter
Cluster Operations
Get-Cluster Get-DatastoreCluster Move-Cluster New-Cluster Remove-Cluster Set-Cluster
Image Builder
Auto Deploy
PowerCLI
View
PowerShell
VMware vSphere Server
Get-AdvancedSetting New-AdvancedSetting Remove-AdvancedSetting Set-AdvancedSetting Get-AlarmAction New-AlarmAction Remove-AlarmAction Get-AlarmActionTrigger New-AlarmActionTrigger Remove-AlarmActionTrigger Get-AlarmDenition Set-AlarmDenition Get-Annotation Set-Annotation Get-CustomAttribute New-CustomAttribute Remove-CustomAttribute Set-CustomAttribute New-Datastore Remove-Datastore Get-Datastore Set-Datastore Copy-DatastoreItem Apply-DrsRecommendation Get-DrsRecommendation Get-DrsRule New-DrsRule Remove-DrsRule Set-DrsRule Get-EsxCli Get-EsxTop Move-Folder New-Folder Get-Folder Remove-Folder Set-Folder Get-Inventory Move-Inventory Remove-Inventory Get-NetworkAdapter Get-Task Stop-Task Wait-Task Get-VIAccount Get-View Get-VIObjectByVIView Get-VIPermission New-VIPermission Remove-VIPermission Set-VIPermission Get-VIPrivilege New-VIProperty Remove-VIProperty Get-VIRole New-VIRole Remove-VIRole Set-VIRole Connect-VIServer Disconnect-VIServer
Host Operations
Get-CDDrive New-HardDisk New-Snapshot Get-VM Get-VMQuestion New-CDDrive Remove-HardDisk Remove-Snapshot Move-VM Set-VMQuestion Remove-CDDrive Set-HardDisk Set-Snapshot New-VM Get-VMResourceConguration Set-CDDrive New-NetworkAdapter Get-Template Restart-VM Set-VMResourceConguration Get-FloppyDrive Remove-NetworkAdapter Move-Template Remove-VM Get-VMStartPolicy New-FloppyDrive Set-NetworkAdapter New-Template Set-VM Set-VMStartPolicy Remove-FloppyDrive Add-PassthroughDevice Remove-Template Start-VM Set-FloppyDrive Get-PassthroughDevice Set-Template Stop-VM Copy-HardDisk Remove-PassthroughDevice Get-UsbDevice Suspend-VM Get-HardDisk Get-Snapshot Remove-UsbDevice
Get-HAPrimaryVMHost Set-VMHost Add-VMHost Start-VMHost Get-VMHost Stop-VMHost Move-VMHost Suspend-VMHost Remove-VMHost Get-VMHostAccount Restart-VMHost New-VMHostAccount Set-VMHostAccount Remove-VMHostAccount Get-VMHostAdvancedConguration Set-VMHostAdvancedConguration Get-VMHostAuthentication Set-VMHostAuthentication Get-VMHostAvailableTimeZone Get-VMHostDiagnosticPartition Set-VMHostDiagnosticPartition Get-VMHostDisk Format-VMHostDiskPartition Get-VMHostDiskPartition Get-VMHostFirmware Set-VMHostFirmware Get-VMHostModule Set-VMHostModule Get-VMHostPatch Install-VMHostPatch Get-VMHostProleRequiredInput Get-VMHostRoute New-VMHostRoute Remove-VMHostRoute Set-VMHostRoute Get-VMHostService Restart-VMHostService Set-VMHostService Start-VMHostService Stop-VMHostService Get-VMHostStorage Set-VMHostStorage Get-VMHostStartPolicy Set-VMHostStartPolicy Get-VMHostSysLogServer Set-VMHostSysLogServer
VMware vSphere PowerCLI is a powerful, easy-to-use scripting interface to manage the vSphere platform. Administrators can leverage more than 320 commandlets to simplify everyday tasks. For latest documentation, sample code, and information, visit: http://vmware.com/go/powercli O cial VMware PowerCLI Blog: http://blogs.vmware.com/vipowershell
PowerCLI Settings
Get-ErrorReport Get-PowerCLICommunity Get-PowerCLIConguration Set-PowerCLIConguration Get-PowerCLIDocumentation Get-PowerCLIVersion
PowerCLI Books
Automating vSphere Administration ISBN-10: 0470890797 vSphere 4.0 Quick Start Guide ISBN-10: 1439263450 Managing VMware Infrastructure with Windows PowerShell ISBN-10: 0982131402
Licensing Operations
Get-LicenseDataManager
Resources
For more information and help with the VMware vSphere PowerCLI, use the following cmdlets: Get-PowerCLICommunity Get-PowerCLIHelp Get-VICommand http://virtu-al.net http://www.lucd.info http://get-scripting.blogspot.com
VMware scripting support - http://vmware.com/go/sdksupport vSphere PowerCLI training - http://vmware.com/go/vsphereautomation Third-party PowerCLI training from Trainsignal: http://trainsignal.com Special thanks to our PowerCLI VIP community members for helping us improve PowerCLI.
Task Information
To list all tasks for a VMware vSphere server and some of their properties: Get-Task -Server (Connect-VIServer -Server 192.168.0.10) -Status Error To stop a task (example: stops the task of removing the VM): Stop-Task -Task (Remove-VM -VM "MS Win XP SP2" -Confirm -RunAsync) To wait until a task is completed before continuing: Wait-Task -Task (Remove-VM -VM "MS Win XP SP2" -Confirm -RunAsync)
Getting Started
http://communities.vmware.com/docs/DOC-13700 VMware vSphere PowerCLI frequently asked questions (FAQs) link: http://communities.vmware.com/docs/DOC-13700 To nd out what cmdlets are available: Get-VICommand To show documentation for all available cmdlets: Get-PowerCLIDocumentation For help with a cmdlet: Get-Help cmdlet-name Full | More
O cial vSphere PowerCLI Training latest course information. All courses subject to change without notice. http://vmware.com/go/vsphereautomation.
Argentina 05 Sep 11 GTM -3 / Licencias On Line - Argentina Australia 22 Aug 11 Canberra ACT / VMware Training Australia 29 Sep 11 Melbourne VIC / VMware Training Australia Austria 16 Aug 11 Wien / Magirus - Austria 29 Sep 11 Wien / Magirus - Austria 21 Nov 11 Wien / Magirus - Austria China 05 Sep 11 Shanghai / Bestcom - China Costa Rica 05 Sep 11 Live Online / Adistec - Costa Rica Czech Republic 28 Nov 11 Prague / Arrow ECS a.s. Czech Republic Denmark 24 Oct 11 Ballerup / Arrow ECS Denmark 10 Nov 11 Magirus - Herlev / Magirus - Denmark France 19 Sep 11 RUEIL-MALMAISON / Global Knowledge - France 29 Sep 11 Nanterre / Magirus - France 04 Oct 11 Paris / IB Groupe Cegos - France 10 Oct 11 Paris / Amosdec - France 13 Oct 11 Nanterre / Magirus - France 28 Nov 11 RUEIL-MALMAISON / Global Knowledge - France 08 Dec 11 Nanterre / Magirus - France 19 Dec 11 Paris / Amosdec - France 19 Dec 11 Paris / Amosdec - France Germany 01 Sep 11 Frankfurt / Fast Lane - GY 07 Sep 11 Berlin / AddOn - GY 07 Sep 11 Bblingen / AddOn - GY 07 Sep 11 Walldorf / AddOn - GY 07 Sep 11 Unterschleiheim / AddOn - GY 07 Sep 11 Kln / AddOn - GY 07 Sep 11 Dresden / AddOn - GY 08 Sep 11 Bblingen / AddOn - GY 08 Sep 11 Walldorf / AddOn - GY 08 Sep 11 Unterschleiheim / AddOn - GY 08 Sep 11 Kln / AddOn - GY 21 Sep 11 Berlin / Fast Lane - GY 04 Oct 11 Frankfurt / Tech Data Azlan - GY 04 Oct 11 Dusseldorf / Fast Lane - GY 27 Oct 11 Hallbergmoos / Fast Lane - GY 27 Oct 11 Hallbergmoos / Fast Lane - GY 02 Nov 11 Mnchen / Knowledge - GY 08 Nov 11 Hamburg / Fast Lane - GY 16 Nov 11 Berlin / AddOn - GY 16 Nov 11 Bblingen / AddOn - GY 16 Nov 11 Walldorf / AddOn - GY 16 Nov 11 Unterschleiheim / AddOn - GY 16 Nov 11 Kln / AddOn - GY 16 Nov 11 Dresden / AddOn - GY 17 Nov 11 Bblingen / AddOn - GY 17 Nov 11 Walldorf / AddOn - GY 17 Nov 11 Unterschleiheim / AddOn - GY 17 Nov 11 Kln / AddOn - GY 29 Nov 11 Stuttgart / Fast Lane - GY 13 Dec 11 Frankfurt / Fast Lane - GY 19 Dec 11 Hamburg / Global Knowledge - GY 26 Jan 12 Bblingen / AddOn - GY 26 Jan 12 Walldorf / AddOn - GY 26 Jan 12 Unterschleiheim / AddOn - GY 26 Jan 12 Kln / AddOn - GY 26 Mar 12 Bblingen / AddOn - GY 26 Mar 12 Walldorf / AddOn - GY 26 Mar 12 Unterschleiheim / AddOn - GY 26 Mar 12 Kln / AddOn - GY 29 May 12 Bblingen /AddOn - GY 29 May 12 Walldorf / AddOn - GY 29 May 12 Unterschleiheim / AddOn - GY 29 May 12 Kln / AddOn - GY 05 Jul 12 Bblingen / AddOn - GY 05 Jul 12 Walldorf / AddOn - GY 05 Jul 12 Unterschleiheim / AddOn - GY 05 Jul 12 Kln / AddOn - GY 13 Sep 12 Bblingen / AddOn - GY 13 Sep 12 Walldorf / AddOn - GY 13 Sep 12 Unterschleiheim / AddOn - GY 13 Sep 12 Kln / AddOn - GY 25 Oct 12 Bblingen / AddOn - GY 25 Oct 12 Walldorf / AddOn - GY 25 Oct 12 Unterschleiheim / AddOn - GY 25 Oct 12 Kln / AddOn - GY 06 Dec 12 Bblingen / AddOn - GY 06 Dec 12 Walldorf / AddOn - GY 06 Dec 12 Unterschleiheim / AddOn - GY 06 Dec 12 Kln / AddOn - GY Hong Kong 29 Aug 11 Hong Kong / Kenl - Hong Kong Hungary 20 Oct 11 Budapest / Szamalk Ltd - Hungary 15 Dec 11 Budapest / Szamalk Ltd - Hungary India 12 Sep 11 New Delhi / Koenig Solutions Private Limited Israel 23 Oct 11 Hertzelia / Hi-Tech College - Israel Japan 05 Sep 11 Tokyo / HP Education - Japan Norway 08 Sep 11 Oslo / Global Knowledge - Norway 26 Sep 11 Oslo / Arrow ECS Norway AS - Norway 13 Oct 11 Oslo / Global Knowledge - Norway 17 Nov 11 Oslo / Global Knowledge - Norway 28 Nov 11 Oslo / Arrow ECS Norway AS - Norway 08 Dec 11 Oslo / Global Knowledge - Norway 26 Jan 12 Oslo / Global Knowledge - Norway Poland 01 Sep 11 Krakow / Arrow ECS Services Sp. z.o.o. - Poland Spain 14 Sep 11 Madrid / Ana - Iberia 28 Sep 11 Barcelona / Ana - Iberia 18 Oct 11 Madrid / Ana - Iberia 16 Nov 11 Madrid / Ana - Iberia 21 Nov 11 Madrid / Ana - Iberia 24 Nov 11 Barcelona / Ana - Iberia Sweden 19 Dec 11 Kista / Arrow ECS Sweden AB Switzerland 17 Oct 11 Luzern / Digicomp - CH 17 Oct 11 Zrich / Digicomp - CH 17 Oct 11 St. Gallen / Digicomp - CH 17 Oct 11 Bern / Digicomp - CH The Netherlands 12 Sep 11 Gouda / XTG - NL 20 Sep 11 Nieuwegein / Global Knowledge - NL United Kingdom 30 Aug 11 Leeds / QA-IQ Ltd 30 Aug 11 London EC2N / Global Knowledge Network Training Limited - UK 22 Sep 11 London / QA-IQ Ltd 29 Sep 11 Hampshire RG27 / HP Education - UK 07 Nov 11 Bracknell Berks / Magirus - UK 17 Nov 11 London / QA-IQ Ltd 24 Nov 11 Leeds / QA-IQ Ltd 08 Dec 11 Hampshire RG27 / HP Education - UK United States 14 Sep 11 Live Online (MST) / HP Education United States 14 Dec 11 Live Online (MST) / HP Education United States
# View the elds available for vCPU counter: (Get-EsxTop Counter CounterName VCPU).Fields Get-EsxTop TopologyInfo # View the entries of a specic topology: (Get-EsxTop TopologyInfo Topology SchedGroup).Entries | Format-Table # Retrieve the counter values for VCPU and SchedGroup" counters: Get-EsxTop CounterName VCPU | Format-Table * -AutoSize Get-EsxTop CounterName SchedGroup | Format-Table * -AutoSize
Snapshot Operations
To list all the snapshots for all virtual machines: Get-VM | Get-Snapshot To snapshot a VM: New-Snapshot -VM "XP SP2" -Name BeforePatch1 To remove a snapshot: Remove-Snapshot -Snapshot $snapshot1 RemoveChildren Other cmdlets include: Set-Snapshot
Cluster Operations
To list all the clusters on the connected VMware vSphere server and some of their properties: Get-Cluster To add a new cluster: New-Cluster -Name MyCluster -DRSEnabled -DRSMode FullyAutomated Other cluster cmdlets include: Move-Cluster Remove-Cluster Set-Cluster
Security Operations
The following is a list of security cmdlets; use the Get-Help function for example uses: Get-VIPermission -Entity (Get-Datacenter) -Principal Administrator Other security cmdlets: New-VIPermission Remove-VIPermission Set-VIPermission Get-VIPrivilege Get-VIRole New-VIRole Remove-VIRole Set-VIRole
Folder Operations
The following is a list of all folderrelated cmdlets; use the Get-Help function for example uses: Get-Folder Move-Folder New-Folder Remove-Folder Set-Folder
API Operations
Returns a VMware vSphere.Net view object by specied search criteria. $vm = Get-View -ViewType VirtualMachine -Filter @{"Name" = "MS Win XP SP2"} $hostView = Get-View -ID $vm.Runtime.Host $hostView.Summary.Runtime Another example: (Get-View (Get-VMHost 'ESX1' | get-view).ConfigManager .VmotionSystem).SelectVnc('vmk0') API Reference: http://www.vmware.com/support/developer/vcsdk/visdk41pubs/ ApiReference/index.html
DRS Rules
Retrieve a list of DRS rules for the specied clusters: Get-DrsRule -Cluster (Get-Cluster Production) Other DRS rule cmdlets: New-DrsRule Remove-DrsRule Set-DrsRule
For a list of datastores and other properties: Get-Datastore Other datastore cmdlets include: New-Datastore Remove-Datastore Set-Datastore
New-ResourcePool -Location $clusterRootRP -Name DevelopmentResources -CpuExpandableReservation $true -CpuReservationMhz 500 -CpuSharesLevel high -MemExpandableReservation $true -MemReservationMB 500 -MemSharesLevel high Other resource pool cmdlets: Move-ResourcePool Remove-ResourcePool Set-ResourcePool
vApp Operations
The following is a list of vApp cmdlets; use the Get-Help function for example uses: New-vApp -Name MyvApp -CpuLimitMhz 4000 -CpuReservationMhz 1000 -Location (Get-VMHost MyHost) Other vApp cmdlets: Export-vApp Get-vApp Import-vApp Remove-vApp Stop-vApp Set-vApp Start-vApp