- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Get-VIPermission for each VM in vCenter
Hi,
I am looking for a way to display the VIPermissions of each VM listed in vCenter without entering a command for each VM (as there are hundreds).
Here is what I would like to automate....
- Connect to my vCenter Connect-VIServer vcentername
- List all my VM's Get-VM | Format-Table Name
- List my permissions for each VM Get-VIPermission vmname
Here is the closest I've come to getting what I'm looking for accept my output file does not include the VM names accociated with the permissions.
Get-VM -Server esxhostname | ForEach-Object {Get-VIPermission -Server vcentername $_.name} | Export-Csv C:\temp\exportfile.csv
or
Get-VM | ForEach-Object {Get-VIPermission -Server vcentername $_.name} | Export-Csv C:\temp\exportfile.csv
Thanks in advance,
M