如何在Dfs中使用基于Access的枚举?

因此,Windows Server Dfs显然在Server 2008上支持基于访问的枚举(ABE)。但是,它似乎并不能用于开箱即用,只是在根目录中创build链接会使其对域中的每个人都可见,而不pipe用户是否具有对目标的读取权限。

那么如何使它工作?

根据Dfs ABE的文档,需要满足以下两个条件:

  1. ABE需要为有问题的Dfs根目录启用
  2. 链接需要更新权限的用户和组需要看到他们

所以1.很容易。 一个简单的电话

dfsutil property abde enable \\<domain>\<DfsRoot> 

会做需要的 2.更复杂,因为您可能不想手动设置链接权限。 基本的想法是脚本阅读链接目标的权限和调用

 dfsutil property acl grant \\<domain>\<DfsRoot> <permission list> 

与收集的数据。 PowerShell是在这里select的工具。 这个脚本很简单,只要在这里列出就可以处理一个级别的Dfs链接:

 # Dfs-SetLinkACEsToTargetACEs.ps1 # Automation for Access-Based Enumeration on Dfs links # Call: .\Dfs-SetLinkACEsToTargetACEs.ps1 -DfsRootPath \\<Domain>\<DfsRoot> Param ( [Parameter(Mandatory=$true)] [string]$DfsRootPath ) Get-ChildItem $DfsRootPath | ForEach-Object { $DfsTargetPath = $_.FullName $AccessGrant = @() $AccessDeny = @() (Get-Acl $DfsTargetPath).Access | ForEach-Object { # exclude security principals which do not resolve correctly If (-not ($_.IdentityReference.Value -like "S-1-5-21*")) { If ($_.AccessControlType -eq "Allow") { $AccessGrant += "$($_.IdentityReference):R" } If ($_.AccessControlType -eq "Deny") { $AccessDeny += "$($_.IdentityReference):R" } } } If ($AccessGrant.Count -gt 0) { dfsutil property acl grant "$DfsTargetPath" $AccessGrant Protect Replace } If ($AccessDeny.Count -gt 0) { dfsutil property acl deny "$DfsTargetPath" $AccessDeny } } 

您显然可以通过在其中一台服务器上创build计划任务来自动执行此操作。

请注意,您需要在链接目标和Dfs根上的pipe理委派中至less具有“读取权限”才能成功执行。