Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

How to identify OS version remotely?

- - - - -

  • Please log in to reply
17 replies to this topic

#1
Taggs

Taggs

    Taggs

  • Member
  • PipPip
  • 185 posts
Can anybody tell me a command or way of identifying which version of the OS is on the server I remotely connect to?

I tried dos VER and Help > About from a window and this only tells me that it is Windows 2000, build number and service pack.

The information I am trying to collect is, is the server a Windows 2000 Std, Windows 2000 Adv, Etc...

If I click the start button on the server it comes up with the Windows version on the start bar but not if I’m remotely connected and I don’t wont to have to go around several sites collecting data for over 100 servers.

Thanks
Taggs



Don't worry, I've sorted now.

Thanks :thumbup

Edited by Taggs, 24 February 2006 - 04:59 AM.



How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,215 posts
  • OS:none specified
  • Country: Country Flag
You mean something like nmap:
http://www.insecure.org/nmap/
http://www.insecure....ng-article.html

jaclaz

#3
cluberti

cluberti

    Gustatus similis pullus

  • Supervisor
  • 11,252 posts
  • OS:Windows 8.1 x64
  • Country: Country Flag
You can do this with some WMI magic in a vb script:

Option Explicit
Dim objWMI, objItem, colItems
Dim strComputer, VerOS, VerBig, Ver9x, Version9x, OS, OSystem

strComputer = "COMPUTERNAMEHERE"

Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48)

For Each objItem in colItems
VerBig = Left(objItem.Version,3)
Next

Select Case VerBig
Case "5.0" OSystem = "W2K"
Case "5.1" OSystem = "XP"
Case "5.2" OSystem = "Windows 2003"
Case "4.0" OSystem = "NT 4.0"
Case Else OSystem = "Unknown (Win9x perhaps?)"
End Select

Wscript.Echo "Version No : " & VerBig & vbCr _
& "OS System : " & OSystem

WScript.Quit

Edited by cluberti, 24 February 2006 - 10:45 AM.

MCTS Windows Internals, MCITP Server 2008 EA, MCTS MDT/BDD, MCSE/MCSA Server 2003, Server 2012, Windows 8
--------------------
Please read the rules before posting!
Please consider donating to MSFN to keep it up and running!

#4
Lus

Lus

    Junior

  • Member
  • Pip
  • 65 posts
u can use WMIX too.
http://www.pjtec.com/Downloads/

#5
jftuga

jftuga

    Member

  • Member
  • PipPip
  • 283 posts
Psinfo will tell you OS version and if it is standard or advanced server version. I just tried it (remotely) on Win 2K Standard & Advanced servers and on 2003 servers. If differentiated all of them with no problems,

http://www.sysintern...ies/PsInfo.html

-John

#6
Hamins

Hamins

    Member

  • Member
  • PipPip
  • 195 posts
The easiet way would be to to try MSINFO32 /computer ComputerName

#7
GliX

GliX
  • Member
  • 3 posts
Hi

I was searching for the same thing some time ago. The one I use is a simple batch job “se below”

Hi

I was searching for the same thing some time ago. The one I use is a simple batch job “se below”

::
@echo off
cls
echo.
::
ver | find "Windows XP" >nul
if not errorlevel 1 goto XP
::
ver | find "Windows 2000" >nul
if not errorlevel 1 goto 2K
::
ver | find "Windows NT" >nul
if not errorlevel 1 goto NT
::
ver | find "Windows ME" >nul
if not errorlevel 1 goto ME
::
ver | find "Windows 98" >nul
if not errorlevel 1 goto 98
::
ver | find "Windows 95" >nul
if not errorlevel 1 goto 95
::
ver | find "OEM Service Release" >nul
if not errorlevel 1 goto OEM
::
ver | find "MS-DOS" >nul
if not errorlevel 1 goto DOS
::
echo OS version not found...
goto end


:XP
echo OS is Windows XP ...
goto end

:2K
echo OS is Windows 2K ...
goto end

:NT
echo OS is Windows NT ...
goto end

:ME
echo OS is Windows ME ...
goto end

:98
echo OS is Windows 98 ...
goto end

:95
echo OS is Windows 95 ...
goto end

:OEM
echo OS is Windows OSR ...
goto end

:DOS
echo OS is MS-DOS mode ...


:end
echo.
::


pause

Attached Files



#8
Daemonforce

Daemonforce

    Spider? Where?

  • Member
  • PipPipPip
  • 355 posts
I just boot PHLAK and run nmap. It's as simple as that. :unsure:

#9
nmX.Memnoch

nmX.Memnoch

    MSFN Master

  • Patrons
  • 2,086 posts
  • OS:Windows 7 x64
  • Country: Country Flag

The easiet way would be to to try MSINFO32 /computer ComputerName

MSINFO32 doesn't exist on Windows XP or Windows Server 2003. The replacement command is systeminfo.

systeminfo /s remote_computer

#10
GliX

GliX
  • Member
  • 3 posts
Hi agin

If it’s for a logon script I would use the Batch Job, it doesn’t involve any extended features nor programs.. and it works. Try it just copy and paste, run it and you’ll see..
It’s simple especially if you have different machines on your network.
I’ve used the script above for antivirus updates, and patching……

#11
Mr Snrub

Mr Snrub

    Former MSFT

  • Super Moderator
  • 775 posts
  • OS:Windows 8 x64
  • Country: Country Flag

MSINFO32 doesn't exist on Windows XP or Windows Server 2003. The replacement command is systeminfo.

systeminfo /s remote_computer

MSINFO32 is present on XP, XP x64 and 2003 and can be called directly from Start / Run.
It does not, by default, work from a command prompt as it resides in "%programfiles%\Common Files\Microsoft Shared\MSInfo".

The MPS reporting tools used at Microsoft call MSInfo32.exe when gathering system information on any version of Windows.

If the machines are in a domain then doesn't the computer object store the OS version reported when the computer last booted up?

My TechNet Blog
I have CDO. It's like OCD except the letters are in alphabetical order, as they should be.


#12
GliX

GliX
  • Member
  • 3 posts
Hi agin

It’s okay if you'r running XP on you’r LAN or local net.
but what if you also have X numbers of Win2000 machines and other types of systems.
I’m not saying that my version is the smartest one, but the smart solution would be to run a non OS. Spec. utility in you’r logonscript.
And a Batch job "old but still running" are non OS. spec.

#13
Mordac85

Mordac85

    Jack of all trades, master of none

  • Member
  • PipPipPip
  • 374 posts
  • OS:XP Pro x86
  • Country: Country Flag
If you're running the script on the local system you can use the Kix macros @ProductType and @ProductSuite to get detailed info from Win9x to Vista. Or a WMI query, as mentioned above, in your favorite language to pull the OS name. But I believe systeminfo run against a remote PC will pull from the same WMI namespace.
~Mordac85

Common sense is not so common.
~Voltaire

#14
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,215 posts
  • OS:none specified
  • Country: Country Flag

Hi

I was searching for the same thing some time ago. The one I use is a simple batch job “se below


Sorry, but I don't see the actual advantage of your batch file :blink: as compared to simply run
ver

jaclaz

#15
Mordac85

Mordac85

    Jack of all trades, master of none

  • Member
  • PipPipPip
  • 374 posts
  • OS:XP Pro x86
  • Country: Country Flag
The difference is the amount of information. Unless you know all of the major/minor versions by heart, or want to parse it out, using a script gives much more info. I guess it really depends on how detailed he needs as to what the best/easiest option will be. From his question, I was assuming he was looking for a method to obtain a more detailed result.

I tried dos VER and Help > About from a window and this only tells me that it is Windows 2000, build number and service pack.

The information I am trying to collect is, is the server a Windows 2000 Std, Windows 2000 Adv, Etc...


@Taggs - Do you have an idea of how you want to proceed? If you could tell us what script language you're comfortable with we might be able to toss out a quick code snippet, if you haven't already done so.

Edited by Mordac85, 11 April 2006 - 08:04 AM.

~Mordac85

Common sense is not so common.
~Voltaire

#16
nmX.Memnoch

nmX.Memnoch

    MSFN Master

  • Patrons
  • 2,086 posts
  • OS:Windows 7 x64
  • Country: Country Flag
Some people have missed the point that he wants to do it remotely. :)



If the machines are in a domain then doesn't the computer object store the OS version reported when the computer last booted up?


Yep, it does, including service pack level. :)

Edited by nmX.Memnoch, 11 April 2006 - 08:40 AM.


#17
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,215 posts
  • OS:none specified
  • Country: Country Flag

Some people have missed the point that he wants to do it remotely. :)


Yep, or more simply a lot of people do not actually READ previous posts and just write what they feel like:
@Mordac85

I was referring to the supposed advantage of a script like the one that GliX suggested, that, apart from not being remotely working as required, simply PARSES the output of the "ver" command, actually STRIPPING OUT most of the info (i.e. version).

jaclaz

Edited by jaclaz, 13 April 2006 - 08:18 AM.


#18
nmX.Memnoch

nmX.Memnoch

    MSFN Master

  • Patrons
  • 2,086 posts
  • OS:Windows 7 x64
  • Country: Country Flag
Here's a KiX script that will query all the computers in a specific OU and then gather the OS information using WMI. It'll write all of the information to a Comma Separated Values (CSV) file and then open the file at the end of the script.

You'll need to edit the $objOU value.

Break On
CLS
Dim $Filter[0],$objWMIService,$colItems,$objItem

$Filter[0]="Computers"; Or replace "Group" with "User" or "Computer"

$objOU = GetObject("LDAP://OU=ComputersOU,DC=example,DC=company,DC=com")
$objOU.Filter = $Filter[0]

$X = RedirectOutput("os_versions.csv",1)
; >>>>>>>>Header Row<<<<<<<<
"Computer Name,Status,Operating System,Service Pack"

For Each $objOUItem in $objOU
   $WK = Trim(SubStr($objOUItem.Name,4))
   ? "$WK"
   Shell '%COMSPEC% /C ping -n 1 -w 20 $WK | Find /I "TTL=" > ping.txt'
   If Open(1,"ping.txt",2) = 0
	  $LINE = ReadLine(1)
	  If InStr($LINE,"TTL=")
		 ",ONLINE"
		 $colItems = GetObject("winmgmts:\\$WK\root\cimv2").ExecQuery("Select * from Win32_OperatingSystem",,48)
		 For Each $objItem in $colItems
			$OS  = $objItem.Caption
			$SP  = $objItem.CSDVersion
			",$OS,$SP"
		 Next
	  Else
		 ",OFFLINE"
	  EndIf
   EndIf
   $X = Close(1)
Next

$X = RedirectOutput("")
Del "ping.txt"
Shell '%COMSPEC% /C START "" os_versions.csv'
Exit





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN