直接上脚本了。
#获取进程信息
function Get-InfoProc {
param(
$ComputerName
)
$procs = Get-WmiObject -class Win32_Process -ComputerName $ComputerName
foreach ($proc in $procs) {
$props = @{'ProcName'=$proc.name;
'Executable'=$proc.ExecutablePath}
New-Object -TypeName PSObject -Property $props
}
}
#或者NIC信息
function Get-InfoNIC {
param(
$ComputerName
)
$nics = Get-WmiObject -class Win32_NetworkAdapter -ComputerName $ComputerName -Filter "PhysicalAdapter=True"
foreach ($nic in $nics) {
$props = @{'NICName'=$nic.servicename;
'Speed'=$nic.speed / 1MB -as [int];
'Manufacturer'=$nic.manufacturer;
'MACAddress'=$nic.macaddress}
New-Object -TypeName PSObject -Property $props
}
}
以上脚本信息,请大家参考。