Active Directory中的墓碑生存期(TSL)决定了已删除对象在AD中的保留时间上限。原始默认值为60天,自Windows 2003 SP2起的新版本Windows将此值设置为180天。需注意,此设置同时影响备份有效性及域控制器复制——若某域控制器在TSL期限内未与伙伴完成复制,其他域控制器将忽略该节点。详细技术背景可参考:https://adsecurity.org/?p=81
若环境中仍保持60天的旧设置,建议将其更新为180天。此举虽会因删除对象留存时间延长而轻微增加AD数据量,但能为超过60天的数据恢复提供有效的故障保护机制。
以下为使用AD PowerShell模块查询墓碑生存期的代码示例:
1
2
3
4
5
6
7
8
9
10
|
$ADRootDSE = Get-ADRootDSE
$ADConfigurationNamingContext = $ADRootDSE.configurationNamingContext
$TombstoneObjectInfo = Get-ADObject -Identity "CN=Directory Service,CN=Windows NT,CN=Services,$ADConfigurationNamingContext" -Partition "$ADConfigurationNamingContext" -Properties *
[int]$TombstoneLifetime = $TombstoneObjectInfo.tombstoneLifetime
IF ($TombstoneLifetime -eq 0)
{ $TombstoneLifetime = 60 }
Write-Host "AD林墓碑生存期设置为 $TombstoneLifetime 天。"
|