O'Reilly logo

Windows PowerShell™ Scripting Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Local User Account

There are also two methods to create a local user account. You can use net user, or you can use ADSI. Of course, you can still use the graphical tool shown in Figure 10-7.

The graphical new user tool in the Computer Management console.

Figure 10-7. The graphical new user tool in the Computer Management console.

Use ADSI to create local users and groups. To create a local user account, once again use the WinNT ADSI provider. Local user accounts don't have as many attributes as domain user accounts have, and so the process of creating them locally is not difficult.

Creating a Local User

Begin the CreateLocalUser.ps1 script with the param statement, where you define four parameters:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required