Learn some helpful IT Administrator tips and tricks.

Welcome to the most comprehensive list of tips and tricks for IT field, you'll find anywhere on the internet. I hope these tips help you get the most out of your internet.

Cloud Computing Next Generation of your company

Benefits of cloud computing is increased efficiency; services are rapidly deployed and ready for use in your company. Find out about the benefits of moving your business to cloud computing....

Support Tips and Tricks

Tips and Tricks for. Learning Before. Helping. Learning. Service. Research Computing... We are ...

Server, Network, System, Application | Diagram

Client-side Examples; Server-side Examples; Client-side Advantages ... this concept is to view the following diagram and considering some examples: ...

Good roadmap for System Engineer, Network Engineer

Roadmap global customer support professionals are focused on crucial, quick issue resolution and uninterrupted service.. HOW?

Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Saturday, March 9, 2013

Net Accounts, Net Accounts /Domain Command Details and Examples

You must access a command prompt and be logged on to an account with network administration permissions. Net accounts command allows administrators to control user account logon settings from command line. Below you can find the syntax of net accounts command explained with examples.
net accounts /domain


C:\>net accounts
Force user logoff how long after time expires?:       Never
Minimum password age (days):                          1
Maximum password age (days):                          42
Minimum password length:                              7
Length of password history maintained:                24
Lockout threshold:                                    Never
Lockout duration (minutes):                           30
Lockout observation window (minutes):                 30
Computer role:                                        WORKSTATION
The command completed successfully.

C:\>net accounts /domain
The request will be processed at a domain controller for domain      git.group.
Force user logoff how long after time expires?:       Never
Minimum password age (days):                          1
Maximum password age (days):                          42
Minimum password length:                              7
Length of password history maintained:                24
Lockout threshold:                                    Never
Lockout duration (minutes):                           30
Lockout observation window (minutes):                 30
Computer role:                                        BACKUP
The command completed successfully.

Details and Examples net user /domain user info from the command line

Use the command "net user accountname /domain" to display user information
Running that command gives you something like this: net user thinnawutp /domain (2 domain output sample)

net user

Net User
 
To obtain a list of domain users and groups you can query the domain controller as follows:
net user /domain > users.txt
net group /domain > groups.txt

How to logoff remote desktop via Terminal Server Commands "Query session | Reset session"

This is just a quick guide to check the error message "The terminal server has exceeded the maximum number of allowed connections" that you can use this command to figure out what sessions are connected to the server.

Use this command to display information about administrative and client node sessions: query session /server:yourcomputer
commnad check RDP

To reset the session of user1 by using the session name:
reset session rdp-tcp#1

To reset the session of user1 by using the session ID:
reset session 1

How to enable ping response in Windows Server with commandline

This is just a quick guide to enabling a server to respond to ping, the default setting in Windows Server is to disable. I would like to recommend this command "Netsh firewall set icmpsetting 8". While running this command, just wait since it takes a little time and this is the result:,
Netsh firewall set icmpsetting 8 disable

Once enabled you can also simply disable the ping utility also by repeating the same above steps the only difference would be the command name. Open the command prompt in Administrator mode as described earlier. You will have to type “Netsh firewall set icmpsetting 8 disable” in the command prompt.

How to find MAC address... either locally or across a network

Getmac | I would like to recommend this parameter "getmac /s \\remotecomputer", it helps you can remote to other PCs easily. While running this command, just wait since it takes a little time and this is the result:,
getmac command

Returns the media access control (MAC) address and list of network protocols associated with each address for all network cards in each computer, either locally or across a network.
getmac
getmac /v


Note: export the output by using this command getmac /s \\remotecomputer >> c:\getmacresult.txt

Commands Every Administrator Should Know "Driverquery"

Driverquery = Displays a list of all installed device drivers and their properties. I would like to recommend this parameter "driverquery /s \\remotecomputer" , it helps you can remote to other PCs easily

Incorrect device drivers can lead to any number of system problems. If you want to see which drivers are installed on a Windows system, you can do so by running the driverquery tool. This simple command-line tool provides information about each driver that is being used. The command is:
driverquery
Driverquery

If you need a bit more information, you can append the -v switch. Another option is to append the -si switch, which causes the tool to display signature information for the drivers. Here’s how they look:

driverquery -v
driverquery -si
driverquery /nh

Note: Sample command with export the result... driverquery /s \\remotecomputer >> c:\driverresult.txt

Friday, May 25, 2012

Configure IP Address and DNS using Command Prompt

Netsh IP Address
In order to configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe. The requested operation requires elevation (Run as administrator).

The IP address of your computer can be set from the command prompt by running the following commands at an administrative level prompt:

netsh interface ip set address name="Local Area Connection" static 146.40.202.222 255.255.255.0 146.40.202.1 1

Netsh interface set ip address

Local Area Connection is the name of the adapter you want to modify. In single NIC systems it is normally called Local Area Connection.
146.40.202.222 is the IP address you want to set.
255.255.255.0 is the subnet mask.
146.40.202.1 is the gateway.
1 is the gateway metric. You can leave this as 1 for almost all cases.

If you want to enable DHCP you can run:
netsh interface ip set address name="Local Area Connection" dhcp

There are two commands for DNS since administrators typically configure a primary and secondary DNS server.
For the primary DNS run:
netsh interface ip set dns name="Local Area Connection" static 146.40.202.9

For the secondary run:
netsh interface ip add dns name="Local Area Connection" 146.40.203.9 index=2

Local Area Connection

If you want to configure the computer to use DNS from DHCP run:
netsh interface ip set dnsservers name="Local Area Connection" source=dhcp

When you are finished with all of your IP and DNS changes run ipconfig -all to review the new settings.

Enable Telnet with only one command

Command-Telnet
Enable Telnet with only one command... Starting with Windows Vista, Windows 7 and ....., Microsoft no longer includes the telnet command installed by default. It is still available but must be installed or enabled by the user. The normal way to enabled additional features is through the “Turn Windows features on or off” window found in Control Panel. This accomplishes the task but can be annoying when you are working in Command Prompt and need to use the telnet command right away.
Instead of going to Control Panel, there is a better way. At an administrative level command prompt, simply run:

dism /online /Enable-Feature /FeatureName:TelnetClient

Telnet will be available immediately after the dism command has completed running.

Command-Telnet

Friday, April 6, 2012

Ping Multiple Destination With Batch File

       A common tool that network and system admins make use of is the “Ping” command which is a very simple and effective way to verify a machine is available on the network (firewall rules depending of course). So if you find yourself having to ping multiple machines at once, a very useful tool is the batch files, which will not only ping all the ip addresses but also give you ping results in text file format with just single click.


      A batch file is a text file containing a series of commands intended to be executed by the command interpreter. When a batch file is run, the shell program (usually COMMAND.COM  or cmd.exe) reads the file and executes its commands, normally line-by-line. Batch files are useful for running a sequence of executables automatically and are often used by system administrators to automate tedious processes.
Steps to create batch file::
  1. Open up Notepad, type in the following commands (Example)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    @Echo off

    ping 192.168.1.1 > "%userprofile%\desktop\pingresult.txt"

    ping www.google.com >> "%userprofile%\desktop\pingresult.txt"

    ping 146.23.4.45 >> "%userprofile%\desktop\pingresult.txt"

    tracert 192.168.1.1 >> "%userprofile%\desktop\pingresult.txt"
    tracert www.google.com >> "%userprofile%\desktop\pingresult.txt"

    tracert 146.23.4.45 >> "%userprofile%\desktop\pingresult.txt"

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Remember::  > will run the command and create a file with ping results and >> will append or add next ip address ping results to the created file . So whenever you create batch file first command should always have single > and subsequent  commands should have  >>.
  2. Now save this file with Filename Ping_result.cmd or whatever you want and Change  Save as type to All files.
  3. Run the Ping_result.cmd and you will get pingresult.txt on your desktop.
       Play around with netstat , ipconfig and other commands by creating batch files in the similar manner.., just change the ping command to the command of your choice in the above example.

How to Use the Traceroute Command

     Traceroute is a command which can show you the path a packet of information takes from your computer to one you specify. It will list all the routers it passes through until it reaches its destination, or fails to and is discarded. In addition to this, it will tell you how long each 'hop' from router to router takes.
    In Windows, select Start > Run > Type cmd or Start > Programs > Accessories > Command Prompt.  This will give you a window like the one below.
    Enter the word tracert, followed by a space, then the domain name.

    The following is a successful traceroute from a my machine in Thailand to liverpoolfc.tv:


     Firstly it tells you that it's tracing the route to liverpoolfc.tv, tells you the IP address of that domain, and what the maximum number of hops will be before it times out.
Next it gives information about each router it passes through on the way to its destination.
1 is the internet gateway on the network this traceroute was done from (an ADSL modem in this case)

2 - 5 are the ISP the origin computer is connected to (totbb.net)
6 - 8 are also in the xtra network
9 - 10 are all routers on the sg.bb.gin.ntt.net network (the domain that is the internet gateway Sigapore side)
11 - 13 are all uk.bb.gin.ntt.net in the UK (a telecom supplier in the UK)
14 - 15 are on the UK network 
and finally, line 16 is the computer liverpoolfc.tv is hosted on (liverpoolfc.tv)

      This is extremely useful when trying to find out why a website is unreachable, as you will be able to see where the connection fails. If you have a website hosted somewhere, it would be a good idea to do a traceroute to it when it is working, so that when it fails, you can do another traceroute to it (which will probably time out if the website is unreachable) and compare them. Be aware though, that it will probably take a different route each time, but the networks it passes through will generally be very similar. 
If the example above had continued to time out after line 9, you could suspect that sg.bb.gin.ntt.net was the problem, and not liverpoolfc.tv.

     If it timed out after line 1, you would know there was a problem connecting to your ISP (in this case you would not be able to access anything on the internet).
    It is generally recommended that if you have a website that is unreachable, you should use both the traceroute and ping commands before you contact your ISP to complain. More often that not, there will be nothing to your ISP or hosting company can do about it.

How to Use the Ping Command

       Pinging is a command which tells you if the connection between your computer and a particular domain is working correctly.


       In Windows, select Start > Run > Type cmd or Start > Programs > Accessories > Command Prompt. This will give you a window like the one below.
      Enter the word ping, followed by a space, then the domain name.
      If the results show a series of replies, the connection is working. The time shows you how fast the connection is. If you see a "timed out" error instead of a reply, there is a breakdown somewhere between your computer and the domain. In this case the next step is to perform a traceroute.

      Online ping. If you can't use the Ping command from your own computer because of a firewall or other restriction, or want to do an Internet ping from another location than your own, you can use one of the following websites that offer online ping services:
his.com Ping http://www.his.com/cgi-bin/ping?
Network-Tools http://network-tools.com/
Spfld.com Ping   http://www.spfld.com/ping.html
Theworldsend.net ping http://www.theworldsend.net/php-ping.php

Thursday, April 5, 2012

Color Batch File To Check Network~Server

       I wrote this today to provide an easy way for anyone to see if a computer is on the network/internet and even do some basic troubleshooting. If someone wanted to take this. Just cut and past into a text file and save with a .bat extension and you should be good to go. Could easily be put on a floppy or e-mailed to someone to test with..



Here is the basic color command:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
::
:: cecho by thomas
::
cecho {00}**********{\n}
cecho {0C}{\n}
echo This is a private system operated for HXXX Company business.
echo Authorization from XXX management is required to use this system.
echo Use by unauthorized person is prohibited.
cecho {00}**********{\n}
cecho {0C}{\n}
echo WARNING: This computer system is accessed by authorized users outside
echo of HP. All security and control procedures must be strictly followed.
pause
cecho {00}**********{\n}
echo Unpacking cecho utility
call :unpack_cecho
cecho {00}**********{\n}
cecho {0E}***************************************{\n}
cecho {0E}** BKKGCAP01.asiapacific..net **{\n}
cecho {0E}***************************************{\n}
cecho {0B}{\n}
cecho {9F} ------- {9F}Location: Row {9F}2 {9F}Rack {9F}8 {9F}------ {\n}
cecho {0B}{\n}
ping bkkgcap01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0A}**************************************{\n}
cecho {0A}** TLAEXC01.asiapacific.xxxx.net **{\n}
cecho {0A}**************************************{\n}
cecho {0B}{\n}
cecho {9F} ------ {9F}Location: Row {9F}2 {9F}Rack {9F}2 {9F}------ {\n}
cecho {0B}{\n}
ping tlaexc01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0E}***************************************{\n}
cecho {0E}** BKKFILE01.asiapacific.xxxx.net **{\n}
cecho {0E}***************************************{\n}
cecho {0B}{\n}
cecho {9F} ------- {9F}Location: Row {9F}2 {9F}Rack {9F}1 {9F}------ {\n}
cecho {0B}{\n}
ping bkkfile01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0A}**************************************{\n}
cecho {0A}** BKKCOE01.asiapacific.xxxx.net **{\n}
cecho {0A}**************************************{\n}
cecho {0B}{\n}
cecho {9F} ------ {9F}Location: Row {9F}2 {9F}Rack {9F}1 {9F}------ {\n}
cecho {0B}{\n}
ping bkkcoe01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0E}**************************************{\n}
cecho {0E}** THACOE01.asiapacific.xxxx.net **{\n}
cecho {0E}**************************************{\n}
cecho {0B}{\n}
cecho {9F} ------ {9F}Location: Row {9F}2 {9F}Rack {9F}* {9F}------ {\n}
cecho {0B}{\n}
ping thacoe01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0A}***************************************{\n}
cecho {0A}** THNCIU01.asiapacific.xxxx.net  **{\n}
cecho {0A}***************************************{\n}
cecho {0B}{\n}
cecho {9F} ------- {9F}Location: Row {9F}1 {9F}Rack {9F}8 {9F}------ {\n}
cecho {0B}{\n}
ping thnciu01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0A}**************************************{\n}
cecho {0A}** BKKSQL01.asiapacific.xxxx.net **{\n}
cecho {0A}**************************************{\n}
cecho {0B}{\n}
cecho {9F} ------ {9F}Location: Row {9F}2 {9F}Rack {9F}8 {9F}------ {\n}
cecho {0B}{\n}
ping bkksql01 -n 5
cecho {00}**********{\n}
cecho {00}**********{\n}
cecho {0E}*************************************{\n}
cecho {0E}** BKKDP01.asiapacific.cpqcorp.net **{\n}
cecho {0E}*************************************{\n}
cecho {0B}{\n}
cecho {9F} ----- {9F}Location: Row {9F}1 {9F}Rack {9F}8 {9F}------ {\n}
cecho {0B}{\n}
ping bkkdp01 -n 5
pause
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Download sample file
cecho.c      cecho.exe      cecho.vcproj      cecho BoYLaSeR.cmd    

Saturday, March 31, 2012

Batch File Commands - Network Self Test

Network Self test IT Services:
Run the script TestNetwork.CMD, you will see the following screen, which provide menu to test IT network services. perform a ping to a domain or application - this will help identify ... ping commands before the user contact your site admin





Menu 0: IP configuration: Provide overall network configuration detail on your PC.
  • For Company (Thai), “Ipv4 Address” should begin with 192.160.xxx.xxx (where x represoen 0-9)
Menu 1: Test network connection to the file server.
  • If you can ping to the file server, your O and P drive should be accessible. 
  • If you see some “Request timed out.”, there might be a problem on the cable or port connected to the PC.
  • If you see all “Request timed out.” but you got the IP address begin with 192.168 in “Menu 0”, the network route to the file server is unreachable.
  • Time should be less than 10 ms
Menu 2: Test network connection to the Email (Exchange) server.
  • If you can ping to the Email server, you should be able to send and receive email.
  • If you see all “Request timed out.” but you got the IP address begin with 192.168 in “Menu 0”, the network route to the email server is unreachable. 
  • Time should be less than 10 ms
Menu 3: Test Office Communicator (IM) Server in Singapore.
  • If you can ping to the server, you should be able to login and use Office Communicator (chat program).
  • If you see all “Request timed out.” but you got the IP address begin with 192.168 in “Menu 0”, the network route to the OC server is unreachable.
  • Time vary because the server is in Singapore, however more than 500ms consider high response time. 
Menu 4: Test network connection to the SAP (PC8) Server.
  • If you can ping to the PC8 server, you should be able to login and use SAP.
  • If you see all “Request timed out.” but you got the IP address begin with 192.168 in “Menu 0”, the network route to the SAP server is unreachable.
  • Time vary because the server is in Houston, however more than 1000ms consider high response time.
~~~~~~~~~~~~~~~~~~SAMPLE~~~~~~~~~~~~~~~~~~~~~~~
@echo off
:prompt
title Menu Slect to Auto Check IT Services                                                                by:BoYL@SeR 2011
color 1f
cls
echo.
echo    This is a private system operated for Company (Thailand) Company.
echo    Authorization from Chevron management is required to use this system.
echo    Use by unauthorized person is prohibited.
echo    WARNING: This computer system is accessed by authorized users outside
echo    of Chevron. All security and control procedures must be strictly followed.
echo ________________________________________________________________________________
echo                  Select Number to Auto Check the Internet Connection
echo ________________________________________________________________________________
echo                        0. IP configuration
echo                        1. Ping File Server (THFILESHARE)
echo                        2. Ping Mail Server (THMAILSERVER) 
echo                        3. Ping Office Communicator (SGCOMMUNICATION)
echo                        4. Ping SAP Server (PC8)
echo                        5. Exit
echo.
echo       Response Time Guideline:    Nomal             High
echo         1, 2 (local LAN)           1-10ms       more than 10ms
echo         3 (SG Ehub)              100-300ms      more than 300ms
echo         4 SAP                    300-500ms      more than 500ms
echo ________________________________________________________________________________
echo.
set /p answer=    Select 0, 1, 2, 3, 4 or 5 and press Enter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 DOWNLOAD BAT FILE HERE ┌∩┐(◕_◕)┌∩┐

Welcome!  If you are not yet a network member, please register.