PowerShell: Create Local User Account

前端 未结 5 2059
情歌与酒
情歌与酒 2020-12-13 03:44

I need to create a new local user account, and then add them to the local Administrators group. Can this be done in PowerShell?

EDIT:



        
5条回答
  •  情话喂你
    2020-12-13 04:23

    Another alternative is the old school NET USER commands:

    NET USER username "password" /ADD

    OK - you can't set all the options but it's a lot less convoluted for simple user creation & easy to script up in Powershell.

    NET LOCALGROUP "group" "user" /add to set group membership.

提交回复
热议问题