简体   繁体   English

如何使用 CSV 将 ADUsers 从 WinSrv2003 导出/导入到 WinSrv2016?

[英]How to Export/Import ADUsers from WinSrv2003 to WinSrv2016 using CSV?

I got a WinSrv2003 with an Active Directory (old domain, about 80 Users) and a freshly installed WinSrv2016 with an blank AD (new domain, different name).我得到了一个带有 Active Directory(旧域,大约 80 个用户)的 WinSrv2003 和一个新安装的带有空白 AD(新域,不同名称)的 WinSrv2016。 I want to avoid migrating the Users by Hand.我想避免手动迁移用户。

Using csvde I got a list of the Users with every attribute (-l *).使用 csvde 我得到了每个属性(-l *)的用户列表。 I cut it down, left the necessary Attributes (plus 3 additional for comfort) and changed the old domain information to the new one ("manually" in Excel afterwards).我把它剪下来,留下必要的属性(加上 3 个额外的属性)并将旧域信息更改为新域信息(之后在 Excel 中“手动”)。 I saved the CSV and tried importing the Users with "csvde -i ..." but the CLI said that the attribute list could not be read.我保存了 CSV 并尝试使用“csvde -i ...”导入用户,但 CLI 说无法读取属性列表。

After that I tried to import the Users via PowerShell but got an Error saying that attribute xy (ou in this case) is not "unique".之后,我尝试通过 PowerShell 导入用户,但出现错误,指出属性 xy(在本例中为 ou)不是“唯一的”。 (I'm german and don't know the english error words) (我是德国人,不知道英文错误词)

Since I am german I thought that it might be an Excel problem since Excel change commas and semicolons in Germany, but Powershell seemed to get the different columns, so...由于我是德国人,我认为这可能是 Excel 问题,因为 Excel 在德国更改了逗号和分号,但是 Powershell 似乎得到了不同的列,所以...

Thanks!谢谢! (I'm new to stackoverflow so if sth is missing or so I can provide more information) (我是 stackoverflow 的新手,所以如果缺少某些内容,或者我可以提供更多信息)


Used attributes w example:使用的属性 w 示例:

DN - CN=John Smith,OU=Unit,DC=domain,DC=local DN - CN=John Smith,OU=Unit,DC=domain,DC=local

objectClass - user对象类 - 用户

ou - [empty] ou - [空]

distingueshedName - CN=John Smith,OU=Unit,DC=domain,DC=local distingueshedName - CN=John Smith,OU=Unit,DC=domain,DC=local

name - John Smith姓名 - 约翰·史密斯

cn - John Smith cn - 约翰史密斯

sn - Smith sn - 史密斯

givenName - John给定的名字 - 约翰

displayName - John Smith显示名称 - 约翰史密斯

homeDirectory - \\\\10.10.10.10\\home$\\john.smith homeDirectory - \\\\10.10.10.10\\home$\\john.smith

homedrive - S:家庭驱动器-S:

scriptpath - logon-script.cmd脚本路径 - 登录脚本.cmd

samaccountname - john.smith samaccountname - john.smith

userprincipalname - john.smith@domain.local用户主体名称 - john.smith@domain.local

If you only need to do it once, you can download a trial version of an app like Adaxes with nice GUI and do all the import/export stuff there.如果您只需要执行一次,您可以下载 Adaxes 等具有漂亮 GUI 的应用程序的试用版,然后在那里执行所有导入/导出操作。 They've also got a tutorial about importing users via PowerShell and how your CSV should be structured to make it work perfectly if you decide to go the PowerShell route.他们还有一个关于通过 PowerShell 导入用户的教程,以及如果您决定采用 PowerShell 路线,您的 CSV 应该如何构建以使其完美运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM