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:

Get Windows PowerShell™ Scripting Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.