CmdID

CmdID / PowerShell / Cmdlets / Set

Set-LocalUser

Modifies a local user account. PowerShell reference

From the PowerShell reference 12 parameters Alias slu

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Modifies a local user account. The Set-LocalUser cmdlet modifies a local user account. This cmdlet can reset the password of a local user account. NOTE: The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system.

Set-LocalUser [-AccountExpires <DateTime>] [-AccountNeverExpires] [-Description <String>] [-FullName <String>] [-Name] <String> [-Password <SecureString>] [-PasswordNeverExpires <Boolean>] [-UserMayChangePassword <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-LocalUser [-AccountExpires <DateTime>] [-AccountNeverExpires] [-Description <String>] [-FullName <String>] [-InputObject] <LocalUser> [-Password <SecureString>] [-PasswordNeverExpires <Boolean>] [-UserMayChangePassword <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-LocalUser [-AccountExpires <DateTime>] [-AccountNeverExpires] [-Description <String>] [-FullName <String>] [-Password <SecureString>] [-PasswordNeverExpires <Boolean>] [-SID] <SecurityIdentifier> [-UserMayChangePassword <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]

Change a description of a user account

Set-LocalUser -Name "Admin07" -Description "Description of this account."Identify

Change the password on an account

$Password = Read-Host -AsSecureString $UserAccount = Get-LocalUser -Name "User02" $UserAccount | Set-LocalUser -Password $PasswordIdentify

Its page in the reference: Set-LocalUser.

Parameters

12 in the PowerShell reference
-AccountExpiresSpecifies when the user account expires. To obtain a DateTime object, use the Get-Date cmdlet. If you do not want the account to expire, specify the AccountNeverExpires parameter.
-AccountNeverExpiresIndicates that the account does not expire.
-DescriptionSpecifies a comment for the user account. The maximum length is 48 characters.
-FullNameSpecifies the full name for the user account. The full name differs from the user name of the user account.
-InputObjectSpecifies the user account that this cmdlet changes. To obtain a user account, use the Get-LocalUser cmdlet.
-NameSpecifies the name of the user account that this cmdlet changes.
-PasswordSpecifies a password for the user account. If the user account is connected to a Microsoft account, do not set a password. You can use Read-Host -AsSecureString, Get-Credential, or ConvertTo-SecureString to create a SecureString object for the password. If you omit the Password and NoPassword parameters, Set-LocalUser prompts you for the user's password.
-PasswordNeverExpiresIndicates whether the password expires.
-SIDSpecifies the security ID (SID) of the user account that this cmdlet changes.
-UserMayChangePasswordIndicates that the user can change the password on the user account.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.