Connect to a vcenter server
- Connect your vsphere client
- Open PowerCLI
-
Connect-VIServer -Server [servername] -Protocol https -User [username] -Password [password]
Retrieve all the IPs of all the VMs
- Create a new text document
- rename the document to FindIPs.ps1
- insert the following text
- execute the script in PowerCLI
$vms = Get-VM
foreach($vm in $vms){
$vmIP = $vm.Guest.IPAddress
foreach($ip in $vmIP){
$A = $vm.Name + ", " + $IP
Write-Host $A
Add-Content .\IP.List.txt $A
}
}