开始使用 Windows Admin Center

适用于:Windows Admin Center、Windows Admin Center 预览版

本文介绍如何在下载 Windows 管理中心并将其安装在 Windows PC 上后开始使用它。 下载 Windows Admin Center。 若要了解如何安装,请参阅在 PC 或服务器上安装 Windows Admin Center。 若要详细了解 Windows Admin Center,请参阅 Windows Admin Center概述

在 Windows PC 上打开 Windows Admin Center

Windows Admin Center 使你能够直接从 Windows 10 计算机中使用 Web 浏览器来管理服务器、群集、Windows PC 和 Azure 虚拟机 (VM)。

重要

必须是本地管理员组的成员才能在 Windows 10 上使用 Windows Admin Center。

按照以下步骤在 Windows 电脑上打开 Windows Admin Center:

  1. 在“开始”菜单中,选择“Windows Admin Center”。 或者在搜索栏中键入“Windows Admin Center”,然后从搜索结果中选中。 Windows Admin Center 将在默认浏览器中打开,URL 为 https://localhost:6516/。 或者,也可以通过输入 https://localhost:6516/ 从所需的浏览器启动。

    将显示选择证书进行身份验证证书的提示。

    注意

    Windows Admin Center 的新式网关版本中,系统不会提示你提供证书,而是会要求你登录 Windows Admin Center 网关。 步骤 2 不适用。

  2. 选择标记为“Windows Admin Center 客户端”的证书,然后选择“确定”。 还可以选择“证书信息”链接以查看有关证书的更多详细信息。

    Screenshot of the prompt showing options to select a certificate.

    重要

    确保在出现提示时选择“Windows Admin Center 客户端”证书,而不是任何其他证书。 如果选择任何其他证书,将显示以下错误消息:

    你未被授权查看此页面。 如果你最近更新了 Windows Admin Center,可能需要重启浏览器,然后刷新页面。

    如果在重启浏览器并刷新页面后仍收到相同的错误,请尝试清除浏览器缓存或切换到其他浏览器。 如果这些故障排除步骤均无法解决问题,你可能需要卸载并重新安装 Windows Admin Center,然后重启它。

  3. (仅限首次)出现一个弹出窗口,确认已成功安装 Windows Admin Center 版本。 还会提供有关此版本中的新增功能的信息。 关闭窗口以继续操作。

    Screenshot of the message showing that Windows Admin Center is successfully installed.

    将显示“所有连接”页,其中显示了连接列表下列出的Windows 10计算机名称。 现在可以在 Windows Admin Center 中添加连接。

在 Windows Admin Center 中添加连接

可以从“所有连接”页将连接作为托管节点添加到 Windows Admin Center。 这是用户启动 Windows Admin Center 时显示的默认页面。 在此页面中,可以将现有资源添加为连接,也可以创建新资源。 添加的资源显示在“所有连接”页上的连接列表下。

可以从“所有连接”页添加的资源类型有服务器、Windows PC、群集和 Azure VM,可以创建的资源有群集和 Azure VM。

注意

若要添加或创建 Azure VM,必须先向 Azure 注册 Windows Admin Center。

若要将连接添加到Windows Admin Center:

  1. 单击“所有连接”下的“+ 添加”。

    Screenshot of All Connections page.

  2. 将显示可添加的资源类型。 为要添加的资源类型选择“添加”。

    Screenshot of Add resources page displaying resource types to add.

  3. Windows Admin Center 支持根据资源类型添加资源的各种方法:

    • 一次添加一个资源
    • 通过批量导入添加多个资源
    • 通过搜索 Active Directory 添加资源

    根据要添加资源的方式选择选项卡。 每个选项卡的标签可能因要添加的资源类型而异。

    这是默认方法。 添加群集时,此选项卡的标签显示为“添加群集”。

    1. 选择“添加群集”或“添加群集”选项卡。默认情况下,此选项卡处于选中状态。

    2. 在“资源名称”框中输入资源的名称。

      Screenshot of Add resources page when the Add one tab is selected.

      开始输入文本时,Windows Admin Center 开始根据输入文本字符串搜索资源。 如果找到匹配项,则可以完全按照输入添加名称或使用默认资源名称。 如果未找到匹配项,仍可以添加此资源以显示在连接列表中。


  1. (可选)选择“添加标记”以添加连接标记。 可以使用标记来标识和筛选连接列表中的相关资源。 有关使用标记的详细信息,请参阅使用标记来组织连接

  2. 添加完资源后,选择“添加”。

    所选资源显示在“所有连接”页上的连接列表下。

使用托管节点进行身份验证

将连接添加为托管节点后,必须向托管节点进行身份验证才能连接。 Windows Admin Center 支持多种机制来对托管节点进行身份验证。 单一登录是默认登录。

注意

为了执行远程管理,Windows Admin Center 会模拟所提供的用户的安全上下文,并使用该安全上下文来访问计算机。 所提供的用户在“所有连接”页上的“管理方角色”列下列出。

使用单一登录进行身份验证

可以使用当前的 Windows 凭据向托管节点进行身份验证。 这是默认值,Windows Admin Center 会在用户添加资源后尝试进行单一登录。

在 Windows Server 上部署为服务时,通过单一登录进行身份验证

如果在 Windows Server 上安装 Windows Admin Center,则需要完成其他配置才能进行单一登录。 有关详细信息,请参阅为委派配置环境

通过指定凭据进行身份验证

在“所有连接”下,从列表中选择一个资源,然后选择“管理方式”以指定用于向托管节点进行身份验证的凭据:

Screenshot of the All connections page with the Manage As option.

如果 Windows Admin Center 在 Windows Server 上以服务模式运行,但未配置 Kerberos 委派,则必须重新输入 Windows 凭据:

Screenshot of the Specify your credentials page.

可以将凭据应用于所有连接,这将缓存该特定浏览器会话的凭据。 如果重新加载浏览器,则必须重新输入“管理方式”凭据。

通过本地管理员密码解决方案进行身份验证

如果你的环境使用本地管理员密码解决方案 (LAPS),并且你在 Windows 10 电脑上安装了 Windows Admin Center,则可以使用 LAPS 凭据向托管节点进行身份验证。 如果使用此方案,请在此处提供反馈

使用标记来整理连接

可以使用标记来标识和筛选连接列表中的相关资源。 这样便可以在连接列表中查看资源的子集。 如果有多个连接,这尤其有用。

编辑标记

可以在添加新连接时向连接添加标记。 也可以稍后从“所有连接”页添加或编辑一个或多个连接的标记。

添加或编辑标记:

  1. 从连接列表中选择一个或多个连接。

  2. 选择“编辑标记”。

    Screenshot of the Edit tags option.

    将在右侧打开“可用标记”窗格。

  3. 从所选连接中添加、编辑或删除标记。

    • 若要向所选连接添加新标记,请选择“添加标记”,然后输入所需的标记名称。

    • 若要使用现有标记名称标记所选连接,请选中要应用的标记名称旁边的复选框。

    • 若要从所有选定连接中删除标记,请清除要删除的标记旁边的复选框。

    • 如果标记应用于所选连接的子集,则该复选框以中间状态显示。 选择该复选框即可将其选中,并将标记应用于所有所选连接,也可以再次选中以清除该复选框并从所有选定连接中删除标记。

      Screenshot of the available tags.

  4. 完成后,选择“保存”以保存更改。

按标记筛选连接

将标记添加到一个或多个连接后,可以查看连接列表中的标记,还可以按标记筛选连接列表。

  • 若要按标记进行筛选,请选择搜索框旁边的筛选器图标。

    Screenshot of the filter using the search box.

  • 可以选择“或”、“与”或“非”来修改所选标记的筛选行为。

    Screenshot of the Filter Connections page.

使用 PowerShell 通过标记导入或导出连接

# Load the module
Import-Module "$env:ProgramFiles\windows admin center\PowerShell\Modules\ConnectionTools"
# Available cmdlets: Export-Connection, Import-Connection

# Export connections (including tags) to a .csv file
Export-Connection "https://wac.contoso.com" -fileName "WAC-connections.csv"
# Import connections (including tags) from a .csv file
Import-Connection "https://wac.contoso.com" -fileName "WAC-connections.csv"
# Import connections (including tags) from .csv files, and remove any connections that are not explicitly in the imported file using the -prune switch parameter 
Import-Connection "https://wac.contoso.com" -fileName "WAC-connections.csv" -prune

用于导入连接的 CSV 文件格式

CSV 文件的格式以四个标题("name","type","tags","groupId")开头,在随后的每个新行中列出一个连接。

name 是连接的 FQDN

type 是连接类型。 对于 Windows Admin Center 中包含的默认连接,我们将使用下述设置之一:

连接类型 连接字符串
Windows Server msft.sme.connection-type.server
故障转移群集 msft.sme.connection-type.cluster

tags 以竖线分隔。

groupId 用于共享连接。 在此列中使用 global 值即可将其设置为共享连接。

注意

仅网关管理员可以修改共享连接 - 任何用户都可以使用 PowerShell 修改其个人的连接列表。

用于导入连接的 CSV 文件示例

"name","type","tags","groupId"
"myServer.contoso.com","msft.sme.connection-type.server","hyperv"
"myDesktop.contoso.com","msft.sme.connection-type.windows-server","hyperv"
"teamcluster.contoso.com","msft.sme.connection-type.cluster","legacyCluster|WS2016","global"
"myHCIcluster.contoso.com,"msft.sme.connection-type.cluster","myHCIcluster|hyperv|JIT|WS2019"
"teamclusterNode.contoso.com","msft.sme.connection-type.server","legacyCluster|WS2016","global"
"myHCIclusterNode.contoso.com","msft.sme.connection-type.server","myHCIcluster|hyperv|JIT|WS2019"

注意

CSV 文件区分大小写。

导入 RDCman 连接

请使用以下脚本将 RDCman 中保存的连接导出到某个文件。 然后,可以将该文件导入 Windows Admin Center,并使用标记保留 RDCMan 分组层次结构。 试试吧!

  1. 将以下代码复制并粘贴到你的 PowerShell 会话:

    #Helper function for RdgToWacCsv
    function AddServers {
     param (
     [Parameter(Mandatory = $true)]
     [Xml.XmlLinkedNode]
     $node,
     [Parameter()]
     [String[]]
     $tags,
     [Parameter(Mandatory = $true)]
     [String]
     $csvPath
     )
     if ($node.LocalName -eq 'server') {
         $serverName = $node.properties.name
         $tagString = $tags -join "|"
         Add-Content -Path $csvPath -Value ('"'+ $serverName + '","msft.sme.connection-type.server","'+ $tagString +'"')
     } 
     elseif ($node.LocalName -eq 'group' -or $node.LocalName -eq 'file') {
         $groupName = $node.properties.name
         $tags+=$groupName
         $currNode = $node.properties.NextSibling
         while ($currNode) {
             AddServers -node $currNode -tags $tags -csvPath $csvPath
             $currNode = $currNode.NextSibling
         }
     } 
     else {
         # Node type isn't relevant to tagging or adding connections in WAC
     }
     return
    }
    
    <#
    .SYNOPSIS
    Convert an .rdg file from Remote Desktop Connection Manager into a .csv that can be imported into Windows Admin Center, maintaining groups via server tags. This will not modify the existing .rdg file and will create a new .csv file
    
     .DESCRIPTION
     This converts an .rdg file into a .csv that can be imported into Windows Admin Center.
    
     .PARAMETER RDGfilepath
     The path of the .rdg file to be converted. This file will not be modified, only read.
    
     .PARAMETER CSVdirectory
     Optional. The directory you wish to export the new .csv file. If not provided, the new file is created in the same directory as the .rdg file.
    
     .EXAMPLE
     C:\PS> RdgToWacCsv -RDGfilepath "rdcmangroup.rdg"
     #>
    function RdgToWacCsv {
     param(
         [Parameter(Mandatory = $true)]
         [String]
         $RDGfilepath,
         [Parameter(Mandatory = $false)]
         [String]
         $CSVdirectory
     )
     [xml]$RDGfile = Get-Content -Path $RDGfilepath
     $node = $RDGfile.RDCMan.file
     if (!$CSVdirectory){
         $csvPath = [System.IO.Path]::GetDirectoryName($RDGfilepath) + [System.IO.Path]::GetFileNameWithoutExtension($RDGfilepath) + "_WAC.csv"
     } else {
         $csvPath = $CSVdirectory + [System.IO.Path]::GetFileNameWithoutExtension($RDGfilepath) + "_WAC.csv"
     }
     New-item -Path $csvPath
     Add-Content -Path $csvPath -Value '"name","type","tags"'
     AddServers -node $node -csvPath $csvPath
     Write-Host "Converted $RDGfilepath `nOutput: $csvPath"
    }
    
  2. 若要创建 .CSV 文件,请运行以下命令:

    RdgToWacCsv -RDGfilepath "path\to\myRDCManfile.rdg"
    
  3. 将生成的 .CSV 文件导入 Windows Admin Center,你的所有 RDCMan 分组层次结构将通过连接列表中的标记来表示。 有关详细信息,请参阅使用 PowerShell 通过标记导入或导出连接

查看在 Windows Admin Center 中使用的 PowerShell 脚本

连接到服务器、群集或 PC 后,可以查看支持 Windows Admin Center 中可用的 UI 操作的 PowerShell 脚本。 在工具中,单击顶部应用程序栏中的 PowerShell 图标。 从下拉列表中选择感兴趣的命令,导航到相应的 PowerShell 脚本。

Screenshot of the View PowerShell scripts for Overview page.