GPO 不适用于 Windows 7 及更高版本

GPO 不适用于 Windows 7 及更高版本

有两个域控制器。主域控制器运行在 Windows Server 2008 R2 上,辅助域控制器运行在 Windows Server 2012 上。

当我在主控制器上创建 GPO 时,它会立即连同所有文件和脚本一起复制到辅助域控制器。

在 GPO 中的用户配置部分,我设置了系统环境变量,并在桌面上创建了一个文件夹并在其中创建了快捷方式。

GPO 范围安全过滤包含用户组,该组位于域控制器的 Users 文件夹中。进入该组的成员位于不同的组织单位中。

https://i.stack.imgur.com/MBZez.png

https://i.stack.imgur.com/QTIIP.png

如果我登录运行 Windows XP SP3 的计算机,该策略将立即执行或在运行后执行gpupdate /force。在操作系统版本为 Windows 7 及更高版本(Windows 8.1、Windows 10)的计算机上 - 该策略不起作用,并且不适用于用户。

gpresult /scope user /z > c:\gpo_dump.log看到用户是所需组的成员,但在已应用的 GPO 部分和未接受的 GPO 部分中未找到 GPO。为什么?执行gpupdate /force并有时重新启动无济于事。

答案1

根据您提出的问题的日期,我相信我知道您问题的答案。

2016 年 6 月 14 日发布了 MS Security 更新,该更新改变了 GPO 的行为和用户设置!

到目前为止,所有具有任何用户设置的 GPO 都是在用户安全上下文中应用的。因此,只要用户在安全过滤中列出(如您所见),策略就会应用。

但在 MS 更新后,它们会在计算机环境中应用。因此,如果您在安全过滤中有一个用户或一个组,则仅应用策略中的用户设置是不够的。您还需要读取权限对于用户从中访问 GPO 的计算机。您不必将其列在安全筛选中,但必须至少向计算机或该计算机所属的组添加读取权限(在 GPO 委派选项卡上)。

因此,基本上,如果用户 A 从计算机 B 连接,则您将在安全过滤中列出用户 A,而计算机 B 需要对 GPO 具有读取权限(而不是应用策略权限)。请参阅此链接部署 MS16-072它解释了一切,还提供了修复受影响 GPO 的脚本。MS 建议为经过身份验证的用户向所有 GPO 添加读取权限(这就是他们提供的脚本的用途),但我认为域计算机更安全一些。

这个问题困扰了我好几个星期。我不明白为什么有些 GPO 突然停止工作。都是因为这个。如果如此大规模的改变能得到更多的宣传,我会很感激,因为我很长时间都在完全不安全的环境中运行,因为没有应用任何限制性 GPO。我知道我应该阅读,但我并没有真正阅读我正在应用的所有 MS 更新。我希望这对你有帮助。

这是用于向所有对经过身份验证的用户没有权限的 GPO 添加经过身份验证的用户读取权限的脚本。

    # Copyright (C) Microsoft Corporation. All rights reserved.

$osver = [System.Environment]::OSVersion.Version
$win7 = New-Object System.Version 6, 1, 7601, 0

if($osver -lt $win7)
{
    Write-Error "OS Version is not compatible for this script. Please run on Windows 7 or above"
    return
}

Try
{
    Import-Module GroupPolicy
}
Catch
{
    Write-Error "GP Management tools may not be installed on this machine. Script cannot run"
    return
}

$arrgpo = New-Object System.Collections.ArrayList

foreach ($loopGPO in Get-GPO -All)
{
    if ($loopGPO.User.Enabled)
    {
        $AuthPermissionsExists = Get-GPPermissions -Guid $loopGPO.Id -All | Select-Object -ExpandProperty Trustee | ? {$_.Name -eq "Authenticated Users"}
        If (!$AuthPermissionsExists)
        {
            $arrgpo.Add($loopGPO) | Out-Null
        }
    }
}

if($arrgpo.Count -eq 0)
{
    echo "All Group Policy Objects grant access to 'Authenticated Users'"
    return
}
else
{
    Write-Warning  "The following Group Policy Objects do not grant any permissions to the 'Authenticated Users' group:"
    foreach ($loopGPO in $arrgpo)
    {
        write-host "'$($loopgpo.DisplayName)'"
    }
}

$title = "Adjust GPO Permissions"
$message = "The Group Policy Objects (GPOs) listed above do not have the Authenticated Users group added with any permissions. Group policies may fail to apply if the computer attempting to list the GPOs required to download does not have Read Permissions. Would you like to adjust the GPO permissions by adding Authenticated Users group Read permissions?"

$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
    "Adds Authenticated Users group to all user GPOs which don't have 'Read' permissions"
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
    "No Action will be taken. Some Group Policies may fail to apply"
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice($title, $message, $options, 0)  
$appliedgroup = $null
switch ($result)
{
    0 {$appliedgroup = "Authenticated Users"}
    1 {$appliedgroup = $null}
}
If($appliedgroup)
{
    foreach($loopgpo in $arrgpo)
    {
        write-host "Adding 'Read' permissions for '$appliedgroup' to the GPO '$($loopgpo.DisplayName)'."
        Set-GPPermissions -Guid $loopgpo.Id -TargetName $appliedgroup -TargetType group -PermissionLevel GpoRead | Out-Null
    }
}

如果您希望为域计算机而不是身份验证用户设置读取权限,只需将其更改0 {$appliedgroup = "Authenticated Users"}0 {$appliedgroup = "Domain Computers"}

添加澄清说明:

无论您希望将 GPO 设置应用到哪台计算机、用户或组,都需要在安全筛选中列出。在安全筛选中列出计算机用户或组实际上意味着,您为计算机、用户或组授予了 GPO 的两个权限 - 一个权限是读取,另一个权限是应用组策略。委派选项卡为您提供了更详细地向 GPO 分配权限的选项,但您可以检查,如果您在安全筛选选项卡中添加计算机、用户或组,它将出现在委派选项卡上,并具有这两个权限读取和应用。

通过将计算机、用户或组添加到委派选项卡并授予其读取权限,您不会将 GPO 应用于它。您只是允许它读取 GPO。

让我们总结一下 -

  • 要应用 GPO 计算机设置,您需要将计算机(或其所在的组)列入安全过滤中。
  • 要应用 GPO 用户设置,您需要在安全过滤中列出用户(或其所在的组),并且需要授予用户访问 GPO 的计算机(或其所在的组)对 GPO 的读取权限。

我希望这能为你澄清这一点。

相关内容