in reply to Win32 functions on other domains
Each individual computer does have an OS name that you can retreive - and that's what Win32::GetOSName() does - it retreives the OS name of the local machine.
To get the OS Name of a remote machine, there are several ways. One way is to use Win32::TieRegistry to query the registry of the remote machine. Another is to use Win32::OLE together with WMI. Here's an example:
use strict; use Win32::OLE qw( in ); my $Computer = 'myworkstation'; my $WMIServices = Win32::OLE->GetObject( "winmgmts:{impersonationLevel=impersonate}//$Computer" ) || die ("Could not connect to $Computer"); my $OSCollection = $WMIServices->InstancesOf( "Win32_OperatingSystem" +); foreach my $OS (in $OSCollection ) { print "OS = $OS->{Caption}\n"; }
|
|---|