active-directory – New-ADUser -Name Length太长
发布时间:2021-01-11 16:46:00 所属栏目: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 (编辑:鞍山站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-7 – 为什么Windows 7上的FIND会出现“拒绝访问”错
- 现在你可以借助Insync在Linux中原生使用OneDrive
- Windows 10不好用?你不可不知的Windows 10技巧
- windows-server-2008 – 限制Windows Server 2008上的7zip
- windows-server-2003 – 从死Windows域控制器中获取FSMO角色
- 微软官方预热Win11秋季新品发布会 将公布新的Surface Pro 8
- 弃Windows转Linux,韩国政府能成么?
- win10通知中心怎么关掉声音 win10通知中心声音设置方法
- Win10麦克风声音怎么调整 Win10麦克风声音调节方法
- 5个开源的速读应用
推荐文章
站长推荐
热点阅读
