Create a New-LocalUser - Problems.
im writing command line create new local user account, isn't working.
new-localuser -name blc -password blc004 -accountneverexpires -fullname blc -passwordneverexpires -usermaynotchangepassword
after command line , can see message:
new-localuser : cannot bind parameter 'password'. cannot convert "blc004" value of type "system.string" type
"system.security.securestring".
@ line:1 char:35
+ new-localuser -name blc -password blc004 -accountneverexpires -fullna ...
+ ~~~~~~
+ categoryinfo : invalidargument: (:) [new-localuser], parameterbindingexception
+ fullyqualifiederrorid : cannotconvertargumentnomessage,microsoft.powershell.commands.newlocalusercommand
i tried change password, appear samething. knows can work ?
hi,
sure, cmdlt can't accept password without security...
ps c:\> $password = read-host -assecurestring ps c:\> new-localuser "user03" -password $password -fullname "third user" -description "description of account." name enabled description ---- ------- ----------- user03 true description of account.you can find documentation here
merci de marquer comme réponse les sujets qui vous ont permis d'avancer afin que cela puisse être bénéfique aux personnes qui rencontrent le même problème.
Windows Server > Windows PowerShell
Comments
Post a Comment