$list = gwmi win32_process -computername "Useaihp460" -filter "name='w3wp.exe'" | Select-Object @{Name="WS";Expression={ ($_.WS/ 1MB).ToString("0,000.0") } }, @{Name="VM";Expression={ ($_.VM / 1MB).ToString("0,000.0") } },@{Name="ProcessId";Expression={ $_.ProcessId.ToString("00000") } }, @{Name="Name";Expression={ $_.Name.ToString() } },@{Name="CommandLine";Expression={ $_.CommandLine.ToString() } }
Write-Host “WS VM ProcessId Application Pool Name”
$list | foreach {
$from = "c:\windows\system32\inetsrv\w3wp.exe -ap ".Length + 1
$locdll = $_.commandLine.IndexOf("webengine4.dll")
$poolnam = $locdll-16-$from
$len=$_.commandLine.Length
$memory = "4096"
$name1 = $_.commandLine.Substring($from , $poolnam)
Write-Host $_.WS $_.VM $_.processId $name1
#"WS:{0:N0} VM:{1:N0} ProcessId:{2,6} Name:{3,6} Pool:{4}" -f $_.WS.ToString("00,000,000,000"), $_.VM.ToString("00,000,000,000"), $_.processId, $_.name, $name1
#@{Name="WS";Expression={ ($_.WS / 1MB).ToString("0,000.0") } },
#@{Name="VM";Expression={ ($_.VM / 1MB).ToString("0,000.0") } }
}
No comments:
Post a Comment