Frequently used Windows Operating System commands

Different commands in windows operating system I user frequently

• How to find the Serial Number of Laptop/ Server/ System

wmic bios get serialnumber

I had some problem with wmic on my laptop and end up using powershell script to get serial number:
Get-WmiObject Win32_SystemEnclosure | Select SerialNumber
# Ref: https://gallery.technet.microsoft.com/scriptcenter/Hardware-Inventory-Using-fe6611e0 
# above mentioned blog can be used to generate and mail full hardware information report

• Check who logged in remote Server and kill other user sessions

query session /server:ESI-COLOSQL04
RESET session 2 /server:ESI-COLOSQL04

• Search for some text in file:

Find “string” C:/Filepath/Filename.txt 

• Group Policy Update, View

GPUPDATE /FORCE 
GPRESULT /R

• How to find Server/laptop name

HOSTNAME

• How to find the IP Address of Server

IPConfig

• Logoff Server

Logoff

• Find all the network connections established from Server

NETSTAT

• Edit registry

REGEDIT

• Copy files with multiple options

Robocopy

• Runas different user

runas /user:DOMAIN\USERNAME /netonly "C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe"

• NET Commands- Local Group operations, All Shares, Start Service, Stop Service

NET LOCALGROUP
NET SHARE
NET START
NET STOP

• List all tasks and Kill the task

Tasklist 
TaskKill 

• See Time

 Time 

• Find the issues with PING failures

 TraceRt 

• See content of file, and More option to see

 Type | More 

• Logged in user information

 whoamI 

Some References with detailed information:
https://vijredblog.wordpress.com/2014/12/26/how-to-find-active-connections-in-windowsnlbserver/
https://vijredblog.wordpress.com/2014/03/12/network-command-utilities-ipconfig-arp-route-ping-tracert-netstat-nslookup/
https://vijredblog.wordpress.com/2014/06/10/kill-windows-process-only-if-it-is-running-using-tasklist-taskkill-together-dos-command/

Advertisements
This entry was posted in commands and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s