#AD Papierkorb aktivieren
Enable-ADOptionalFeature `
-Identity “Recycle Bin Feature” `
-Scope ForestOrConfigurationSet `
-Target “ndsedv.de”
-Confirm:$False
# Funktion prüfen
Get-ADOptionalFeature -Identity “Recycle Bin Feature”
# User im AD markieren und löschen
Get-ADUser -Identity NDS | Remove-ADUser -Confirm:$false
# User prüfen ob vorhanden
Get-ADUser -Identity NDS
# User im Papierkorb suchen
Get-ADObject -Filter {Name -like “NDS*”} -IncludeDeletedObjects
# User wiederherstellen
Get-ADObject -Filter {Name -like “NDS*”} `
-IncludeDeletedObjects | Restore-ADObjects
# User prüfen
Get-ADUser -Identity NDS