Jump to content

How to identify OS version remotely?


Taggs

Recommended 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
Link to comment
Share on other sites


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
Link to comment
Share on other sites

  • 1 month later...

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

Creating_a_OS_batch_file.txt

Link to comment
Share on other sites

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……

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...