locked
Output not False but Yes/no RRS feed

  • General discussion

  • Hi i will see user acount status locked out, but not "false"/"true" .I will see yes or not how can this

    -----------------------------------------------

    if acount locked is false then  write output "yes" else "not"

    Get-ADUser $ComputerName -Properties LockedOut | Select-Object -ExpandProperty LockedOut

    thanks

    Friday, November 29, 2019 12:38 PM

All replies

  • You can use Select-Object with a calculated property to achieve this. Please read the complete help including the examples to learn how to use it. 

    ... or you can use a filter and output only locked accounts. ;-)


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    • Edited by BOfH-666 Friday, November 29, 2019 3:28 PM
    Friday, November 29, 2019 3:26 PM
  • Why does that matter?

    -- Bill Stewart [Bill_Stewart]

    Friday, November 29, 2019 6:15 PM