如何使用多租户托管权限在 Azure 上部署 Windows 10How to deploy Windows 10 on Azure with Multitenant Hosting Rights

对于其用户使用 Windows 10 企业版 E3/E5 或使用 Windows 虚拟桌面访问(用户订阅许可证或附加设备用户订阅许可证)的客户,通过使用 Windows 10 多租户托管权限,他们可以在云中使用其 Windows 10 许可证并在 Azure 上运行 Windows 10 虚拟机,无需购买其他许可证。For customers with Windows 10 Enterprise E3/E5 per user or Windows Virtual Desktop Access per user (User Subscription Licenses or Add-on User Subscription Licenses), Multitenant Hosting Rights for Windows 10 allows you to bring your Windows 10 Licenses to the cloud and run Windows 10 Virtual Machines on Azure without paying for another license. 多租户托管权限仅适用于 Windows 10(版本 1703 或更高版本)。Multitenant Hosting Rights are only available for Windows 10 (version 1703 or later).

备注

符合多租户托管权限的订阅许可证Subscription Licenses that qualify for Multitenant Hosting Rights

使用 Microsoft 管理中心,可以确认是否已向用户分配支持 Windows 10 的许可证。Using the Microsoft admin center, you can confirm if a user has been assigned a Windows 10 supported license.

重要

若要在 Azure 中使用 Windows 10 映像,用户必须具有以下订阅许可证之一。Users must have one of the below subscription licenses in order to use Windows 10 images in Azure. 如果你没有这些订阅许可证,可通过云服务合作伙伴或直接通过 Microsoft 购买。If you do not have one of these subscription licenses, they can be purchased through your Cloud Service Partner or directly through Microsoft.

符合条件的订阅许可证:Eligible subscription licenses:

  • Microsoft 365 E3/E5Microsoft 365 E3/E5
  • Microsoft 365 F3Microsoft 365 F3
  • Microsoft 365 A3/A5Microsoft 365 A3/A5
  • Windows 10 企业版 E3/E5Windows 10 Enterprise E3/E5
  • Windows 10 教育版 A3/A5Windows 10 Education A3/A5
  • Windows VDA E3/E5Windows VDA E3/E5

通过 Azure 市场部署 Windows 10 映像Deploying Windows 10 Image from Azure Marketplace

对于 PowerShell、CLI 和 Azure 资源管理器模板部署,可使用 PublisherName: MicrosoftWindowsDesktopOffer: Windows-10 找到 Windows 10 映像。For PowerShell, CLI and Azure Resource Manager template deployments, Windows 10 images can be found using the PublisherName: MicrosoftWindowsDesktop and Offer: Windows-10. 多租户托管权限支持 Windows 10 版本创意者更新 (1809) 或更高版本。Windows 10 version Creators Update (1809) or later is supported for Multitenant Hosting Rights.

$location="chinaeast"
Get-AzVmImageSku -Location $location -PublisherName 'MicrosoftWindowsDesktop' -Offer 'Windows-10'

Skus                        Offer      PublisherName           Location 
---- -----      ------------- -------- 
rs4-pro                     Windows-10 MicrosoftWindowsDesktop chinaeast   
rs4-pron                    Windows-10 MicrosoftWindowsDesktop chinaeast   
rs5-enterprise              Windows-10 MicrosoftWindowsDesktop chinaeast   
rs5-enterprisen             Windows-10 MicrosoftWindowsDesktop chinaeast   
rs5-pro                     Windows-10 MicrosoftWindowsDesktop chinaeast   
rs5-pron                    Windows-10 MicrosoftWindowsDesktop chinaeast  

有关可用映像的详细信息,请参阅通过 Azure PowerShell 查找并使用 Azure 市场 VM 映像For more information on available images see Find and use Azure Marketplace VM images with Azure PowerShell

将 Windows 10 VHD 上传到 AzureUploading Windows 10 VHD to Azure

如果要上传通用化的 Windows 10 VHD,请注意,Windows 10 不会默认启用内置 Administrator 帐户。if you are uploading a generalized Windows 10 VHD, please note Windows 10 does not have built-in administrator account enabled by default. 若要启用内置 Administrator 帐户,请在自定义脚本扩展中包含以下命令。To enable the built-in administrator account, include the following command as part of the Custom Script extension.

Net user <username> /active:yes

以下 PowerShell 代码片段用于将所有管理员(包括内置 Administrator)帐户标记为活动帐户。The following PowerShell snippet is to mark all administrator accounts as active, including the built-in administrator. 如果内置 Administrator 用户名未知,此示例非常有用。This example is useful if the built-in administrator username is unknown.

$adminAccount = Get-WmiObject Win32_UserAccount -filter "LocalAccount=True" | ? {$_.SID -Like "S-1-5-21-*-500"}
if($adminAccount.Disabled)
{
    $adminAccount.Disabled = $false
    $adminAccount.Put()
}

参考信息:For more information:

使用多租户托管权限部署 Windows 10Deploying Windows 10 with Multitenant Hosting Rights

确保已安装并配置最新的 Azure PowerShellMake sure you have installed and configured the latest Azure PowerShell. 准备好 VHD 之后,即可使用 Add-AzVhd cmdlet 将 VHD 上传到 Azure 存储帐户,如下所示:Once you have prepared your VHD, upload the VHD to your Azure Storage account using the Add-AzVhd cmdlet as follows:

Add-AzVhd -ResourceGroupName "myResourceGroup" -LocalFilePath "C:\Path\To\myvhd.vhd" `
    -Destination "https://mystorageaccount.blob.core.chinacloudapi.cn/vhds/myvhd.vhd"

使用 Azure 资源管理器模板部署进行部署 在资源管理器模板中,可为 licenseType 指定一个附加参数。Deploy using Azure Resource Manager Template Deployment Within your Resource Manager templates, an additional parameter for licenseType can be specified. 可以阅读有关创作 Azure Resource Manager 模板的详细信息。You can read more about authoring Azure Resource Manager templates. 将 VHD 上传到 Azure 之后,请编辑 Resource Manager 模板以将许可证类型包含为计算提供程序的一部分,然后照常部署模板:Once you have your VHD uploaded to Azure, edit you Resource Manager template to include the license type as part of the compute provider and deploy your template as normal:

"properties": {
    "licenseType": "Windows_Client",
    "hardwareProfile": {
        "vmSize": "[variables('vmSize')]"
    }

通过 PowerShell 部署 通过 PowerShell 部署 Windows Server VM 时,可使用 -LicenseType 的附加参数。Deploy via PowerShell When deploying your Windows Server VM via PowerShell, you have an additional parameter for -LicenseType. 将 VHD 上传到 Azure 之后,可以使用 New-AzVM 创建 VM 并指定许可类型,如下所示:Once you have your VHD uploaded to Azure, you create a VM using New-AzVM and specify the licensing type as follows:

New-AzVM -ResourceGroupName "myResourceGroup" -Location "China North" -VM $vm -LicenseType "Windows_Client"

验证 VM 是否正在利用许可权益Verify your VM is utilizing the licensing benefit

通过 PowerShell 或 Resource Manager 部署方法部署 VM 之后,请使用 Get-AzVM 验证许可证类型,如下所示:Once you have deployed your VM through either the PowerShell or Resource Manager deployment method, verify the license type with Get-AzVM as follows:

Get-AzVM -ResourceGroup "myResourceGroup" -Name "myVM"

输出类似于许可证类型正确的 Windows 10 的以下示例:The output is similar to the following example for Windows 10 with correct license type:

Type                     : Microsoft.Compute/virtualMachines
Location                 : chinanorth
LicenseType              : Windows_Client

以下 VM 在部署时未提供 Azure 混合使用权益许可(例如直接从 Azure 库部署 VM),可看出其中的输出差异:This output contrasts with the following VM deployed without Azure Hybrid Use Benefit licensing, such as a VM deployed straight from the Azure Gallery:

Type                     : Microsoft.Compute/virtualMachines
Location                 : chinanorth
LicenseType              :

有关联接 Azure AD 的其他信息Additional Information about joining Azure AD

Azure 使用内置 Administrator 帐户预配所有 Windows,但不能使用此方法联接 AAD。Azure provisions all Windows VMs with built-in administrator account, which cannot be used to join AAD. 例如,“设置”>“帐户”>“访问工作或学校帐户”>“+连接”将不起作用。For example, Settings > Account > Access Work or School > +Connect will not work. 若要手动加入 Azure AD,必须创建另一个管理员帐户并以其身份登录。You must create and log on as a second administrator account to join Azure AD manually. 还可以使用预配包配置 Azure AD,使用“后续步骤”部分的链接了解详细信息。You can also configure Azure AD using a provisioning package, use the link in the Next Steps section to learn more.

后续步骤Next Steps