How can I determine the OS of a remote computer?

22

10

How can I determine the OS of a remote computer, given its computer name?

Steve

Posted 2011-08-15T03:13:56.767

Reputation: 2 473

can you be more specific in what you are trying to accomplish? – Keltari – 2011-08-15T03:23:18.500

2I have the computer name. I want to know what OS it is running; either by magic, or using a software tool of some description. – Steve – 2011-08-15T03:24:36.190

2

you can't do anything with it's name, but you can use an OS fingerprinting tool (such as NMAP)

– Nate Koppenhaver – 2011-08-15T04:11:53.500

Answers

16

You can use nmap to probe the remote computer and based on it's responses to TCP packets (valid or invalid requests) nmap can infer what operating system it is using.

This is not 100% accurate, but probably the best you can do in the general case.

If you're limiting yourself to Windows only and you have credentials of an administrator account on the remote machine, you can use this method instead.

View system properties

To perform this procedure on a remote computer, right-click Computer Management (Local), click Connect to another computer, select Another computer, and then type in the name of the remote computer. You can then follow the steps in this procedure, starting at step 2, and substituting Computer Management (remote computername) for Computer Management (Local). You must be a member of the Administrators group, or you must have been delegated the appropriate authority, on the computer that you specify for remote computername.

And further to this, if your computers are joined to a domain then you can look at the computer accounts in Active Directory. These should tell you about the machine.

ta.speot.is

Posted 2011-08-15T03:13:56.767

Reputation: 13 727

1nmap -O -v IPADDRESS https://nmap.org/book/osdetect-usage.html – Ivan Chau – 2016-04-26T03:59:32.227

If I run Computer Management as a domain admin, connect to the remote computer, and right-click on Computer Management (remotehost) in the tree, I have Connect to Another Computer, All Tasks (connect), View (standard Explorer view choices), Export List, and Help. There is no Properties in the right-click menu. – Steve – 2011-08-15T03:33:38.670

If I run Computer Management on my own computer, I don't have Properties in the right-click menu of Computer Management in the tree.

My PC is running Win7 SP1 32-bit. – Steve – 2011-08-15T03:35:43.113

I believe this is/was the correct method. Other documentation references it - http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysprop_to_perform_a_remote_reboot.mspx?mfr=true - but I tried and got the same result as you on my Win7 box. I found right clicking on "WMI Control" under "Services And Applications" gave me a short summary of the remote machine.

– ta.speot.is – 2011-08-16T04:34:50.397

Note that many admins consider running nmap against a machine to be a hostile action, on the assumption that you're scanning for potential vulnerabilities. – Dave Sherohman – 2011-08-24T09:52:40.040

3nmap is just coming to give the ports a hug... – ta.speot.is – 2011-08-24T10:53:25.287

4

Systeminfo command shows os name and service pack number. you can run this command on the remote computer using psexec.

Source: Find Windows Version from command line

Giri

Posted 2011-08-15T03:13:56.767

Reputation: 529

3

Given then information you have given, the answer is you can not determine a machine's OS by its name.

Keltari

Posted 2011-08-15T03:13:56.767

Reputation: 57 019

What about if we limit the possibilities to MS Windows machines? – Steve – 2011-08-15T03:37:53.327

' Specify NetBIOS name of the remote computer. strComputer = "TestComputer" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" _ & strComputer & "\root\cimv2") Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each objOS in colOSes Wscript.Echo "Version: " & objOS.Version 'Version & build Wscript.Echo "OS Type: " & objOS.OSType Next – Keltari – 2011-08-15T03:50:16.460

1there are a lot of reasons why this script might not work though... – Keltari – 2011-08-15T03:50:53.947

Do you have a source URL for this script? I get "Invalid Character" when I try and run it. – Steve – 2011-08-15T04:31:15.623

3

Using cmd (Command prompt in windows Vista, XP, etc)

systeminfo /s IP.ADDRESS /u UserOnRemotePc

eg:

systeminfo /s 172.16.23.108 /u Student

Pratik

Posted 2011-08-15T03:13:56.767

Reputation: 39

2This only works if the remote operating system is Windows. – Ramhound – 2013-02-07T11:58:42.003

2

Quick and simple, you can use the Windows Inventory interface

wmic /node: HOST_NAME os get caption

Neo

Posted 2011-08-15T03:13:56.767

Reputation: 21

4How is your answer different than old answer – pun – 2015-11-24T12:27:39.407

2

WMIC /NODE:hostname OS

*you can supply alternative credentials as well.

wmic /NODE:hostname OS > C:\OS.txt

Volodymyr M.

Posted 2011-08-15T03:13:56.767

Reputation: 1 428

1

EASIEST METHOD:

  1. Click the Windows Start button and type msinfo32 and press Enter
  2. Click View > Remote Computer > Remote Computer on the Network
  3. Type machine name and click OK

Dan Black

Posted 2011-08-15T03:13:56.767

Reputation: 11

1

You can do this with Windows PowerShell, which is installed by default in Windows 7. You can get to it from the system menu, under Accessories.

The command that you can use is...

Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2 -ComputerName <ipaddr_or_hostname> | Format-List -Property *

You can run this against a local or remote system by specifying the correct value for the ComputerName property.

You can filter the output for specific info by specifying which properties to display...

Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2 -ComputerName <ipaddr_or_hostname> | Format-List -Property Name, OSArchitecture, SerialNumber

Joe Internet

Posted 2011-08-15T03:13:56.767

Reputation: 5 145

+1 This was exactly what I needed. Don't forget to include the final * – Mark Cooper – 2015-06-11T13:48:27.750

This is assuming it is windows OS. – Saher Ahwal – 2017-07-20T01:25:13.933

I receive the message: Get-WmiObject : A parameter cannot be found that matches parameter name 'computername'. Same thing happens if I use the fully qualified hostname.domainname – Steve – 2011-08-16T04:05:25.233

Try using 127.0.0.1 for ComputerName, and verifying that it runs correctly on localhost. If it does, try using the ipaddress of the remote machine. – Joe Internet – 2011-08-16T04:25:18.977

-1

A non-comprehensive solution was to simply open the C drive of the remote computer in Windows Explorer. The presence of Documents and Settings showed it to be WinXP, as we have no Win2K.

Steve

Posted 2011-08-15T03:13:56.767

Reputation: 2 473

What about Windows Server 2003? – Synetech – 2011-08-15T03:56:56.077

1I appreciate the down vote. It really helps. – Steve – 2011-09-16T04:42:10.443

Well don’t look at me. Check the timeline; you got it two days after I saw this question.

– Synetech – 2011-09-16T05:07:33.080