Removing AD Computer Objects

Welcome Forums General PowerShell Q&A Removing AD Computer Objects

This topic contains 2 replies, has 2 voices, and was last updated by

4 years, 8 months ago.

  • Author
  • #17330

    Points: 0
    Rank: Member


    I have a list of AD Computer Objects that i need to remove. Does anyone have a script to hand that will read through the list (txt) and remove them ?

  • #17331

    Points: 638
    Helping Hand
    Rank: Major Contributor

    To keep it simple, it's a one-liner:

    Get-Content C:\MyComputers.txt | foreach{Get-ADComputer -Identity $_ | Remove-ADComputer -WhatIf}

    After you validate the command is identify the correct object to remove, you can remove the -WhatIf to actually perform a move.

  • #17332

    Points: 0
    Rank: Member

    Fantastic – Cheers Rob!

The topic ‘Removing AD Computer Objects’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort