Skip to content

Instantly share code, notes, and snippets.

@HostileCoding
Created May 29, 2014 08:44
Show Gist options
  • Select an option

  • Save HostileCoding/a0161711803ee0077c79 to your computer and use it in GitHub Desktop.

Select an option

Save HostileCoding/a0161711803ee0077c79 to your computer and use it in GitHub Desktop.
#Variable declaration
$vCenterIPorFQDN="192.168.243.172"
$vCenterUsername="[email protected]"
$vCenterPassword="vmware"
$destination = "C:\Users\Paolo\Desktop" #Location where to download support bundles
Write-Host "Connecting to vCenter" -foregroundcolor "magenta"
Connect-VIServer -Server $vCenterIPorFQDN -User $vCenterUsername -Password $vCenterPassword
$hosts = Get-VMHost #Retrieve all hosts from vCenter
Write-Host "Downloading vCenter support bundle" -foregroundcolor "magenta"
Get-Log -Bundle -DestinationPath $destination
foreach ($esxihost in $hosts){
Write-Host "Downloading support bundle for ESXi host $($esxihost.Name)" -foregroundcolor "magenta"
Get-Log -VMHost (Get-VMHost -Name $esxihost.Name) -Bundle -DestinationPath $destination
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment