This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Backup-VMHost { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory=$True)] | |
| [string[]]$VMHost, | |
| [Parameter(Mandatory=$True)] | |
| [string]$FilePath | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Variable declaration | |
| $vCenterIPorFQDN="192.168.243.172" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Variable declaration | |
| $hosts=@("192.168.243.144","10.0.1.62") #ESXi hosts to download support bundles from | |
| $username="root" #ESXi host username | |
| $password="vmware" #ESXi host password | |
| $destination = "C:\Users\Paolo\Desktop" #Location where to download support bundles | |
| [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #Ignore SSL certificate validation | |
| foreach ($element in $hosts){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Variable declaration | |
| $vCenterIPorFQDN="192.168.243.172" | |
| $vCenterUsername="Administrator@vsphere.local" | |
| $vCenterPassword="vmware" | |
| $OutputFile="C:\Inetpub\wwwroot\mywebsite\feed.xml" #Where you want to place generated report | |
| Remove-Item $OutputFile #Delete files from previous runs | |
| Write-Host "Connecting to vCenter" -foregroundcolor "magenta" |
OlderNewer