Hello,
I'm having some challenges finding a way to get a list of all permissions held by a particular custom role. My end goal is to get all the permissions for the role, then create the role in another vCenter and assign the same permissions to it.
Also, is there a difference between a priviledge and a permission? I see there is a set command for permission, but a get command for VIPrivilege, but I'm not understanding if they are different concepts:
Set-VIPermission
Get-VIPrivilege
A Role contains a number of Privileges, like for example "Create a snapshot'.
With a Role you can now assign a Permission for a Principal to an entity.
# Get all Roles in your environment
Get-VIRole
# Get the Privileges for a specific Role
Get-ViPrivilege -Role Admin
To get all the Permissions that use a specific Role, you could do
Get-VIPermission | Where{$_.Role -eq 'Admin'}
There are a couple of threads in the community that contain snippets for exporting and importing Permissions.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
A Role contains a number of Privileges, like for example "Create a snapshot'.
With a Role you can now assign a Permission for a Principal to an entity.
# Get all Roles in your environment
Get-VIRole
# Get the Privileges for a specific Role
Get-ViPrivilege -Role Admin
To get all the Permissions that use a specific Role, you could do
Get-VIPermission | Where{$_.Role -eq 'Admin'}
There are a couple of threads in the community that contain snippets for exporting and importing Permissions.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
