Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

前面和大家聊到Azure虚拟桌面支持个人桌面和池桌面的桌面发布形式。那这两种桌面发布形式究竟有什么区别,又有哪些需要注意的地方呢 ?

  • 个人桌面:个人主机池顾名思义就是每个用户都用一台单独的桌面来满足其办公要求,这个桌面是永久性桌面,不会随着用户的注销,重新等了而改变,用户可以修改桌面的配置以满足个人喜好,也可以将文件保存在桌面环境中。那个人桌面呢,主要适用于一些在办公时对计云服务算机性能要求比较高的用户,比如公司的财务人员,公司的设计人员等等
  • 池桌面:也称为avdb改成什么了非持久性桌面,也就是说当用户发起链接的时候,会将用户分配到当时可用的任何会话主机,当然,前提是我们有授权用户对于回话主机的访问。具体如何进分配,取决于我们avdc在配置回话主机时指定的负载均衡算法以及每个会话主机可以进的会话云计算大数据数。因为池桌面的用户每次登录的azuredragon会话主机都不是固定的,所以我们就需要一种方式在外部保存云计算技术与应用用户相关数据,来实现用户每次登录都会保持原有的个人配置信息

在传统的VDI架构中,用户配置Azure虚拟桌面文件存储在文件服务器上,在用户登录时下载到本地,并在用户注销时上传到文件服务器。这种方法的缺点是每次都必须复制文件数据。随着用户配置文件越大,所需登录所需的时间就越长。

云服务平台Azure虚拟桌面中,微软建议使用FSLogix来对非持久性用户的用户配置文件的管理,使用FSLogix配置文件管理可azurewave以有效的避免以前使用UPM时云计算导论因上传和下载数据造成用户登陆等待时间较长的问题。相比azure配音之下,FSLogi云服务oppox 将用户配置文件视为 VHD 格式(虚拟硬盘)。用户在登录时自动挂载 VHDX 文件,这比复制数据快得多,并且与用户配置文件的大小无关。管理员可以为 VHD 文件选择多个保存目的地。可以使用使用 Azure VM 的文件服务器,但如果使用 AVD,微云计算导论推荐使用 Azure Files,Azure 的托管文件共享服务。

使用 FSLogix 配置文件容器,管理员可以在非持久环境(如池化 Windows 虚拟桌面主机池)中维护用户上下文(例如应用程序设置)。它将优化最终用户的登录时间,因为用户配置文件存用户配置文件备份改成本地储在每次用户登录时安装到相关会话主机 VM 的 VHD(X) 文件中,因此无需先下载任何内容。

聊了这么多,接下来我们就一起来看下如何配置用户数据漫游。

准备配置脚本

下载配置脚本:
ht云计算导论tps://githurslogix5000b.com/Azure-Samples/azure-f用户配置文件备份改成本地iles-samples/releases


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

下载完成,如下图所示:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

解压完成:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

编辑配置脚本如下:

#Change the execution policy to unblock importing AzFilesHybrid.psm1 module

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser



\# Navigate to where AzFilesHybrid is unzipped and stored and run to copy the files into your path

.\CopyToPSPath.ps1



\#Import AzFilesHybrid module

Import-Module -Name AzFilesHybrid



\#Login with an Azure AD credential that has either storage account owner or contributer Azure role assignment

Connect-AzAccount -Environment AzureChinaCloud



\#!!!请修改!!!!!

\#Define parameters #error1:" 'wvdtestfsloginx01' has more than 15 characters"

$SubscriptionId = "3a16e97c-**<strong>-</strong><strong>-9a18-ab</strong>*********<strong>"

$ResourceGroupName = "</strong><strong>-</strong><strong>-RG"

$StorageAccountName = "</strong>******"



\#Select the target subscription for the current session

Select-AzSubscription -SubscriptionId $SubscriptionId



\# Register the target storage account with your active directory environment under the target OU (for example: specify the OU with Name as "UserAccounts" or DistinguishedName as "OU=UserAccounts,DC=CONTOSO,DC=COM").

\# You can use to this PowerShell cmdlet: Get-ADOrganizationalUnit to find the Name and DistinguishedName of your target OU. If you are using the OU Name, specify it with -OrganizationalUnitName as shown below. If you are using the OU DistinguishedName, you can set it with -OrganizationalUnitDistinguishedName. You can choose to provide one of the two names to specify the target OU.

\# You can choose to create the identity that represents the storage account as either a Service Logon Account or Computer Account (default parameter value), depends on the AD permission you have and preference.

\# Run Get-Help Join-AzStorageAccountForAuth for more details on this cmdlet.

\# get OU:Get-ADOrganizationalUnit -Filter 'Name -like "*"'



Join-AzStorageAccountForAuth `

-ResourceGroupName $ResourceGroupName `

-StorageAccountName $StorageAccountName `

-DomainAccountType "ComputerAccount" <# Default is set as ComputerAccount #> `

-OrganizationalUnitDistinguishedName "OU=WVD,OU=****,DC=cloudmsp,DC=club" <#[dsquery OU -name afs] If you don't provide the OU name as an input parameter, the AD identity that represents the storage account is created under the root directory. #> `

-EncryptionType "AES256,RC4" <# Specify the encryption agorithm used for Kerberos authentication. Default is configured as "'RC4','AES256'" which supports both 'RC4' and 'AES256' encryption. #>



\#Run the command below if you want to enable AES 256 authentication. If you plan to use RC4, you can skip this step.

\#Update-AzStorageAccountAuthForAES256 -ResourceGroupName $ResourceGroupName -StorageAccountName $StorageAccountName



\#CheckJoinADStatus检查存储账号加入AD的状态

\# Get the target storage account

$storageaccount = Get-AzStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName

\# List the directory service of the selected service account

$storageAccount.AzureFilesIdentityBasedAuth.DirectoryServiceOptions

\# List the directory domain information if the storage account has enabled AD DS authentication for file shares

$storageAccount.AzureFilesIdentityBasedAuth.ActiveDirectoryProperties



\#You can run the Debug-AzStorageAccountAuth cmdlet to conduct a set of basic checks on your AD configuration with the logged on AD user. This cmdlet is supported on AzFilesHybrid v0.1.2+ version. For more details on the checks performed in this cmdlet, see Azure Files Windows troubleshooting guide.

Debug-AzStorageAccountAuth -StorageAccountName $StorageAccountName -ResourceGroupName $ResourceGroupName -Verbose

将存储账户加入AD

运行脚本,将存储账户加入AD:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

计算机账avdc户创建完成:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

rslogix5000查存储账户加域状态:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

配置存储账户权限

编辑脚本文件:

$SubscriptionId = "3a16e97c-**<strong>-</strong><strong>-9a18-ab</strong>*********<strong>"

$ResourceGroupName = "</strong><strong>-</strong><strong>-RG"

$StorageAccountName = "</strong>****<strong>"

$sharename = "</strong>*****"



\#Constrain the scope to the target file share

$scope = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Storage/storageAccounts/$StorageAccountName/fileServices/default/fileshares/$sharename"


\#Use one of the built-in roles: Storage File Data SMB Share Reader, Storage File Data SMB Share Contributor, Storage File Data SMB Share Elevated Contributor

$rolename = "Storage File Data SMB Share Elevated Contributor"

$UPN = "wvdadmin@cloudmsp.club"

\#Get the name of the custom role

$FileShareContributorRole = Get-AzRoleDefinition $rolename

\#Assign the custom role to the target identity with the specified scope.

New-AzRoleAssignment -SignInName $UPN -RoleDefinitionName $FileShareContributorRole.Name -Scope $scope

\#Check Assign Status

\#get-AzRoleAssignment -signinname $UPN

\#remove-assign

\#remove-AzRoleAssignment -signinname $UPN -RoleDefinitionName $rolename -Scope $scope

\#Assign to Group

$GroupRolename = "Storage File Data SMB Share Contributor"

$GroupFileShareContributorRole = Get-AzRoleDefinition $GroupRolename

$ObjectId = "c9b3b6be-a038-4b6e-a404-36b226378f43"

New-AzRoleAssignment -ObjectId $ObjectId -RoleDefinitionName $GroupFileShareContributorRole.Name -Scope $scope

\#Check Assign Status

\#get-AzRoleAssignment -ObjectId $ObjectId

\#Group remove-assign

\#remove-AzRoleAssignment -ObjectId $ObjectId -RoleDefinitionName $rolename -Scope $scope

生产变量存储:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

配置权限:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

分配存储账户权限:


                                            Azure Virtual Desktop 实战部署之配置用户数据漫游-存储账户准备

配置完成,如下图所示: