Leser: 23
my $Model = `wmic csproduct get name`;
my $Model = `wmic csproduct get name,vendor`;
QuoteFalls es jemanden interessiert. Unter Linux geht d...
1 2 3 4 5 6 7 8 9
use strict; use warnings; use DMI::Decode; my $dmi = new DMI::Decode; my $system_info = $dmi->system_information; print "Produkt: " . $system_info->{name}, "\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use strict;
use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;
my @computers = ("DELL17");
foreach my $computer (@computers) {
print "\n";
print "==========================================\n";
print "Computer: $computer\n";
print "==========================================\n";
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);
foreach my $objItem (in $colItems) {
print "Caption: $objItem->{Caption}\n";
print "Description: $objItem->{Description}\n";
print "IdentifyingNumber: $objItem->{IdentifyingNumber}\n";
print "Name: $objItem->{Name}\n";
print "SKUNumber: $objItem->{SKUNumber}\n";
print "UUID: $objItem->{UUID}\n";
print "Vendor: $objItem->{Vendor}\n";
print "Version: $objItem->{Version}\n";
print "\n";
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;
my @computers = ("Computer1");
foreach my $computer (@computers) {
print "\n";
print "==========================================\n";
print "Computer: $computer\n";
print "==========================================\n";
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
my @colItems = $objWMIService->ExecQuery("SELECT Name FROM Win32_ComputerSystemProduct", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);
my $Name = $colItems[0]->{Name};
print "Name: $Name\n";
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use Win32::OLE('in'); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; my @computers = ("Computer1"); foreach my $computer (@computers) { print "\n"; print "==========================================\n"; print "Computer: $computer\n"; print "==========================================\n"; my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery("SELECT Name FROM Win32_ComputerSystemProduct", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); my @objItems=in($colItems); my $Name = $objItems[0]->{Name}; print "Name: $Name\n"; }
my @objItems=in($colItems);
use Win32::OLE('in');
foreach my $objItem (in $colItems)
my @objItems=in($colItems);