Orphaned Files
May been a few years old but the below post from legendary PowerCLI vExpect Luc Dekens is very much still worth checking out…. Awesome script for finding orphaned files on your datastores! During a recent audit i managed to located almost 1TB of forgotten vmdks and iso files on numerous datastores.
Anyway, Check it out:
http://www.lucd.info/2016/09/13/orphaned-files-revisited/
I tend to run it using the following to display within the Powershell WindowGet-Datacenter *
DC
*| Get-Cluster *
Cluster
* | Get-Datastore | Get-VmwOrphan | FT
Or to Expect to CSVGet-Datacenter *
DC
*| Get-Cluster *
Cluster
* | Get-Datastore | Get-VmwOrphan |
Export-CSV -Filename "Filepath\filename.csv"