Active Directory Recycle Bin

# Enable Active Directory Recycle Bin

Enable-ADOptionalFeature
 –Identity ‘CN=Recycle Bin Feature,CN=Optional Features,CN=Directory 
Service,CN=Windows NT,CN=Services,CN=Configuration,DC=vccware,DC=com’ 
–Scope ForestOrConfigurationSet –Target ‘vccware.com’

# Restore a single deleted user account

Get-ADObject -Filter {SamAccountName -eq "AlphaBet"} -IncludeDeletedObjects
Get-ADObject -Filter {SamAccountName -eq "AlphaBet"} -IncludeDeletedObjects | Restore-ADObject

# Check the deleted user accounts

Get-ADObject 
 -IncludeDeletedObjects -Filter {IsDeleted -eq $True} -Properties * | 
Format-table Deleted,DisplayName,SamAccountName,UserPrincipalName

# Windows 2012R2 tombstone lifetime of the domain is 180 days by default

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章