VMware Cloud Community
jaymatt
Enthusiast
Enthusiast

Unable to create Local User on VCSA 6.7 with API

I want to create local User on my vCenter VCSA 6.7 with Api

Here my code

Connect-CisServer -Server 192.168.0.115 -User administrator@vsphere.local -Password 123456+Aze

$name = "jerome"

$fullname = " JM2K69"

$role = "superAdmin"

[VMware.VimAutomation.Cis.Core.Types.V1.Secret]$Password = "VMw@re123"

$userAPI= Get-CisService 'com.vmware.appliance.local_accounts'

$createSpec=$userAPI.Help.create.config

    $createSpec.full_name = $fullname

    $createSpec.roles = $role

    $createSpec.password = $password

    $userAPI.create($name,$createSpec)

If you have some idea ? Thx

0 Kudos
2 Replies
LucD
Leadership
Leadership

Looks like a bug.

When you call the same REST API directly, without the CisService, it works without any problem.

I suggest you open a SR


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

0 Kudos
jaymatt
Enthusiast
Enthusiast

Ok but how to open a SR ?

0 Kudos