User Tools

Site Tools


os:esxi:powercli

This is an old revision of the document!


ESXi - PowerCLI

Connect

more in this VMware PowerCLI Blog post

Components used in the following examples:

  • Windows with installed vCenter Server: myWinvCenter01
  • vCenter deployed as VCSA: myVCSA01
  • User in vCenter to connect with: myvCenterUser
  • Related user password: myvCenterPassword

Windows vCenter Server

Add-PSsnapin VMware.VimAutomation.Core
Connect-VIServer myWinvCenter01
#...
Disconnect-VIServer -Force -Confirm:$false

vCenter Server Appliance

Credentials have to be stored once per Windows User:

New-VICredentialStoreItem -Host myVCSA01 -User myvCenterUser -Password myvCenterPassword
Add-PSsnapin VMware.VimAutomation.Core
Connect-VIServer -Server myVCSA01 -User myvCenterUser
#...
Disconnect-VIServer -Force -Confirm:$false

Hardware-Info

Show physical disks on HP hosts

(Get-EsxCli -VMHost myVMHost).hpssacli.cmd("ctrl slot=0 pd all show")

Host Services

SSH (TSM-SSH) is used in the following examples on host myHost.

Start

Start-VMHostService -HostService (Get-VMHost myHost | Get-VMHostService | Where { $_.Key -eq "TSM-SSH" } )

Stop

Stop-VMHostService -HostService (Get-VMHost myHost | Get-VMHostService | Where { $_.Key -eq "TSM-SSH" } ) -Confirm:$false

Status

Get-VMHost myHost | Get-VMHostService | Where { $_.Key -eq "TSM-SSH" }
os/esxi/powercli.1441288382.txt.gz · Last modified: 2015-09-03 15:53 by root