Search files in all VMware vCenter Data Stores

I had a nightmare to find the *.iso files I uploaded to specific data store , and the only way is to open each one or search one by one:

So here I am trying to find all *.iso files uploaded to multiple data stores , later on I can move them or even remove them , the dilemma is to find them for now:

First you have to connect to vCenter server :

PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI> Connect-VIServer

List the available Data Stores:

create a new custom PowerShell drive for a vSphere datastore:

PowerCLI C:vMwarePowerCli> $datastore = Get-Datastore DS02

PowerCLI C:vMwarePowerCli> New-PSDrive -Location $datastore -Name ds -PSProvider VimDatastore -Root “”

Change locations into the PowerShell drive , and list the underneath objects:

Use your location to search in all Data Stores for specific information:

PowerCLI ds:> dir -Recurse -Path vmstores: -Include *.iso | select name, Datastorefullpath | FT -autosize

You can have them in another displayed format:

dir -Recurse -Path vmstores: -Include *.iso | FL

FLdisplay

or Display more about size and location in short:

Moretodisplay

Advertisements

About Ahmad Sabry ElGendi

https://www.linkedin.com/pub/ahmad-elgendi/94/223/559
This entry was posted in Configure, Vmware. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s