Discussion:
New-LocalUser - Problems. Does anyone knows whats is happening ?
(too old to reply)
K800i2
2017-04-05 19:56:21 UTC
Permalink
Im writing this command line to create a new local user account, but isn't working.






New-LocalUser -Name Blc -Password Blc004 -AccountNeverExpires -FullName Blc -PasswordNeverExpires -UserMayNotChangePassword





After this command line , i can see this message:





New-LocalUser : Cannot bind parameter 'Password'. Cannot convert the "Blc004" value of type "System.String" to type
"System.Security.SecureString".
At 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 to change the password, but appear the samething. Does somebody knows what can i do to work ?
MaxW
2017-04-06 17:20:00 UTC
Permalink
Post by K800i2
Im writing this command line to create a new local user account, but isn't working.
New-LocalUser -Name Blc -Password Blc004 -AccountNeverExpires -FullName Blc -PasswordNeverExpires -UserMayNotChangePassword
New-LocalUser : Cannot bind parameter 'Password'. Cannot convert the "Blc004" value of type "System.String" to type
"System.Security.SecureString".
At 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 to change the password, but appear the samething. Does somebody knows what can i do to work ?
Can't use plain text for the password parameter. Just convert it first to secure string, then run the cmdlet:

$i = ConvertTo-SecureString "Blc004" -AsPlainText -Force
New-LocalUser -Name blc -Password $i -AccountNeverExpires -FullName Blc -PasswordNeverExpires
Richard Mistrík
2018-05-15 11:53:48 UTC
Permalink
Post by K800i2
Im writing this command line to create a new local user account, but isn't working.
New-LocalUser -Name Blc -Password Blc004 -AccountNeverExpires -FullName Blc -PasswordNeverExpires -UserMayNotChangePassword
New-LocalUser : Cannot bind parameter 'Password'. Cannot convert the "Blc004" value of type "System.String" to type
"System.Security.SecureString".
At 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 to change the password, but appear the samething. Does somebody knows what can i do to work ?
Gloops
2018-07-17 21:44:38 UTC
Permalink
Post by K800i2
Im writing this command line to create a new local user account, but isn't working.
New-LocalUser -Name Blc -Password Blc004 -AccountNeverExpires -FullName Blc -PasswordNeverExpires -UserMayNotChangePassword
New-LocalUser : Cannot bind parameter 'Password'. Cannot convert the "Blc004" value of type "System.String" to type
"System.Security.SecureString".
At 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 to change the password, but appear the samething. Does somebody knows what can i do to work ?
Hello,

Does this help ?

https://msdn.microsoft.com/en-us/library/system.security.securestring(v=vs.110).aspx#vsString
--
Besoin d'un autre système, pas d'un autre gouvernement.
Loading...