Install-User

Installs a local user account.

Syntax

Install-User [-Username] <String> [-Password] <String> [[-Description] <String>] [[-FullName] <String>] [-UserCannotChangePassword] [-PasswordNeverExpires] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Creates a new local user account. If the account already exists, updates it. Returns the user.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Username String The username for the user. true false
Password String The user's password. true false
Description String A description of the user. false false
FullName String The full name of the user. false false
UserCannotChangePassword SwitchParameter Prevent the user from changing his password. false false False
PasswordNeverExpires SwitchParameter Set to true if the user's password should expire. false false False
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

Return Values

System.DirectoryServices.AccountManagement.UserPrincipal.

EXAMPLE 1

Install-User -Username LSkywalker -Password "whydidn'tyoutellme" -Description "Luke Skywalker's account."

Creates a new LSkywalker user account with the given password and description. Luke's password is set ot never expire.

EXAMPLE 2

Install-User -Username LSkywalker -Password "whydidn'tyoutellme" -UserCannotChangePassword -PasswordNeverExpires

Demonstrates how to create an account for a user who cannot change his password and whose password never expires.