Report on VMs mapped to incorrect Lun under vRanger


I wrote a script which will report VM’s mapped to incorrect Lun under vRanger.

Get-VM |
Select Name,
@{N=“Datastore”;E={[string]::Join(’,’,(Get-Datastore -Id $.DatastoreIdList | Select -ExpandProperty Name))}},
.Folder.Name}} |
Export-Csv C:\Users\venkatak\Desktop\script\report.csv -NoTypeInformation -UseCulture

The report is fine.

My requirement is I just wanted (If server name is abcapp01, it should be under lun-appXX), if suppose it is under lun-dbXX and vice versa, it should mail me.


As this is a specific VMware question, I’d recommend you to post this question at the VMware vSphere PowerCLI forum: