Managing local vRA users with PowervRA

• Craig

One of the current limitations with vRA7 is that once a local user has been created it can’t be modified.

Since v1.20 PowervRA has provided ability to interact with local user principals by using the following set of functions:

  • Get-vRAUserPrincipal
  • Set-vRAUserPrincipal
  • New-vRAUserPrincipal
  • Remove-vRAUserPrincipal

In this post, i’m going to concentrate on Set-vRAUserPrincipal. The function enables you to configure the following attributes of a local user principal:

  • FirstName
  • LastName
  • EmailAddress
  • Description
  • Password

You can also enable and disable an account with the *DisableAccount and EnableAccount switch parameters.

Here are some examples:

Modify account attributes

Set-vRAUserPrincipal -Id user@vsphere.local -FirstName FirstName-Updated -LastName LastName-Updated -EmailAddress userupdated@vsphere.local -Description Description-Updated

Enable and disable an account

Set-vRAUserPrincipal -Id user@vsphere.local -EnableAccount
Set-vRAUserPrincipal -Id user@vsphere.local -DisableAccount

Reset the password of an account

Set-vRAUserPrincipal -Id user@vsphere.local -Password s3cur3p@ss!

As always, make sure you test any new commands against your D&T environment first!

Contributing

If you want to contribute a new function or have ideas/improvements head over to our github page and let us know!