Get computer name using serial number of server remotely

我是研究僧i 提交于 2021-01-28 05:26:10

问题


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.


回答1:


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



回答2:


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


来源:https://stackoverflow.com/questions/23309295/get-computer-name-using-serial-number-of-server-remotely

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!