#86164 - 2002-06-17 09:48 AM
Getting The OS Of A Remote Machine
|
Mark Pietersz
Getting the hang of it
Registered: 2001-09-30
Posts: 74
Loc: Melbourne, Australia
|
Folks,
Kix provides the wonderful macro @PRODUCTTYPE. Is there something similar that I can use to get the OS of a remote machine. I have already tried
$oDomain = getobject("WinNT://$sDomainName") $oDomain.filter = "computer","" For each $oComputer in $oDomain $oComputer.operatingsystem $oComputer.operatingsystemversion etc...
however the return values are Windows NT 4.0 I was wanting to know whether the target machine is a server or workstation
The verbage for the ".role" property suggests that it may be useful however in my environment the return value is nothing. "Role Gets and sets role of this computer (server, workstation, and so on) "
Furthermore, the curious thing is that the following produces no screen output $x = "Role=" + $oComputer.role + "" ? $x The following at least outputs the text "Role=" to the screen $x = "Role=" ;+ $oComputer.role + "" ? $x
What is it about some of these properties that seems to zap the contents of variables ?
_________________________
Mark Pietersz
|
Top
|
|
|
|
#86166 - 2002-06-17 11:31 AM
Re: Getting The OS Of A Remote Machine
|
Mark Pietersz
Getting the hang of it
Registered: 2001-09-30
Posts: 74
Loc: Melbourne, Australia
|
Lonkero,
The only reason that I didn't do that is that I didn't know about it !! Sensational. Thanks. There's so much in the registry that is not clear. Why do I have CurrentControlSet, CurrentControlSet001 and CurrentControlSet002 ? I also need to know what logical/physical drives exist on a machine. Can the registry provide that info ? I've looked under "Diskcontroller" and DeviceMap\Scsi but is there makes little sense to me. Is there a "Dummies Guide To The MS Registry" book available ?
_________________________
Mark Pietersz
|
Top
|
|
|
|
#86169 - 2002-06-17 06:02 PM
Re: Getting The OS Of A Remote Machine
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I love my UDF...
code:
? wmiquery("Caption","Win32_OperatingSystem","$computername") ? wmiquery("CSDVersion","Win32_OperatingSystem","$computername") ? wmiquery("SerialNumber","Win32_OperatingSystem","$computername") ? wmiquery("OSProductSuite","Win32_OperatingSystem","$computername") ? wmiquery("Description","Win32_OperatingSystem","$computername") ? wmiquery("InstallDate","Win32_OperatingSystem","$computername")
[ 17 June 2002, 18:03: Message edited by: Radimus ]
|
Top
|
|
|
|
#86171 - 2002-06-17 06:57 PM
Re: Getting The OS Of A Remote Machine
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I am starting to collect the 'essential UDF kit' my scripts are getting smaller, but my UDF lib is getting bigger.
The WMIQuery() was the first one in... along with WshShortCut, XlsInputBox, ServiceRun, ServiceStartup, regwrite, FindPROC(modified killproc), Groupmembers, DelDir (once I neutered it for null input), and Ping. there are a few others, but are my lan-specific
Hopefully, the IE library will get working better...
|
Top
|
|
|
|
#86173 - 2002-06-17 07:23 PM
Re: Getting The OS Of A Remote Machine
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I though about that...
okey dokey... I'll do it tonight.
I have some there now, but it is my office's logon script. my boss wants me to rename the names and addresses in them anyway, for security.. I can understand that
|
Top
|
|
|
|
#86174 - 2002-06-18 02:03 AM
Re: Getting The OS Of A Remote Machine
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I have uploaded the scripts and UDFs to http://www.wheelerfam.com/kixtart.htm
|
Top
|
|
|
|
#86175 - 2002-06-25 07:46 AM
Re: Getting The OS Of A Remote Machine
|
Mark Pietersz
Getting the hang of it
Registered: 2001-09-30
Posts: 74
Loc: Melbourne, Australia
|
Guys - thanks for the help to date Is there any answer to my second question
"Furthermore, the curious thing is that the following produces no screen output $x = "Role=" + $oComputer.role + "" ? $x The following at least outputs the text "Role=" to the screen $x = "Role=" ;+ $oComputer.role + "" ? $x
What is it about some of these properties that seems to zap the contents of variables "
Regards
Mark
_________________________
Mark Pietersz
|
Top
|
|
|
|
#86176 - 2002-06-27 12:06 AM
Re: Getting The OS Of A Remote Machine
|
Anonymous
Anonymous
Unregistered
|
I have been using WMIQuery to retrieve the OS information from remote machines. It only seems to work on some machines. I thought at first that it only worked on Win2k, but it works on some NT4SP6 machines as well. It doesn't work on any of our NT 4 Terminal Servers (SP6).
What are the dependencies for WMIQuery?
Thanks, Michael.
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|