4 Einträge, 1 Seite |
1 2 3
sub _{s;;xrqIpiql\\{}p{pl{R>rl{N{}gjwpkssq]>rl{N;;;*{{}=*{_};; ${{}={q{{{}}}=>[reverse+split+reverse+q;}{;]};${{}->{q{{{}}}}->[@{{}];} ${{}=reverse+_(q{{}}=>q{{}})^chr(30)x+length&_(q{{}}=>,q{{}})and+print;
QuoteWin32::OLE operating in debugging mode: _Unique => 1
Error - Win32::Process::Info::WMI failed to get winmgs object:
Win32::OLE(0.1701) error 0x800706ba: "Der RPC-Server ist nicht verfügbar"
after character 0 in
"winmgmts:{impersonationLevel=impersonate}!//NT/root/cimv2" at xxx line 7
1 2 3
sub _{s;;xrqIpiql\\{}p{pl{R>rl{N{}gjwpkssq]>rl{N;;;*{{}=*{_};; ${{}={q{{{}}}=>[reverse+split+reverse+q;}{;]};${{}->{q{{{}}}}->[@{{}];} ${{}=reverse+_(q{{}}=>q{{}})^chr(30)x+length&_(q{{}}=>,q{{}})and+print;
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!perl -w
use strict;
use Win32::OLE qw(in);
#Mode: Window Management Instrumentation (WMI)
# processproperties
my @properties = qw(Caption CreationClassName CreationDate CSCreationClassName
CSName Description ExecutablePath ExecutionState Handle
HandleCount InstallDate KernelModeTime MaximumWorkingSetSize
MinimumWorkingSetSize Name OSCreationClassName OSName
OtherOperationCount OtherTransferCount PageFaults PageFileUsage
ParentProcessId PeakPageFileUsage PeakVirtualSize PeakWorkingSetSize
Priority PrivatePageCount ProcessId QuotaNonPagedPoolUsage
QuotaPagedPoolUsage QuotaPeakNonPagedPoolUsage QuotaPeakPagedPoolUsage
ReadOperationCount ReadTransferCount SessionId Status TerminationDate
ThreadCount UserModeTime VirtualSize WindowsVersion WorkingSetSize
WriteOperationCount WriteTransferCount);
# processmethods
my @methods = qw(Create Terminate GetOwner GetOwnerSid);
my $server = ''; # local machine
my $locatorObj = Win32::OLE->new('WbemScripting.SWbemLocator')
or die ("Error in creating locator object: ".Win32::OLE->LastError()."\n");
$locatorObj->{Security_}->{impersonationlevel} = 3;
my $serverObj = $locatorObj->ConnectServer($server, 'root\cimv2')
or die ("Error in creating server object: ".Win32::OLE->LastError)."\n");
my $procSchema = $serverObj->Get('Win32_Process');
#@properties = map{ $_->{Name} } (in $procSchema->{Properties_});
#@methods = map{ $_->{Name} } (in $procSchema->{Methods_});
foreach my $process (in $serverObj->InstancesOf("Win32_Process")){
foreach (@properties){
printf ("'%20s' => '%s'\n", $_, $process->{$_} || '' );
}
print ("-----------------------------------------------\n");
}
4 Einträge, 1 Seite |