VMware Cloud Community
v10king
Contributor
Contributor

Problem with adding local user

Hi EVeryone,

I am using the VItoolkit to manage my local ESX accounts. I have a few manual scripts as well as some AD sync scripts. I have this working correctly in that I can supply a file with user names and the script will go through and connect to each esx host and build the account. I do have an issue that exists under the 1.0 toolkit as well as the latest 1.5 toolkit. Whenever I try and make user accounts with greater than 16 characters, the script just doesnt create the account. All others work

I am using the createhshell user function that I found on this board. Is there another function that can do that now?

0 Kudos
3 Replies
v10king
Contributor
Contributor

If I build the account below using this syntax, "$useracount = New-VMHostAccount -ID stestuser12048260a -Password pass -UserAccount -As

signGroup Users -GrantShellAccess" I get this issue.

New-VMHostAccount : 2/5/2009 2:39:04 PM New-VMHostAccount 521befa5-9851-8

f49-e3b8-96f8aba62ed9 A specified parameter was not correct.

At line:1 char:33

+ $userAccount = New-VMHostAccount <<<< -ID stestuser12048260a -Password pass

-UserAccount -AssignGroup Users -GrantShellAccess

+ CategoryInfo : NotSpecified: (Smiley Happy , InvalidAr

gumentException

+ FullyQualifiedErrorId : Client20_MoServiceImpl_Invoke_ViError,VMware.Vim

Automation.Commands.Host.NewVMHostAccount

If I do same command with less than 16 character account name then it works fine. Please someone help, this is obviously a bug in the code.

0 Kudos
LucD
Leadership
Leadership

User and group names in Red Hat Linux can be 32 characters long.

You can verify this with the useradd and groupadd commands in the ESX console.

Unless there is another reason to limit the length (of user- & group-names) to 16 characters this could be considered a bug.


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

v10king
Contributor
Contributor

Hi Luc, thanks for the response. I have created the same users manually with no issues on the ESX hosts. IT's definitely a bug, I narrowed it down to the same command working with 16 character user names or less while it errors out with 17 or more. I put a ticket in with HP VMWare supports (this is our OEM partner) and hopefully they will escalate to VMWare Backline and I can get a fix. Its kind of hard to implement a script that only works with 80% of our SA account names. IT's very frustrating, I hope the VI Toolkit guys can correct this error ASAP. I'm surprised noone else has experienced this.

0 Kudos