This can be achieved a few different ways...

1.  Registry
  HKLM\System\CurrentControlSet\Control\ProductOptions\ProductType
     --A value of ServerNT identifies it as an NT Server
2.  NetBios
    -Win32::Lanman has a GetServers function that queries NETBIOS to
determine what systems broadcast a particular SERVER message..  
      --Servers announce both the Workstation and Server message.
      --Workstations only announce the Workstation message.
    --I've found that NetBios is flaky (personal opinion).
3.  WMI and the Win32_OpertaingSystem class:
    Looking at the:
      ProductType
      OSType
    properties..

    perl wmi-generic.pl Win32_OperatingSystem

    wmi-generic.pl can be found at www.roth.net/perl/scripts
    Link for more info:
 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/
wmi/win32_operatingsystem.asp?frame=true

4.  Win32::API and GetVersionEx function
  looking for:
      wProductType == VER_NT_SERVER (Server)
      wProductType == VER_NT_WORKSTATION (Workstation)
      dwMajorVersion == 4 (2000) or 5 (XP/2003)

It's your choice..  The more correct way is not to use the registry, but
it works and if you know that it could change at any moment, and are
okay with it, then your destiny awaits.

Steven

-----Original Message-----
From: Jonathan Chan [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 12:01 PM
To: Perl-Win32-Admin-Request (E-mail)
Subject: determining windows OS


hi guys,

i'm using a function that looks at a client's registry to determine
which 
windows os a box is running. i can easily easily determine if a machine
is 
nt, 2000, or xp. does anyone have a way of determining if a box is
either 
running nt server or nt workstation?


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to