Solved Problems creating local user account with powershell

bmagurn

New Member
Messages
1
Location
Leesburg VA
I was having a lot of trouble creating a local user account with a powershell script.


Basically, the script would throw no errors, but the account would not be shown in "Control Panel\User Accounts\Manage another user account"

It would seem that the user.create functionality of ADSI doesn't work the same way in win 8 as it did in win 7.
I finally figured out that the accounts had been created, but they weren't a member of "Users" by default, and when they weren't a member of users, they didn't show up in the control panel.

Script Local User Management Module

Run the script above, and then run the following two commands:
New-localuser -username "newuser" -password "123456" -description "created by powershell"
Set-Localgroup -username "newuser" -groupname "Users" -add

That should create the new user account, and add it to the Users group, so it is visible and can be used.
 

My Computer

System One

  • OS
    windows 7
Back
Top