PSScripts/Enable-ADRecycleBin.ps1
2023-12-18 18:01:11 +00:00

5 lines
431 B
PowerShell

# Enables the Active Directory Recycle Bin Feature.
Enable-ADOptionalFeature -Confirm -Identity 'Recycle Bin Feature' -Scope 'ForestOrConfigurationSet' -Target (Get-ADDomain).Forest -Server ((HOSTNAME) + "." + (Get-ADDomain).Forest)
Enable-ADOptionalFeature "Recycle Bin Feature" -server ((Get-ADForest -Current LocalComputer).DomainNamingMaster) -Scope ForestOrConfigurationSet -Target (Get-ADForest -Current LocalComputer)