Reply to Message

View discussion in a popup

Replying to:
vmCalgary
Enthusiast
Enthusiast

Thank you LucD (as always). The following worked like a charm.

$principal = '<domain>\<user_group>'

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}}  | Export-csv c:\users\<me>\<filename.csv> -NoClobber

I will need to tweak this somewhat as a peer mentioned we need the 'vm and templates' folder name as well.

View solution in original post

Reply
0 Kudos