Hi All, I have been searching the internet for days to be able to find an example of a script or any code for that matter that will list all folders in a VMware vcenter datastore, the majority of code I found used Get-VM to find folder names. Get-VM is not useful to me.
The script I need has to be able to locate a folder ending in “*_recent” inside of a folder named “.snapshots” that is located in the root of multiple (non Local) datastores.
Process Summary:
Locate all Datacenters
locate all Datastores
Search under each datastore found for a folder named ".snapshot" in the root of the datastore if ".snapshot" is NOT found, report not found and continue on to next datastore.
if ".snapshot" is found determine if a folder ending with "_recent" is present underneath .snapshot, report Found or NOT found
It would be ideal if the results / report saved to CSV and showed for each datastore if there was no ".snapshot" or "_recent"
Can anyone out there help with creating a script to achieve my needs please?
I am not sure this is even possible?
Kind Regards,
Troy.