LucD
Leadership
Leadership

Try something like this

$principal = '<domain>\Video Infrastructure'

Get-VM | where{(Get-VIPermission -Entity $_).Principal -contains $principal} |

Select Name,@{N='Datastore';E={(Get-Datastore -RelatedObject $_).Name -join '|'}},

    @{N='Cluster';E={(Get-Cluster -VM $_).Name}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference