Get-allsnapshots

Uit Brakwiki
Ga naar: navigatie, zoeken
$LogTime = Get-Date -Format "dd-MM-yyyy_hh-mm-ss"
$CSVFile = ".\snapshots\Snapshots on "+$LogTime+".csv"

$ConstVirtualCenterFQDN = "NET-VC01.NET.LOCAL"
Add-PSSnapin -name VMware.VimAutomation.Core
Connect-VIServer -server "$ConstVirtualCenterFQDN"
get-vm | get-snapshot | where {$_.VM -notlike "*replica*"} | select VM, Name, Description, Created, SizeGB | Export-Csv -Path $CSVFile -Delimiter ","