Having some trouble creating a command to create a new user in PowerShell, the code I'm using is:
PS C:\Users\Nicky> New-ADUser -Name johnd -GivenName John -Surname Doe -DisplayName John Doe $secpasswd = ConvertTo-SecureString -String "pa$$word1" -AsPlainText -Force -AccountPassword $secpasswd
I can get it working without the AccountPassword
, so I think the issue is when converting it to a secure string so the -AccountPassword
will accept it.
Anyone any ideas on how to get this to work?
No comments:
Post a Comment