Create a Local User Account in vCenter Server

You can create a local user account in vCenter Server by using the vSphere Automation SDK for PowerShell.

Prerequisites

Verify that you are connected to a vSphere Automation API server.

Procedure

  1. Prepare the data structures for the API operation.
    $LocalAccountsConfig = Initialize-LocalAccountsConfig -Password '$trongPa$$w0rd' -Roles "superAdmin"
    $LocalAccountsCreateRequestBody = Initialize-LocalAccountsCreateRequestBody -Username "MyUsername" -Config $LocalAccountsConfig
    
  2. Invoke the API operation.
    Invoke-CreateLocalAccounts -LocalAccountsCreateRequestBody $LocalAccountsCreateRequestBody
    
  3. (Optional) Retrieve the local account you created.
    Invoke-GetUsernameLocalAccounts -Username "MyUsername"