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?

Thursday, January 5, 2012

Retrieve the computer serial number

Instructions
Please use one the method bellow to retrieve the computer serial number:1. Using the buid in "wmic" command:
"wmic bios get serialnumber"
Tip: You can use the command "wmic csproduct get name" to retrieve the local computer model.

2. Using a vbs script:
 On Error Resume Next
Dim strComputer
strComputer = InputBox("Enter the name of the computer:")
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
MsgBox strComputer & ": " & objSMBIOS.SerialNumber
Next


wmic /node:SERVER1 printer list statusWMIC /locale:ms_409 OS WMIC OS LIST BRIEF
WMIC OS GET csname, locale, bootdevice
WMIC /locale:ms_409 NTEVENT where LogFile='system'
WMIC NTEVENT where "LogFile='system' and Type>'0'"
WMIC SERVICE where (state=”running”) GET caption, name, state > services.tsv
WMIC SERVICE where caption='TELNET' CALL STARTSERVICE
WMIC PRINTER LIST STATUS
WMIC PRINTER where PortName="LPT1:" GET PortName, Name, ShareName
WMIC /INTERACTIVE N PRINTER where PortName="LPT1:" DELETE
WMIC PROCESS where name='evil.exe' delete
WMIC /output:"%computername%.txt" MEMORYCHIP where "memorytype=17" get Capacity

Interactive mode:C:>START "Windows Management" WMIC
wmic:root\cli>/locale:ms_409
wmic:root\cli>OS get csname
wmic:root\cli>quit
This is the script I ran to gather a variety of system information from server3 remotely...
del c:\GatherInfo.txt
systeminfo /s \\server3 > c:\GatherInfo.txt
driverquery /s \\server3 >> c:\GatherInfo.txt
getmac /S \\server3 >> c:\GatherInfo.txt
freedisk /s \\server3 /D C: >> c:\GatherInfo.txt
gpresult /s \\server3 >> c:\GatherInfo.txt
sc \\server3 query >> c:\GatherInfo.txt
eventquery /S \\server3 /L application /FI "type eq error" >> c:\GatherInfo.txt
notepad c:\GatherInfo.txt

Data output:
WMIC BIOS > mydata.txtWMIC OS >> mydata.txtWMIC /APPEND:mydata.txt PAGEFILEWMIC /OUTPUT:output.txt OSWMIC /OUTPUT:CLIPBOARD BIOS

Data display:
WMIC PROCESS WHERE "name like '%HOST%'"WMIC PATH Win32_Process WHERE "name like '%HOST%'"WMIC PROCESS WHERE “Name=svchost.exe” LIST StatisticsWMIC PROCESS WHERE “Name=svchost.exe” LIST BREAFWMIC PROCESS WHERE (Name='svchost.exe') GET name, processed

Some Examples and usage of WMIC:
  1. To get the process list – wmic process list
  2. To get the group list – wmic group list
  3. To get the NIC Card Configuration – wmic nicconfig list
  4. To get user account list – wmic useraccount list
  5. To get the built in System account list – wmic sysaccount
  6. To get the Environment list – wmic environment list
  7. To get the information of all shares (including hidden) – wmic share list
  8. To get the list of services – wmic services list
  9. To get the computer system details – wmic computersystem list
  10. To get the volume information – wmic volume list
  11. To get full startup list – wmic startup list full
  12. To get Information of logical disks – wmic logicaldisk get description, filesystem, name, size
  13. To get screensaver information – wmic desktop get screensaversecure, screensavertimeout
  14. To get logon information – wmic logon get authenticationpackage
  15. To get information about the OS – wmic os get name, servicepackmajorversion
  16. To get information about QFE (Quick Fix Engineering) – wmic qfe get description,installedOn
  17. To get information about the computer – wmic csproduct get name,vendor,identifyingNumber
  18. To get the toal ram – wmic computersystem get TOTALPhysicalMemory,caption
  19. To get the macaddress of nic card – wmic nic get macaddress,description