迁移用户配置文件

迁移用户配置文件

我正在进行新的 VDI 基础架构升级。我们正在从 VMWare Horizo​​n View v5.1 升级到 v6。我从前任管理员那里继承了这个烂摊子。

随着此次升级,我们将把用户数据从漫游配置文件移至重定向配置文件/角色管理以及新的文件服务器。漫游配置文件和各种配置文件数据位于 Server 2008 上,我们正在迁移到 Server 2012 R2。

我目前正在测试 Robocopy,以迁移分散在各个服务器上的不同数据,并将其合并到新服务器上的 1 个用户配置文件位置,因此对于该用户来说,这是一个全面的迁移。在我的脚本中,您可以看到几个逻辑步骤,我将数据从某些文件夹移动到其相应的文件夹,移动根文件夹,并删除重复的文件夹。

我的脚本如下:

REM :Copy roaming profile from old location to new location:

Robocopy \\scfile1\StaffProfiles$\WS\Individual\%username%.v2\Desktop \\pvsc-file03.kdl.net\home$\%username%\Desktop /e /copy:datso /mt:32 
Robocopy \\scfile1\StaffProfiles$\WS\Individual\%username%.v2\Downloads \\pvsc-file03.kdl.net\home$\%username%\Downloads /e /copy:datso /mt:32 
Robocopy \\scfile1\StaffProfiles$\WS\Individual\%username%.v2\Pictures \\pvsc-file03.kdl.net\home$\%username%\Pictures /e /copy:datso /mt:32 
Robocopy \\scfile1\StaffProfiles$\WS\Individual\%username%.v2\Favorites \\pvsc-file03.kdl.net\home$\%username%\Favorites /e /copy:datso /mt:32 
Robocopy \\scfile1\StaffProfiles$\WS\Individual\%username%.v2\Documents \\pvsc-file03.kdl.net\home$\%username%\Documents /e /copy:datso /mt:32 

REM :Copy home profile pictures from old location to new location:

Robocopy \\scfile1\Home\%username%\\"My Pictures" \\pvsc-file03.kdl.net\home$\%username%\Pictures /e /copy:datso /mt:32

REM :Copy home profile music and videos from old location to new persona management location:

Robocopy \\scfile1\Home\%username%\\"My Music" \\pvsc-file03.kdl.net\persona$\%username%.V2\Music /e /copy:datso /mt:32
Robocopy \\scfile1\Home\%username%\\"My Videos" \\pvsc-file03.kdl.net\persona$\%username%.V2\Videos /e /copy:datso /mt:32

REM :Copy home profile documents to new location

Robocopy \\scfile1\Home\%username%\\"My Documents" \\pvsc-file03.kdl.net\home$\%username%\Documents /e /copy:datso /mt:32


REM :Copy remaining home profile root folder from old location to new location:
;
Robocopy \\scfile1\Home\%username%\ \\pvsc-file03.kdl.net\home$\%username%\Documents /e /copy:datso /mt:32

REM :Delete un-needed, duplicate folders that were migrated from the above command:

RD /s /q \\pvsc-file03.kdl.net\home$\%username%\Documents\"My Music" 
RD /s /q \\pvsc-file03.kdl.net\home$\%username%\Documents\"My Videos"
RD /s /q \\pvsc-file03.kdl.net\home$\%username%\Documents\"My Pictures"
RD /s /q \\pvsc-file03.kdl.net\home$\%username%\Documents\"My Documents" 

现在我遇到的问题是,当我以域管理员身份登录到新的文件服务器并运行脚本时,它会将我当前登录的用户名替换为 %username%。有办法解决这个问题吗?

答案1

如果不是,您是否必须从 AD 填充用户列表或使用通配符来获取所有用户?或者仅当日期不早于 robocopy 中的参数时才执行。但登录脚本也可以正常工作 :)

希望你能接受 :)

相关内容