简体   繁体   English

如何使用Powershell更改Active Directory中的显示名称?

[英]How can I change the display name in Active Directory with powershell?

How can I change the Name attribute in Active Directory in powershell? 如何在Powershell的Active Directory中更改Name属性?

在此处输入图片说明

I would like to change the 'Name' row, but when I enter the following I get an error: 我想更改“名称”行,但是当我输入以下内容时出现错误:

Set-ADuser -Identity test1 -Name Test 11

The error message: 错误信息:

Set-ADUser : A parameter cannot be found that matches parameter name 'Name'.
At line:1 char:28
+ Set-ADUser -Identity test1 -Name Test 11
+                            ~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser

您应该使用cmdlet Rename-ADObject更改AD对象的名称属性。

如果您想一次更改一个帐户的多个属性(例如更改用户名),则将PassThru参数添加到Set-AdUser ,然后通过管道传递到Rename-ADObject

Set-ADUser -Identity "test1" -DisplayName "DisplayName" -GivenName "GivenName" -Surname "Surname" -PassThru | Rename-ADObject -NewName "TestAccount1" -PassThru

暂无
暂无

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

相关问题 Powershell Active Directory 脚本 - 通过更改显示名称批量禁用 - Powershell Active Directory Scripting - Bulk disable with change of display name 我可以使用Powershell在Active Directory中更改自己的密码吗? - Can I change my own password in Active Directory using Powershell 使用Powershell列出活动目录用户显示名称,OU和上次密码更改日期 - list active directory User Display Name, OU and last password change date using powershell 如何从powershell显示活动目录浏览器 - How to display active directory browser from powershell 如何在PowerShell中将所有Active Directory计算机读入阵列? - How can I read all Active Directory computers into an array in PowerShell? 如何使用 Powershell 添加用户并添加到 Active Directory 中? - How can I add a user and add in Active Directory with Powershell? 当我的计算机不是域成员时,非管理员如何使用 PowerShell 更改我的活动目录密码? - How can I, a non-administrator, change my active directory password using PowerShell, when my computer is not a member of the domain? 我如何在Active Directory中修改此powershell代码,以便在从CSV文件中清空单元格时能够更改属性? - How can I modify this powershell code in Active Directory, to be able to change attributes when emply cells from csv file? 如何检索具有Powershell的递归目录名? - How can I retrieve recursive directory name w/ Powershell? Powershell:如何从 Azure Active Directory 用户获取名称 (Get-AzADUser) - Powershell: How do I get the name from Azure Active Directory user (Get-AzADUser)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM