In an Administrative cmd
or powershell
terminal run
# /expires:never sets account to never expire NOT password
net user toggenator2 * /add /expires:never
# Password never expires
wmic UserAccount where Name="toggenator" set PasswordExpires=False
# or use powershell
Get-LocalUser toggenator | Set-LocalUser -PasswordNeverExpires $true
# Add to Administrators Powershell/cmd
Add-LocalGroupMember -Member toggenator -Group Administrators
net localgroup Administrators toggenator /add
To confirm
net user toggenator
Output of net user
command
User name toggenator
Full Name
Comment
User's comment
Country/region code 000 (System Default)
Account active Yes
Account expires Never
Password last set 5/07/2024 12:34:28 PM
Password expires Never
Password changeable 5/07/2024 12:34:28 PM
Password required Yes
User may change password Yes
Workstations allowed All
Logon script
User profile
Home directory
Last logon Never
Logon hours allowed All
Local Group Memberships *Administrators *Users
Global Group memberships *None
The command completed successfully.
0 Comments