使用csv文件更新AD属性 [英] Update AD attribute using csv file
问题描述
您好,
我想使用csv文件更新AD中的多个用户详细信息。 所有用户名都列在'name'下的文件中,用于更新的列称为'type'。
我需要为每个用户更新extensionattribute1并尝试以下操作:
Import-CSV C:\ Temp\ITTest.csv |
ForEach-Object {Get-ADUser -Filter" Name -eq`" $($ _.Name)`"" -Properties extensionAttribute1 | Set-ADUser -add @ {" extensionAttribute1" =" $($ _。类型)"}
我收到的错误是"为只能有一个属性的属性指定了多个值价值"
任何人都知道实现这一目标的方法吗?谢谢
使用-Replace而不是-Add。
Hi,
I would like to update multiple user details in AD using a csv file. All user names are listed in the file under 'name' and the column to use for updating is called 'type'.
I need to update the extensionattribute1 for each user and have tried the following:
Import-CSV C:\Temp\ITTest.csv | ForEach-Object {Get-ADUser -Filter "Name -eq `"$($_.Name)`"" -Properties extensionAttribute1 | Set-ADUser -add @{"extensionAttribute1" = "$($_.Type)"}
I receive the error that "multiple values were specified for an attribute that can have only one value"
Anyone know of a way to achieve this? Thanks
Hi,
Use -Replace instead of -Add.
这篇关于使用csv文件更新AD属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!