Guest User

Untitled

a guest
Jan 28th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
  2.  
  3. $VI_SERVER = "XXXX"
  4. $VI_USERNAME = "root"
  5. $VI_PASSWORD = "XXXX"
  6.  
  7. Write-Host "VI_SERVER=$VI_SERVER"
  8. Write-Host "VI_USERNAME=$VI_USERNAME"
  9. Write-Host "VI_PASSWORD=$VI_PASSWORD"
  10.  
  11. Write-Host "`nConnecting to vCenter Server ..."
  12. Connect-VIServer -Server $VI_SERVER -User $VI_USERNAME -password $VI_PASSWORD | Out-Null
  13.  
  14. Write-Host "\nGetting ESXi Details"
  15. Get-VMHost | Export-Csv -path "/tmp/scripts/myesxhost-report.csv" –NoTypeInformation
  16.  
  17. Write-Host "\nGetting ESXi Details"
  18. Get-VM | Export-Csv -path "/tmp/scripts/myvm-report.csv" –NoTypeInformation
  19.  
  20. Write-Host "Disconnecting ...`n"
  21. Disconnect-VIServer * -Confirm:$false
Add Comment
Please, Sign In to add comment