Active Directory墓碑生命周期安全指南

本文详细讲解Active Directory中墓碑生命周期的概念、默认值演变及其对备份和复制的影响,并提供了使用PowerShell查询该值的具体代码示例,帮助管理员优化AD环境安全配置。

Active Directory安全提示 #7:墓碑生命周期

Active Directory中的墓碑生命周期(TSL)决定了已删除对象在AD中保留的时间限制。原始值为60天。自Windows 2003 SP2以来的Windows版本将此值设置为180天。需要注意的是,这也会影响备份有效期和复制——如果域控制器在TSL期限内未与其伙伴进行复制,其他域控制器将忽略它。(参考:https://adsecurity.org/?p=81)

如果您的环境中仍设置为60天,建议将其更新为180天。这可能会略微增加AD的体积,因为已删除对象会保留更长时间,但如果您需要恢复超过60天的数据,这确实提供了一种故障安全机制。

使用PowerShell查询墓碑生命周期

以下是通过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 天。"
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计