Skip to content

Instantly share code, notes, and snippets.

@f-bader
Last active April 30, 2022 16:07
Show Gist options
  • Save f-bader/06fafab0969f44066d4d0d727a8c2552 to your computer and use it in GitHub Desktop.
Save f-bader/06fafab0969f44066d4d0d727a8c2552 to your computer and use it in GitHub Desktop.
dsacls "CN=Deleted Objects,$((Get-ADDomain).DistinguishedName)" /takeownership
dsacls "CN=Deleted Objects,$((Get-ADDomain).DistinguishedName)" /g "$((Get-ADDomain).NetBIOSName)\gmsvc_mdi`$:LCRP"
Enable-ADOptionalFeature -Identity 'Recycle Bin Feature' -Scope ForestOrConfigurationSet -Target (Get-ADDomain).DNSRoot -Confirm:$false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment