8 Replies Latest reply on Nov 24, 2017 5:58 AM by nicholas1982

    Cannot Create Account with esxcli

    nicholas1982 Hot Shot

      Having a strange issue. I need to create a RO account on every ESXi servers deployed via Powercli however using EsxCLI won't accept my password. But when using New-VMhostAccount connected directly to the host it works fine. I'm wanting to set this account during the build of the host which is automated via powercli so doing a connect-visever direct to the host in the middle my build script breaks my connection to the vcenter i'm building in, any ideas?

       

          $Args = $esxcli.system.account.set.CreateArgs()

          $Args.id = 'a_guard'

          $Args.password = '@`[tNI\xUh7#&by\'

          $Args.passwordconfirmation = '@`[tNI\xUh7#&by\'

          $esxcli.system.account.set.invoke($Args)

       

      Message: A specified parameter was not correct: argument[1];

      InnerText: argument[1]

      At line:5 char:5

      +     $result = $esxcli.system.account.set.invoke($Args)

      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          + CategoryInfo          : OperationStopped: (:) [], InvalidArgument

          + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.InvalidArgument