Network Troubleshooting Commands

Net:

The ‘net’ command is used for both local and remote troubleshooting and provides lot of features,

and has 21 different sub-commands, and each sub commands have its own switches. To know what were

the sub commands available for the ‘net’ command you can use the ‘net’ command followed by the ‘/?’

for displaying help.

First let’s discuss about the basic operations that this command offers and then move on the next level.

The ‘net’ command when used with the subcommand ‘user’ is used for creating, deleting and setting a

password for an existing or a newly created user account. The below command is used to display all the

available user accounts in the local machine,

As you see in the above screenshot, there are currently six user accounts available on my

computer namely ‘administrator’, ‘cyb3rcr4wl3r’,’__vmware_user__’,_HelpAssistant’,

‘Support_388945a0’ and ‘guest’. The ‘administrator’ is the common user account with admin rights

created by default whenever you install windows operating system, even the ‘Guest’ belongs to the same

category but doesn’t have much privileges, ‘cyb3rcr4wl3r’ is the user account that I have created, and the

73

rest of them like ‘__vmware_user__’ was created by the VMware Virtual machine which is a third party

virtualization software and the other 2 user accounts were created by the OS itself, and is used by

Microsoft in case of remote access, troubleshooting and automatic updates.

The ‘net’ command when used with the ‘user’ will perform the similar operation even with the ‘users’

subcommand.

The ‘net users’ command along with the ‘/add’ switch is used to create a new user account. The below

command is used to create a new user account with the name ‘technocrawl’ and password ‘P4$$w0rd’ on

the local machine.

C:\>net users technocrawl P4$$w0rd /add

The command completely successfully.

Once the user was created successfully then it will display you with the message “command

completed successfully”. The user that you created using the ‘net user’ command has only the normal

user privileges, whereas it doesn’t have few rights such as installing a new software, access to few files

and folders are restricted and so on.

To change the password for the user account ‘technocrawl’ I can use the following command,

C:\>net users technocrawl *

Type a password for the user:

Retype the password to confirm:

The command completed successfully.

When the asterisk symbol is used after the ‘net users’ command followed by the ‘username’, it will

prompt for the new password. This will work, only if you have the administrator or the power user

privileges on that machine but you can change your own password, else the access will be denied.

74

The ‘net users’ command with the ‘/delete’ switch is used to delete the specified user account.

The command given below is used to delete the user account named ‘cybercrawler’ from the local

machine.

C:\>net users cybercrawler /delete

The command completed successfully.

Once the specified user account was deleted, then you will be displayed with a message “The command

completed successfully’.

The ‘/times’ switch is used to specify the ‘logon hours allowed’ for the specified user, if it is specified as

‘all’ then the user will be able to logon at any time, and if you are not specifying anything for the ‘times’

switch, then the ‘logon hours allowed’ will be set to none.

C:\>net users admin /times:all

The command completed successfully.

In the above example, I have set the ‘logon hours allowed’ for the user ‘admin’ as all, so that user will be

able to logon to this computer at any time.

To view the detailed information about a specified user such as account information, password

information like password last set, password expiry, password whether changeable, whether user has the

rights to change the password, local group membership and the global group membership of the user, you

can use the ‘net user’ command followed by the username. For example if I want to know the details of

the user ‘admin’ then I can use the below command,

75

C:\>net users admin

The below screenshot reveals the account information for the user ‘admin’,

Also you can view the ‘logon hours allowed’ set for this user is “all”, since we have already specified in

the previous command.

As said earlier the user account that was created using the ‘net users’ command is just a limited

user account, and to assign rights to the user, you can use the ‘localgroup’ subcommand along with the

‘net’ command. For example, I have to create a new user and assign it administrator rights, then I have to

use the below commands to do so,

76

As you can see in the above screenshot, I have created a new user account “moderator”, then by using

the ‘localgroup’ subcommand, I have added the user ‘moderator’ to the administrator group, there by

assigning all the rights to the user.

When you type the ‘net localgroup’ command alone without using any switches, then it will

display all the available user groups, and you can add the specified users to any of the groups listed over

there,

77

The ‘/comment’ switch is used for giving comments the usergroup that you are going to create. In the

following example I have created a new usergroup as the moderator and commented it as “Moderator

user group”,

C:\>net localgroup Moderator /add /comment:”Moderator user Group”

The command completed successfully.

The ‘/domain’ switch is used to add the user group under the specified domain.

The ‘/delete’ switch is used for deleting the user from a group. The following command is used for

deleting the newly created group ‘moderator’,

C:\>net localgroup Moderator /delete

The command completed successfully.

The ‘net’ command when used with the ‘view’ subcommand is used to display the hostnames of all the

computers that are connected in the same network. If you are not in a networked machine, then it will

display the following message,

C:\>net view

There are no entries in the list.

The below screenshot is the output displayed by the ‘net view’ command, which reveals all the networked

hostnames connected with my computer,

78

The ‘net’ command along with the ‘view’ sub command is used to view the computers connected within

the same network. When this command gets executed it will display the hostnames with its description if

any. If this command is executed in a machine which is not hooked up in a network then it will display

the message “There are no entries in the list.”.

Here is a screenshot of how it will display the available hostnames that is connected with the same

network,

The ‘net view’ when used with the ‘/cache’ switch is used to display the cached information on the host.

The ‘/All’ switch is used to display all the connected hosts that is in the same network, no matter whether

the machine is online or offline.

Facebook
Twitter
Pinterest