Cleanup Inactive AD Accounts w/ PowerShell Pt 2: Get-Date, ForEach-Object

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 4

  • @manuelvalencia6560
    @manuelvalencia6560 3 года назад

    How to catch or avoid error if the ForEach-Object loop already found that the user/computer is already disabled?

    • @CarlHillIT
      @CarlHillIT  3 года назад

      Once an Active Directory computer is disabled, it can't be disabled more/again, so I have never had a need to avoid disabling an already disabled computer. If the error interferes with the script, you can try to add -ErrorAction Ignore to the part in the script that disables the computer.

  • @rochdiferjani6778
    @rochdiferjani6778 Год назад

    Where can i find the script please ?!

    • @CarlHillIT
      @CarlHillIT  Год назад

      I've updated the link in the description, but you can find the scripts and writeups here: github.com/carlhillit/RUclips/tree/main/Cleanup%20Inactive%20Accounts