Example: Add a User “yuk” with Local “Administrators” right
C:\net user <username> <password> /add
C:\net user yuk 123456 /add
REMARK: If this is Domain server, this action was added a domain user

 

Example: Gaint local administratos right for user “yuk”
C:\net localgroup <local group name> <username> /add
C:\net localgroup administrators yuk /add    /*** add a local user to administrators group
C:\net localgroup administrators mys\yuk /add    /*** add a domain user to administrators group, domain name is “mys\”

 

Example: Reset User Password
C:\net user <username> <password>
C:\net user yuk 123456
REMARK: This is not change user password, this is reset user password, so after reset most saved user password will clear.

 

Example: Enable/Disable User Account
C:\net user <username> active:yes    /*** Enable user account
C:\net user <username> active:no    /*** Disable user account

 

Additional Net User Command Options
Item Explanation
/active:yes | no} Use this switch to active or deactivate the specified useraccount. If you don’t use the /active option, the net user assumes yes.
/comment:” text  Use this option to enter a description of the account. A maximum of 48 characters is allowed. The text entered using the /comment switch is viewable in the Description field in a user’s profile in Users and Groups in Windows.
/countrycode: nnn This switch is used to set a country code for the user, which determines the language used for error and help messages. If the /countrycode switch isn’t used, the computer’s default country code is used: 000.
/expires:date | never} The /expires switch is used to set a specific date (see below) in which the account, not the password, should expire. If the /expires switch isn’t used, never is assumed.
date (with /expires only) If you choose to specify a date then it must be in mm / dd / yy or mm / dd / yyyy format, months and days as numbers, fully spelled out, or abbreviated to three letters.
/fullname:” name  Use the /fullname switch to specify the real name of the person using the username account.
/homedir: pathname Set a pathname with the /homedir switch if you want a home directory other than the default 2.
/passwordchg:yes | no} This option specifies whether this user can change his or her own password. If /passwordchg is not used, the net user assumes yes.
/passwordreq:yes | no} This option specifies whether this user is required to have a password at all. If this switch isn’t used, yes is assumed.
/logonpasswordchg:yes | no} This switch forces the user to change his or her password at the next logon. Net user assumes no if you don’t use this option. The /logonpasswordchg switch is not available in Windows XP.
/profilepath: pathname This option sets a pathname for the user’s logon profile.
/scriptpath: pathname This option sets a pathname for the user’s logon script.
/times:timeframe | all] Use this switch to specify a timeframe (see below) that the user can log on. If you don’t use /times then net user assumes that all times are okay. If you do use this switch, but don’t specify either timeframe or all, then net user assumes that no times are okay and the user is not allowed to log on.
timeframe (with /times only) If you choose to specify a timeframe you must do so in a particular way. Days of the week must be spelled out completely or abbreviated in MTWThFSaSu format. Times of day can be in a 24-hour format, or 12-hour format using AM and PM or A.M. and P.M. Periods of time should use dashes, day and time should be separated by commas and day/time groups by semicolons.
/usercomment:” text  This switch adds or changes the User Comment for the specified account.
/workstations:computername,…] | *} Use this option to specify the computer names of up to eight computers that the user is allowed to log on to. This switch is really only useful when used with /domain. If you don’t use /workstations to specify allowed computers then all computers ( *) is assumed.

Powershell Command

Computer Rename:
Rename-Computer -NewName "WINBUZZER-DESKTOP"