Back to Browse

Delete Multiple Virtual Machine Snapshots Older Than Specific Days

3.1K views
Oct 2, 2022
17:19

In this video you will learn how to get and delete snapshot from vCenter Virtual Machine with Older Than or Greater Than specific days. Suppose you want to delete snapshot on specific virtual machine 7 days earlier or 7 days older, you can do that by using this script. also, I have explained how to use this filter in Script so you can easily understand, please let me know if you have any query. ======================================================== ##Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false $Credential = Get-Credential -Message "Enter Login Credential" $vCenter = Read-Host -Prompt "Enter vCenter Name" Connect-VIServer -Server $vCenter -Credential $Credential $DaysOLD = Read-Host "Enter days count to get OLDER Snapshot" $VMs = Get-Content C:\Scripts\Allservers.txt foreach ($vm in $VMs){ Invoke-Command { Get-VM $vm | Get-Snapshot | Where {$_.Created -gt (Get-Date).AddDays(-$DaysOLD)} | Select-Object VM, Name, Created | Export-Csv C:\Temp\Snapshot.csv -Append Get-VM $vm | Get-Snapshot | Where {$_.Created -gt (Get-Date).AddDays(-$DaysOLD)} | Remove-Snapshot -Confirm:$false }} ======================================================== How To Create File Selection Dialog Box in PowerShell https://youtu.be/5ZEKxSSmQ1w Add User/Group To The Local Administrators/RDP Group On Multiple Computers https://youtu.be/rrRMSSL913Q Get Windows Updates list from Remote Computer https://youtu.be/A6kPDH_9pO4 PowerShell Remotely Uninstall Software from Multiple Computers https://youtu.be/978myp7AD5s PowerShell Search Specific KB Status on Remote Computers https://youtu.be/9HtcVT_kifg PowerShell Script to Connect Multiple Server's Remote Session https://youtu.be/zaSxFqLTf0s PowerCLI Script to power ON dedicated VMs listed in a text file https://youtu.be/4DWVuFaSxYA PowerCLI Script to power Off dedicated VMs listed in a text file https://youtu.be/bcz_5QUEhR8 Delete Snapshot's from Multiple Virtual Machines https://youtu.be/yfQ50dyEjSU Create Snapshot on Multiple Virtual Machine https://youtu.be/Nsmsa9FgFv4 How can I check if a port is open remotely https://youtu.be/-JCKk9_vVBc Installing software remotely on Multiple "Workgroup" Computers https://youtu.be/QT4u74JWbOM PowerShell Installing software remotely on Multiple Computers https://youtu.be/E9yaYVbzgb4 Unable to move OU in Active Directory (Access is denied) https://youtu.be/0XRizUBbj3s PowerShell Installing software remotely on Multiple Computers https://youtu.be/E9yaYVbzgb4 Get Multiple Services Status Remotely | Remotely Start or Stop Services https://youtu.be/C8PrFNbdLj8 Get Date and Time from Multiple Remote Computers https://youtu.be/ZpMio_y1zn8 PowerCLI - How to get HA restarted VM's List https://youtu.be/0IRJvZH9paQ Get-Childitem - Search file on Local and Remote Computers https://youtu.be/kHkD5M-mk0A Remotely Create Update Delete Registry Key on Multiple Computers https://youtu.be/Hxlqr3zdxHM Get service status from remote server's using PowerShell https://youtu.be/7fIG_brMONU

Download

0 formats

No download links available.

Delete Multiple Virtual Machine Snapshots Older Than Specific Days | NatokHD