none
Powershell script query RRS feed

  • Question

  • Hi,

    When I  pull Handlecount details via script. i am getting output in below format. The command I used is below

    $Lsass_Count = get-process -computername $DC lsass | format-list | findstr "Handles"

    Lsass Handlecount
    Handles : 1461
    Handles : 1917

    Does anyone know , how to remove Handles from the output,I only need the value ?

    Friday, November 13, 2015 5:37 AM

Answers

  • $Lsass_Count = get-process -computername $DC lsass | Select-Object -ExpandProperty Handles

    or

    $Lsass_Count = (get-process -computername $DC lsass).Handles

    Friday, November 13, 2015 6:47 AM