Bootstrap FreeKB - VMWare - Backup ESXi datastores using PowerShell
VMWare - Backup ESXi datastores using PowerShell

Updated:   |  VMWare articles

First, determine the full path to each of your datastores:

Add-PSSnapin VMware.VimAutomation.Core
Add-PSSnapin VMware.VumAutomation

Connect-VIServer -Server server_name -User username -Password password

Get-DataStore datastore_name

 

This should produce an output with a few lines of output. Make note of the line of output with the DatastoreBrowserPath:

DatastoreBrowserPath    : vmstores:\server_name@443\ha-datacenter\datastore_name

 

Use this script to backup the datastore, using the DatastoreBrowserPath:

Add-PSSnapin VMware.VimAutomation.Core
Add-PSSnapin VMware.VumAutomation

Connect-VIServer -Server server_name -User username -Password password

Copy-DatastoreItem -Item vmstores:\server_name@443\ha-datacenter\datastore_name\* -Destination C:/Temp/ -Recurse

Disconnect-VIServer -Server server_name

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter c37d44 in the box below so that we can be sure you are a human.