Hi all,
I found a handy little command from LucD to get a list of roles with their privleges:
$CUSTROLES = Get-VIRole | Where-Object {$_.Name -match "MYROLE" -or $_.Name -match "CUSTOM"}
foreach($role in $CUSTROLES){
Get-VIPrivilege -Role $role | Select @{N="Role";E={$role.Name}},@{N="Privilege Name";E={$_.Name}},@{N="Privilege ID";E={$_.ID}}
}
Now that I have this list of roles, I would like to recreate these roles with their privileges on a new destination vCenter.
I know how to create an individual role, for example:
New-VIRole -name RO+DSBrowse -Privilege "Browse datastore" -Server $viserver
How do I recreate the roles and privileges I captured in step#1 ?