-
Notifications
You must be signed in to change notification settings - Fork 613
Description
Describe the bug
When using the module Set-VcenterServerGlobalPermission using the following kind of usage:
Install-Module VMware.vSphere.SsoAdmin
$MobConnection = Connect-VcenterServerMOB -SkipCertificateCheck -Server <vcenter_FQDN> -User <vcenter administrator user from vsphere.local domain> -Password <Password of provided vcenter administrator account>
Set-VcenterServerGlobalPermission -Server $MobConnection -TargetUser <test001@vsphere.local> -RoleID (Get-VIRole -Name $RoleName).ExtensionData.RoleId -Propagate
, I got the following error:
InvalidOperation: /root/.local/share/powershell/Modules/VMware.vSphere.SSoAdmin/1.4.0/MobConnect.ps1:398
Line |
398 | $Server.SetPermissions($TargetUser, $RoleId, $Propagate)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Method invocation failed because [MobConnection] does not contain a method named 'SetPermissions'.
I used VMware.vSphere.SsoAdmin module version 1.4.0 (the last version, freshly published 7 days ago at the timing of writing this issue)
Reproduction steps
- Install-Module VMware.vSphere.SsoAdmin
- $MobConnection = Connect-VcenterServerMOB -SkipCertificateCheck -Server <vcenter_FQDN> -User -Password
- Set-VcenterServerGlobalPermission -Server $MobConnection -TargetUser test001@vsphere.local -RoleID (Get-VIRole -Name $RoleName).ExtensionData.RoleId -Propagate
- Disconnected-VcenterServerMOB -Server $MobConnection
Expected behavior
At the Set-VcenterGlobalPermission step, prompt is given back without any error.
The role with name "$RoleName" is seen allocated at a GlobalPermission within the Adminstration>Access Control>Global Permissions part in vCenter HMI.
Additional context
I update the line 398 of /root/.local/share/powershell/Modules/VMware.vSphere.SSoAdmin/1.4.0/MobConnect.ps1 replacing "SetPermissions" by "SetGlobalPermissions"
And I imported with force the slighlty updated local module:
Import-Module -Name '/root/.local/share/powershell/Modules/Vmware.vSphere.SsoAdmin' -Force -Verbose
Then reproduction steps were done again with successfull results, as described in 'Expected behavior' chapter.