active-directory – New-ADUser -Name Length太长
发布时间:2021-01-11 12:21:56 所属栏目:Windows 来源:网络整理
导读:我需要向AD中的OU添加大约500个用户 我编写了我需要的所有内容,然而,它给出了错误: 提供的名称不是正确形成的 这是脚本 New-ADUser -Name C080CAB1-9756-409F-914D-AE3971F67DE7 -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-secure
我需要向AD中的OU添加大约500个用户 我编写了我需要的所有内容,然而,它给出了错误: 这是脚本 New-ADUser -Name C080CAB1-9756-409F-914D-AE3971F67DE7 -Path "OU=Staging,DC=domain,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true 我跑了几个测试以确定问题是什么: New-ADUser -Name "C080CAB1-9756-409F-914D-AE3971F67DE7" -Path "OU=Staging,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true New-ADUser -Name 'C080CAB1-9756-409F-914D-AE3971F67DE7' -Path "OU=Staging,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true New-ADUser -Name C080CAB1`-9756`-409F`-914D`-AE3971F67DE7 -Path "OU=Staging,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true 以及其他几个变化 做了什么工作: New-ADUser -Name C080CAB1-9756-409F -Path "OU=Staging,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true 所以我认为这可能是一个长度问题,但我不确定如何使脚本工作. 是否要将名称显示为该36个字符串或登录为36个字符串如果您使用的是服务器2012 R2,则只能将显示名称设置为20个字符,但登录名称最多可以为64个字符(我认为),使用“-UserPrincipalName” 试试这个 New-ADUser -Name C080CAB1-9756-409F-9 -UserPrincipalName C080CAB1-9756-409F-914D-AE3971F67DE7 -Path "OU=Staging,DC=local" -accountPassword (convertto-securestring "zagreb+scotch8355" -asplaintext -force) -PasswordNeverExpires $True -CannotChangePassword $false -Enabled $true 这将创建显示名称并截断-UserPrincipalName的值,该值将是用户的用户登录名. 请参阅任何用户的属性以设置适当的标志. http://thenerdservice.com/useradd.png 您可以看到200之前的登录被截断,但用户登录名不是 http://thenerdservice.com/userlogin.png (编辑:焦作站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- 如何在Linux/Windows/MacOS上使用.NET进行开发
- 详解Linux环境shell脚本获取时间的常用命令总结
- 如何在Windows 10上使用Windows Update目录驱动程
- 树莓派使用入门:教孩子们用树莓派学编程的5种方
- Windows – 如何虚拟化SharePoint ASP应用程序
- ARM版本的Windows 8只能运行Metro(WinRt)风格的应
- 新的Windows漏洞被公开!从Windows 10到XP全体陷
- windows-7 – 机器始终响应192.168.1.2 IP地址,该
- 微软重发通知补丁:反复提醒Windows 7即将终结
- 当驱动器作为“通用”设备呈现时,如何监控Window
热点阅读