List all orphaned vmdk on all datastores in all VC's at a time by using script

Use the below script to achieve :

# Just paste the code in text file and rename with .ps1
# Purpose : List all orphaned vmdk on all datastores in all VC's
#Here fwvc950","fwvc951","fwvc952","flsan01 are my vcentrer

$arrayVC = "fwvc950","fwvc951","fwvc952","flsan01"
$OutputFile = "C:\OrphanedVMDK.txt"

Foreach ($strVC in $arrayVC)

{
    Connect-VIServer $strVC
    $arrUsedDisks = Get-VM |

0 Comments