为文件夹重定向以及漫游用户策略文件部署主计算机Deploy primary computers for Folder Redirection and Roaming User Profiles

适用于:Windows 10、Windows 8、Windows 8.1、Windows Server 2019、Windows Server 2016、Windows Server 2012、Windows Server 2012 R2Applies to: Windows 10, Windows 8, Windows 8.1, Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows Server 2012 R2

本主题介绍如何启用主计算机支持,并为用户指定主计算机。This topic describes how to enable primary computer support and designate primary computers for users. 目的是让你可以控制哪些计算机使用文件夹重定向和漫游用户策略文件。Doing so enables you to control which computers use Folder Redirection and Roaming User Profiles.

重要

当为漫游用户策略文件启用主计算机支持时,也始终为文件夹重定向启用主计算机支持。When enabling primary computer support for Roaming User Profiles, always enable primary computer support for Folder Redirection as well. 这样可以将文档和其他用户文件保留在用户配置文件之外,从而有助于保持较小的配置文件保持并缩短登录时间。This keeps documents and other user files out of the user profiles, which helps profiles remain small and sign on times stay fast.

必备条件Prerequisites

软件要求Software requirements

主计算机支持具有以下要求:Primary computer support has the following requirements:

  • 必须更新 Active Directory 域服务 (AD DS) 架构,以包含 Windows Server 2012 架构新增内容(安装 Windows Server 2012 域控制器会自动更新架构)。The Active Directory Domain Services (AD DS) schema must be updated to include Windows Server 2012 schema additions (installing a Windows Server 2012 domain controller automatically updates the schema). 有关更新 AD DS 架构的详细信息,请参阅 Adprep.exe 集成运行 Adprep.exeFor information about updating the AD DS schema, see Adprep.exe integration and Running Adprep.exe.
  • 客户端计算机必须运行 Windows 10、Windows 8.1、Windows 8、Windows Server 2019、Windows Server 2016、Windows Server 2012 R2 或 Windows Server 2012。Client computers must run Windows 10, Windows 8.1, Windows 8, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, or Windows Server 2012.

提示

虽然主计算机支持需要文件夹重定向和/或漫游用户策略文件,但如果是首次部署这些技术,最好在启用配置了文件夹重定向和漫游用户策略文件的 GPO 之前设置主计算机支持。Although primary computer support requires Folder Redirection and/or Roaming User Profiles, if you are deploying these technologies for the first time, it is best to set up primary computer support before enabling the GPOs that configure Folder Redirection and Roaming User Profiles. 这会防止在启用主计算机支持之前将用户数据复制到非主计算机。This prevents user data from being copied to non-primary computers before primary computer support is enabled. 有关详细信息,请参阅部署文件夹重定向部署漫游用户策略文件For configuration information, see Deploy Folder Redirection and Deploy Roaming User Profiles.

步骤 1:为用户指定主计算机Step 1: Designate primary computers for users

部署主计算机支持的第一步是为每个用户指定主计算机。The first step in deploying primary computers support is designating the primary computers for each user. 为此,请使用 Active Directory 管理中心获取相关计算机的可分辨名称,然后设置 msDs-PrimaryComputer 属性 。To do so, use Active Directory Administration Center to obtain the distinguished name of the relevant computers and then set the msDs-PrimaryComputer attribute.

提示

若要使用 Windows PowerShell 来处理主计算机,请参阅博客文章深入了解 Windows 8 主计算机To use Windows PowerShell to work with primary computers, see the blog post Digging a little deeper into Windows 8 Primary Computer.

下面介绍了如何为用户指定主计算机:Here's how to specify the primary computers for users:

  1. 在装有 Active Directory 管理工具的计算机上打开服务器管理器。Open Server Manager on a computer with Active Directory Administration Tools installed.
  2. 在“工具”菜单上,选择“Active Directory 管理中心” 。On the Tools menu, select Active Directory Administration Center. 此时将出现 Active Directory 管理中心。Active Directory Administration Center appears.
  3. 导航到相应域中的“计算机”容器 。Navigate to the Computers container in the appropriate domain.
  4. 右键单击要指定为主计算机的计算机,然后选择“属性” 。Right-click a computer that you want to designate as a primary computer and then select Properties.
  5. 在“导航”窗格中,选择“扩展” 。In the Navigation pane, select Extensions.
  6. 选择“属性编辑器”选项卡,滚动到“distinguishedName”,选择“查看”,右键单击列出的值,依次选择“复制”>“确定”>“取消” 。Select the Attribute Editor tab, scroll to distinguishedName, select View, right-click the value listed, select Copy, select OK, and then select Cancel.
  7. 导航到相应域中的“用户”容器,右键单击想要向其分配计算机的用户,然后选择“属性” 。Navigate to the Users container in the appropriate domain, right-click the user to which you want to assign the computer, and then select Properties.
  8. 在“导航”窗格中,选择“扩展” 。In the Navigation pane, select Extensions.
  9. 选择“属性编辑器”选项卡,选择“msDs-PrimaryComputer”,然后选择“编辑” 。Select the Attribute Editor tab, select msDs-PrimaryComputer and then select Edit. 此时将出现“多值字符串编辑器”对话框。The Multi-valued String Editor dialog box appears.
  10. 右键单击该文本框,依次选择“粘贴”>“添加”>“确定”,然后再次选择“确定” 。Right-click the text box, select Paste, select Add, select OK, and then select OK again.

步骤 2:(可选)在组策略中为文件夹重定向启用主计算机Step 2: Optionally enable primary computers for Folder Redirection in Group Policy

下一步是根据需要配置组策略,以便为文件夹重定向启用主计算机支持。The next step is to optionally configure Group Policy to enable primary computer support for Folder Redirection. 这样做可以在指定为用户的主计算机的计算机上重定向用户的文件夹,但不能在任何其他计算机上进行重定向。Doing so enables a user's folders to be redirected on computers designated as the user's primary computers, but not on any other computers. 可以基于每台计算机或每个用户来控制主计算机使用文件夹重定向。You can control primary computers for Folder Redirection on a per-computer basis, or a per-user basis.

为文件夹重定向启用主计算机:Here's how to enable primary computers for Folder Redirection:

  1. 在“组策略管理”中,右键单击在执行文件夹重定向和/或漫游用户策略文件的初始配置时创建的 GPO(例如“文件夹重定向设置”或“漫游用户策略文件设置”),然后选择“编辑” 。In Group Policy Management, right-click the GPO you created when doing the initial configuration of Folder Redirection and/or Roaming User Profiles (for example, Folder Redirection Settings or Roaming User Profiles Settings), and then select Edit.
  2. 若要使用基于计算机的组策略启用主计算机支持,请导航到“计算机配置” 。To enable primary computers support using computer-based Group Policy, navigate to Computer Configuration. 对于基于用户的组策略,请导航到“用户配置” 。For user-based Group Policy, navigate to User Configuration.
    • 基于计算机的组策略将主计算机处理应用于 GPO 所应用的所有计算机,从而影响计算机的所有用户。Computer-based Group Policy applies primary computer processing to all computers to which the GPO applies, affecting all users of the computers.
    • 基于用户的组策略将主计算机处理应用于 GPO 所应用的所有用户帐户,从而影响用户登录的所有计算机。User-based Group Policy to applies primary computer processing to all user accounts to which the GPO applies, affecting all computers to which the users sign on.
  3. 在“计算机配置”或“用户配置”中,依次导航到“策略”、“管理模板”、“系统”、“文件夹重定向” 。Under Computer Configuration or User Configuration, navigate to Policies, then Administrative Templates, then System, then Folder Redirection.
  4. 右键单击“仅重定向主计算机上的文件夹”,然后选择“编辑” 。Right-click Redirect folders on primary computers only, and then select Edit.
  5. 选择“已启用”,然后选择“确定” 。Select Enabled, and then select OK.

步骤 3:(可选)在组策略中为漫游用户策略文件启用主计算机Step 3: Optionally enable primary computers for Roaming User Profiles in Group Policy

下一步是根据需要配置组策略,以便为漫游用户策略文件启用主计算机支持。The next step is to optionally configure Group Policy to enable primary computer support for Roaming User Profiles. 这样做可使用户的配置文件在指定为用户的主计算机的计算机上漫游,而不是在任何其他计算机上漫游。Doing so enables a user's profile to roam on computers designated as the user's primary computers, but not on any other computers.

下面介绍如何为漫游用户策略文件启用主计算机:Here's how to enable primary computers for Roaming User Profiles:

  1. 为文件夹重定向启用主计算机支持(如果尚未这样做)。Enable primary computer support for Folder Redirection, if you haven't already.
    这样可以将文档和其他用户文件保留在用户配置文件之外,从而有助于保持较小的配置文件保持并缩短登录时间。This keeps documents and other user files out of the user profiles, which helps profiles remain small and sign on times stay fast.
  2. 在“组策略管理”中,右键单击创建的 GPO(例如“文件夹重定向设置”和“漫游用户策略文件设置”),然后选择“编辑” 。In Group Policy Management, right-click the GPO you created (for example, Folder Redirection and Roaming User Profiles Settings), and then select Edit.
  3. 依次导航到“计算机配置”、“策略”、“管理模板”、“系统”、“用户配置文件” 。Navigate to Computer Configuration, then Policies, then Administrative Templates, then System, and then User Profiles.
  4. 右键单击“仅在主计算机上下载漫游配置文件”,然后选择“编辑” 。Right-click Download roaming profiles on primary computers only, and then select Edit.
  5. 选择“已启用”,然后选择“确定” 。Select Enabled, and then select OK.

步骤 4:启用 GPOStep 4: Enable the GPO

完成配置文件夹重定向和漫游用户策略文件后,请启用 GPO(如果尚未这样做)。Once you have completed configuring Folder Redirection and Roaming User Profiles, enable the GPO if you have not already. 这样做可以将其应用于受影响的用户和计算机。Doing so permits it to be applied to affected users and computers.

下面介绍了如何启用文件夹重定向和/或漫游用户策略文件 GPO:Here's how to enable the Folder Redirection and/or Roaming User Profiles GPOs:

  1. 打开“组策略管理”Open Group Policy Management
  2. 右键单击创建的 GPO,然后选择“已启用链接” 。Right-click the GPOs that you created, and then select Link Enabled. 菜单项旁边会出现一个复选框。A checkbox should appear next to the menu item.

步骤 5:测试主计算机功能Step 5: Test primary computer function

若要测试主计算机支持,请登录到一台主计算机,确认已重定向文件夹和配置文件,然后登录到非主计算机并确认未重定向文件夹和配置文件。To test primary computer support, sign in to a primary computer, confirm that the folders and profiles are redirected, then sign in to a non-primary computer and confirm that the folders and profiles are not redirected.

下面介绍了如何测试主计算机功能:Here's how to test primary computer functionality:

  1. 使用已启用文件夹重定向和/或漫游用户策略文件的用户帐户登录到指定的主计算机。Sign in to a designated primary computer with a user account for which you have enabled Folder Redirection and/or Roaming User Profiles.

  2. 如果用户帐户以前登录过计算机,请以管理员身份打开 Windows PowerShell 会话或命令提示符窗口,键入以下命令,然后在系统提示时注销,以确保将最新组策略设置应用到客户端计算机:If the user account has signed on to the computer previously, open a Windows PowerShell session or Command Prompt window as an administrator, type the following command and then sign off when prompted to ensure that the latest Group Policy settings are applied to the client computer:

    Gpupdate /force
    
  3. 打开文件资源管理器。Open File Explorer.

  4. 右键单击重定向的文件夹(例如文档库中的“我的文档”文件夹),然后选择“属性” 。Right-click a redirected folder (for example, the My Documents folder in the Documents library), and then select Properties.

  5. 选择“位置”选项卡,并确认路径显示指定的文件共享,而不是本地路径 。Select the Location tab, and confirm that the path displays the file share you specified instead of a local path. 若要确认该用户配置文件正在漫游,请打开“控制面板”,依次选择“系统和安全”、“系统”、“高级系统设置”、“用户配置文件”部分中的“设置”,然后在“类型”列中查找“漫游” 。To confirm that the user profile is roaming, open Control Panel, select System and Security, select System, select Advanced System Settings, select Settings in the User Profiles section and then look for Roaming in the Type column.

  6. 使用同一个用户帐户登录到未指定为用户主计算机的计算机。Sign in with the same user account to a computer that is not designated as the user's primary computer.

  7. 重复步骤 2-5,而不是查找本地路径和“本地”配置文件类型 。Repeat steps 2–5, instead looking for local paths and a Local profile type.

备注

如果在启用主计算机支持之前已在计算机上重定向文件夹,则这些文件夹将保持重定向,除非在每个文件夹的文件夹重定向策略设置中配置了以下设置:“删除策略时将文件夹重定向回本地用户配置文件位置” 。If folders were redirected on a computer before you enabled primary computer support, the folders will remain redirected unless the following setting is configured in each folder's folder redirection policy setting: Redirect the folder back to the local userprofile location when the policy is removed. 同样,先前在特定计算机上漫游的配置文件将在“类型”列中显示“漫游”;但“状态”列将显示“本地” 。Similarly, profiles that were previously roaming on a particular computer will show Roaming in the Type columns; however, the Status column will show Local.

详细信息More information