Vimal2311
Vimal2311

Reputation: 43

Get computer name using serial number of server remotely

Can anybody tell me how get to know the computer name using serial number remotely?

Like using

wmic bios get computername where serialnumber="XXXXXX"

I need to know computer names of using multiple serial numbers.

Upvotes: 1

Views: 21239

Answers (2)

tony bd
tony bd

Reputation: 114

You'll have to use net use to get a list of computers. Then ask each one what is it's serial number.

For /f "tokens=1* delims=\ " %A in ('net view^|findstr /c:"\\"') do echo %A>> computerlist.txt
wmic /node:@computerlist.txt bios get SerialNumber /format:csv|findstr /i /c:"ENTER SERIAL NUM HERE"

or to get all in a nice file

wmic /node:@computerlist.txt bios get SerialNumber /format:htable>ServerSerialNumbers.htm
start "" ServerSerialNumbers.htm

Upvotes: 1

Sunny
Sunny

Reputation: 8302

In Batch You can do this like below:

wmic /node:[remote computer name] bios get computername where serialnumber="XXXXXX"

Or, if you would like to output to a text file:

set myfile = [The full UNC path with filename e.g. \\server\share\filename.txt]

wmic /append:%myfile% /node:[remote computer name] bios get computername where serialnumber="XXXXXX"

In Powershell Do like this, Just open the shell with Admin rights, and type::

Get-WmiObject -ComputerName [remote computer name]-Class Win32_BIOS -Filter 'SerialNumber="XXXXXX"' | Select -Property PSComputerName

Upvotes: 0

Related Questions