[POC]从思杰UPM迁移到微软FSLogix Profile容器

如果生产环境中发现UPM的处理机制已经无法胜任用户需求,这时候该考虑迁移到FSLogix配置文件容器了。

例如我们的LAB环境已经定义了UPM Profile和User Data的分离机制:

收藏下载来自微软大神的转换模块:

https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RE4k26R

解压后目录结构如下:

如果直接导入该PS模块时,会发现如下3项警告:

建议使用最新的能科学联网的Windows Server 2019系统,安装如下组件:第三个组件可能需要代理。

Install-WindowsFeature RSAT-AD-PowerShell
Install-WindowsFeature Hyper-V,Hyper-V-PowerShell
Install-Module -Name Pester -RequiredVersion 5.2.2 -SkipPublisherCheck

安装后需要重启,重新导入模块Import-Module ‘C:\shell$\FSLogixMigration’开始转换:

执行针对Windows 7/2008R2的命令:

Convert-UPMProfile -ParentPath “C:\profile\” -Target “C:\VHDX\” -VHDMaxSizeGB 40 -VHDLogicalSectorSize 512 -VHD -LogPath C:\conlog.txt

执行针对Windows 7以上系统的命令:

Convert-UPMProfile -ParentPath “C:\profile\” -Target “C:\VHDX\” -VHDMaxSizeGB 40 -VHDLogicalSectorSize 512 -LogPath C:\conlog.txt

以上的区别就是强制定义转换后的VHD/x的格式,默认是VHDX,在Windows 7上无法使用。

滚屏信息如下:

PS C:\> Convert-UPMProfile -ParentPath "C:\profile\" -Target "C:\VHDX\" -VHDMaxSizeGB 40 -VHDLogicalSectorSize 512 -VHD -LogPath C:\conlog.txt

BytesCopied FilesCopied
----------- -----------
   98997731        1104
Source and Destination match.
                       
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1131_zangyf
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1131_zangyf\Profile_zangyf.vhd
已成功处理 2 个文件; 处理 0 个文件时失败
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1131_zangyf
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1131_zangyf\Profile_zangyf.vhd
已成功处理 2 个文件; 处理 0 个文件时失败
C:\profile\zangyf Migrated. Duration: 00:00:14
   60108261         282
Source and Destination match.
                       
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: D:\Profile
已成功处理 1 个文件; 处理 0 个文件时失败
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1132_zhaokm
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1132_zhaokm\Profile_zhaokm.vhd
已成功处理 2 个文件; 处理 0 个文件时失败
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1132_zhaokm
已处理的文件: C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1132_zhaokm\Profile_zhaokm.vhd
已成功处理 2 个文件; 处理 0 个文件时失败
C:\profile\zhaokm Migrated. Duration: 00:00:12

-----------------------------------------------------
Profile Migration Completed. 


Source: C:\profile\
Target: C:\VHDX\

Start time: 08/04/2021 16:42:35
End time: 08/04/2021 16:43:01
Duration: 00:00:26
    
Total Profiles: 2
Eligible Profiles: 2
Successful Migrations: 2
Skipped Migrations: 0
Failed Migrations: 0

Successful Migration List:
C:\profile\zangyf
C:\profile\zhaokm

-----------------------------------------------------


PS C:\> 

cnlog.txt信息如下:

***************************************************************************************************
08/04/2021 16:40:37 - Started processing
***************************************************************************************************


08/04/2021 16:40:37 - -----------------------------------------------------------------------------
08/04/2021 16:40:37 - Beginning Migration of C:\profile\
08/04/2021 16:40:37 - -----------------------------------------------------------------------------
08/04/2021 16:40:37 - Profile C:\profile\ Could not resolve to AD User. Cannot copy.


***************************************************************************************************
08/04/2021 16:40:37 - Finished processing
***************************************************************************************************
08/04/2021 16:42:35 - -----------------------------------------------------------------------------
08/04/2021 16:42:35 - Beginning Migration of C:\profile\zangyf
08/04/2021 16:42:35 - -----------------------------------------------------------------------------
08/04/2021 16:42:35 - Creating, formatting, and mounting VHD.
08/04/2021 16:42:40 - Mounting VHD C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1131_zangyf\Profile_zangyf.vhd
08/04/2021 16:42:46 - Beginning copy from C:\profile\zangyf\UPM_Profile to D:\Profile\.
08/04/2021 16:42:46 - Analyzing robocopy job ...
08/04/2021 16:42:46 - Staging arguments: "C:\profile\zangyf\UPM_Profile " "D:\Profile\ " /LOG:"C:\Windows\temp\2021-08-04 16-42-46 robocopy staging.log" /L /COPYALL /MIR /NP /NDL /NC /BYTES /NJH /NJS /XJ /R:0 /XD "C:\profile\zangyf\UPM_Profile$RECYCLE.BIN" "C:\profile\zangyf\UPM_ProfileSystem Volume Information"
08/04/2021 16:42:47 - Total bytes to be copied: 99095765
08/04/2021 16:42:47 - Beginning the robocopy process with arguments: "C:\profile\zangyf\UPM_Profile " "D:\Profile\ " /LOG:"C:\Windows\temp\2021-08-04 16-42-47 robocopy.log" /ipg:0 /COPYALL /MIR /NP /NDL /NC /BYTES /NJH /NJS /XJ /R:0 /XD "C:\profile\zangyf\UPM_Profile$RECYCLE.BIN" "C:\profile\zangyf\UPM_ProfileSystem Volume Information"
08/04/2021 16:42:47 - Verifying Source Matches Destination
08/04/2021 16:42:48 - Source and Destination match.
08/04/2021 16:42:48 - Converting user SID: S-1-5-21-3813273639-3919113018-1358082606-1131, for SAM
08/04/2021 16:42:48 - SID converted to SAM: zangyf
08/04/2021 16:42:48 - Searching GUID for user zangyf
08/04/2021 16:42:48 - GUID found: fe24c225-d2c6-43d7-82f7-5d2b9b158257
08/04/2021 16:42:48 - Converting user SID: S-1-5-21-3813273639-3919113018-1358082606-1131, for hex format
08/04/2021 16:42:48 - SID converted to HEX format: 53,2d,31,2d,35,2d,32,31,2d,33,38,31,33,32,37,33,36,33,39,2d,33,39,31,39,31,31,33,30,31,38,2d,31,33,35,38,30,38,32,36,30,36,2d,31,31,33,31
08/04/2021 16:42:48 - Concatanating path for .reg file
08/04/2021 16:42:48 - Path for .reg file: D:\Profile\AppData\local\FSLogix\ProfileData.reg
08/04/2021 16:42:48 - Creating content for .reg file
08/04/2021 16:42:48 - Content for .reg file created
08/04/2021 16:42:48 - Testing path for .reg file
08/04/2021 16:42:48 - Saving generated content for .reg file
08/04/2021 16:42:48 - Generated content for .reg file saved
08/04/2021 16:42:48 - Adding User and System NTFS Permissions
08/04/2021 16:42:48 - Dismounting C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1131_zangyf\Profile_zangyf.vhd
08/04/2021 16:42:49 - C:\profile\zangyf Migrated. Duration: 00:00:14
08/04/2021 16:42:49 - -----------------------------------------------------------------------------
08/04/2021 16:42:49 - Beginning Migration of C:\profile\zhaokm
08/04/2021 16:42:49 - -----------------------------------------------------------------------------
08/04/2021 16:42:49 - Creating, formatting, and mounting VHD.
08/04/2021 16:42:53 - Mounting VHD C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1132_zhaokm\Profile_zhaokm.vhd
08/04/2021 16:42:59 - Beginning copy from C:\profile\zhaokm\UPM_Profile to D:\Profile\.
08/04/2021 16:42:59 - Analyzing robocopy job ...
08/04/2021 16:42:59 - Staging arguments: "C:\profile\zhaokm\UPM_Profile " "D:\Profile\ " /LOG:"C:\Windows\temp\2021-08-04 16-42-59 robocopy staging.log" /L /COPYALL /MIR /NP /NDL /NC /BYTES /NJH /NJS /XJ /R:0 /XD "C:\profile\zhaokm\UPM_Profile$RECYCLE.BIN" "C:\profile\zhaokm\UPM_ProfileSystem Volume Information"
08/04/2021 16:43:00 - Total bytes to be copied: 60109013
08/04/2021 16:43:00 - Beginning the robocopy process with arguments: "C:\profile\zhaokm\UPM_Profile " "D:\Profile\ " /LOG:"C:\Windows\temp\2021-08-04 16-43-00 robocopy.log" /ipg:0 /COPYALL /MIR /NP /NDL /NC /BYTES /NJH /NJS /XJ /R:0 /XD "C:\profile\zhaokm\UPM_Profile$RECYCLE.BIN" "C:\profile\zhaokm\UPM_ProfileSystem Volume Information"
08/04/2021 16:43:00 - Verifying Source Matches Destination
08/04/2021 16:43:00 - Source and Destination match.
08/04/2021 16:43:00 - Converting user SID: S-1-5-21-3813273639-3919113018-1358082606-1132, for SAM
08/04/2021 16:43:00 - SID converted to SAM: zhaokm
08/04/2021 16:43:00 - Searching GUID for user zhaokm
08/04/2021 16:43:00 - GUID found: deedac6c-34f6-4746-b9b7-a38448fe9fab
08/04/2021 16:43:00 - Converting user SID: S-1-5-21-3813273639-3919113018-1358082606-1132, for hex format
08/04/2021 16:43:00 - SID converted to HEX format: 53,2d,31,2d,35,2d,32,31,2d,33,38,31,33,32,37,33,36,33,39,2d,33,39,31,39,31,31,33,30,31,38,2d,31,33,35,38,30,38,32,36,30,36,2d,31,31,33,32
08/04/2021 16:43:00 - Concatanating path for .reg file
08/04/2021 16:43:00 - Path for .reg file: D:\Profile\AppData\local\FSLogix\ProfileData.reg
08/04/2021 16:43:00 - Creating content for .reg file
08/04/2021 16:43:00 - Content for .reg file created
08/04/2021 16:43:00 - Testing path for .reg file
08/04/2021 16:43:00 - Saving generated content for .reg file
08/04/2021 16:43:00 - Generated content for .reg file saved
08/04/2021 16:43:00 - Adding User and System NTFS Permissions
08/04/2021 16:43:01 - Dismounting C:\VHDX\S-1-5-21-3813273639-3919113018-1358082606-1132_zhaokm\Profile_zhaokm.vhd
08/04/2021 16:43:01 - C:\profile\zhaokm Migrated. Duration: 00:00:12


***************************************************************************************************
08/04/2021 16:43:01 - Finished processing
***************************************************************************************************

转换结果达到预期:

超出预期的地方:

虽然重定向目录里的数据是两份,但已经不是重定向关系了。