Net User Command Syntax

Net User Command Syntax

net user [username [password | *] [/add] [options]] [/domain]


/add = Use the /add option to add a new username on the system.

options = See Additional Net User Command Options below for a complete list of available options to be used at this point when executing net user.

/domain = This switch forces net user to execute on the current domain controller instead of the local computer.

/delete = The /delete switch removes the specified username from the system.

/? = The standard help command switch also works with the net user command but only displays the basic command syntax. Executing net user without options is equal to using the /? switch.

Additional Net User Command Options

The following options are to be used where I note options in the net user command syntax above:

/active:{yes | no} = Use this switch to active or deactivate the specifieduseraccount. If you don’t use the /active option, 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 /commentswitch 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 /expiresswitch isn’t used, never is assumed.

date (with /expires only) = If you choose to specify a date then it must be inmm/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 default2.

/passwordchg:{yes | no} = This option specifies whether this user can change his or her own password. If /passwordchg is not used, 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. 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 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.

Net User Command Examples

net user administrator

net user rodriguezr /times:M-F,7AM-4PM;Sa,8AM-12PM

net user nadeema r28Wqn90 /add /comment:”Basic user account.” /fullname:”Ahmed Nadeem” /logonpasswordchg:yes /workstations:jr7tww,jr2rtw /domain

[/workstations:jr7twwr,jr2rtwb]. Finally, my company uses a domain controller [/domain] so Ahmed’s account should be setup there.

net user nadeema /delete

Net User Command Availability

The net user command is available from within the Command Prompt in most versions of Windows including Windows 8Windows 7Windows VistaWindows XP, Windows Server operating systems, and some older versions of Windows too.


Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın: Logosu hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Connecting to %s

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