Create local user account using PowerShell


I needed to create a Local User account during the build process for a number of new laptops. Below is the PowerShell command I used with a Task Sequence ‘Run command’ step in System Center Configuration Manager.

powershell.exe New-LocalUser -AccountNeverExpires:$true -Password ( ConvertTo-SecureString -AsPlainText -Force 'username') -Name 'password'