VMware Cloud Community
PGuibordCharter
Contributor
Contributor
Jump to solution

VIRole - Add Description

I have created a new VI Role in the UI, and I add the URL I am following to define the privs in the Description field of the Role.  The goal is to export the Role I created in the GUI so I can push the config to all my remaining vCenters. However, when I try to get the object in PowerCLI, I do not get the Description I entered:

Get-VIRole -Server $Global:DefaultVIServer -Name $VIRole | Select-Object Name,Description

Output shows the name of the Role for both objects rather than the Description I entered in the UI.

I can export the role/privs, they are created properly so I know the cmdlet I am using works, however I am still missing the Description field. I run a ForEach loop against the add-priviledge for each priv in my txt file, works like a champ, Description is doggin' me.

Set-VIRole -Server $Global:DefaultVIServer -Role $VIRole -<Something?>
 
I have 18 vCenters, the Get-VIRole $VIRole output is consistent to all of them, 6.7.x, some 7.0.x.  Am I missing something in the cmdlet or is my approach wrong?

 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You are correct, the Description content that you see in the Web Client is not retrieved by the Get-VIRole cmdlet.
But this isn't a PowerCLI issue, when using the API directly, I'm seeing the same issue.

$roleName = 'TestRole'

$authMgr = Get-View AuthorizationManager
$authMgr.RoleList.Where{$_.Name -eq $roleName} |
Select Name,@{N='Description';E={$_.Info.Summary}}


This seems to be a vSphere issue.


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

View solution in original post

3 Replies
LucD
Leadership
Leadership
Jump to solution

You are correct, the Description content that you see in the Web Client is not retrieved by the Get-VIRole cmdlet.
But this isn't a PowerCLI issue, when using the API directly, I'm seeing the same issue.

$roleName = 'TestRole'

$authMgr = Get-View AuthorizationManager
$authMgr.RoleList.Where{$_.Name -eq $roleName} |
Select Name,@{N='Description';E={$_.Info.Summary}}


This seems to be a vSphere issue.


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

PGuibordCharter
Contributor
Contributor
Jump to solution

1) Thanks, I appreciate you taking the time to review this!

2) Thank you for validating this, I was frustrated that I was missing something

3) How/who can I raise this to, to get some eyes on it before the vSphere 8 release?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You could open an SR or contact your TAM


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

0 Kudos