locked
Delete deleted and recycled Objects from Active Directory Recycle Bin RRS feed

  • Question

  • Hello,

    it is possible to remove the recycled/removed objects from the Active Directory Recycle Bin.

    An offline defragmentation has only worked for longer deleted objects. The TSL has been changed in the meantime so that I have the objects out at least next Monday.

    But the best would be if I could get the objects out today (so that they are finally deleted).

    The operating system is Windows Server 2016.


    Thank you in advance for any answers.


    • Edited by MichiX00 Friday, November 8, 2019 9:08 AM
    Friday, November 8, 2019 6:34 AM

Answers

  • Hi,

    To Delete deleted objects,you can refer to the following commands: 

    Get-ADObject -SearchBase “CN=PC2\0ADEL:129835a7-0d81-4516-99e4-76da0c6fac35,CN=Deleted Objects,DC=test,DC=lab” -Filter {ObjectClass -eq "computer"} -IncludeDeletedObjects -Properties * |Remove-ADObject

     

    Get-ADObject -Filter 'isDeleted -eq $True -and Name -like "*test*"' -IncludeDeletedObjects | Remove-ADObject

    Best Regards,

    Fan

     

    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Monday, November 11, 2019 8:35 AM

All replies

  • Hi,

    To Delete deleted objects,you can refer to the following commands: 

    Get-ADObject -SearchBase “CN=PC2\0ADEL:129835a7-0d81-4516-99e4-76da0c6fac35,CN=Deleted Objects,DC=test,DC=lab” -Filter {ObjectClass -eq "computer"} -IncludeDeletedObjects -Properties * |Remove-ADObject

     

    Get-ADObject -Filter 'isDeleted -eq $True -and Name -like "*test*"' -IncludeDeletedObjects | Remove-ADObject

    Best Regards,

    Fan

     

    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Monday, November 11, 2019 8:35 AM
  • Thanks for your help.
    The problem has already solved itself by changing the Tombstone Lifetime.

    The objects were already deleted with the above mentioned command, but afterwards they are in "isRecycled" - mode from which they disappear only after the TSL has expired.

    (Cant login to my other Account "MichiX00")

    Monday, November 11, 2019 9:18 AM
  • Hi,

    Good to hear that you have solved this issue by yourself. In addition, thanks for sharing your solution in the forum as it would be helpful to anyone who encounters similar issues.

    If there is anything else we can do for you, please feel free to post in the forum.

    Best Regards,

    Fan


    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, November 11, 2019 9:40 AM