首页 > 代码库 > Active Directory Recycle Bin

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

本文出自 “AlphaBook” 博客,请务必保留此出处http://alphabook.blog.51cto.com/232573/1883485

Active Directory Recycle Bin