Net User

Set Expire date for User Account

If you know the data that an employee leaves the organization then it’s a good idea to set the expired date for the account. This way the account is automatically locked after the specified data. The date format depends on your region settings, but the options are:

# Set expire date for local user

Net User lazyadmin /expires:21/09/2022

# Set expire data for domain user

Net User testusr /domain /expires:09/20/2022

sample : net user warawut /domain /expires:09/09/2024

et User Password settings

When you create a new account you can set a password for the account as well. But when it comes to passwords we have two other interesting parameters, passwordchg and passwordreg. The first determines if the user can change the password. This setting is really useful for kiosk accounts. The user can’t change the password when this is set to no.

# User lazyadmin can’t change it’s password

net user lazyadmin /passwordchg:no

The parameter passwordreg is used to specify it a user account must have a password. If this is set to no, then the user can remove their password, making the device vulnerable.

net user lazyadmin /passwordreg:yes

Net User Change or Set Password

One of the common tasks for an IT Helpdesk is to reset a user’s password. Of course, you can reset the password in the Active Directory. But it’s also possible with the command Net User. Resetting passwords is not limited to domain accounts, you can also use this method for local computer accounts.

To reset a password you will need to specify the username and then either type in the password or type * after which you can securely type the password:

# Set the password for LazyAdmin to passwd123

Net User LazyAdmin passwd123

# Pormpt for the new password

Net User LazyAdmin *

When it’s a domain user, then just add the /domain parameter. Make sure that the password meets the complexity requirements of the domain

# Reset the password for the domain user tesusr

Net User /domain testusr *

ใส่ความเห็น

This site uses Akismet to reduce spam. Learn how your comment data is processed.