【发布时间】:2014-05-29 01:36:26
【问题描述】:
我正在尝试从下面的脚本中批量更新用户的 AD 属性,但我不断收到以下错误:
Import-Csv : Cannot process argument because the value of argument "name" is invalid. Change the value of the "name" argument and run the operation again.
At line:1 char:11
从此脚本:
Import-Csv c:\update.csv | ForEach-Object { Set-QADUser -Identity $_.sAMAccountName -ObjectAttributes @{department={$_.department} ;
company={$_.company} ;
physicalDeliveryOfficeName={$_.physicalDeliveryOfficeName} ;
telephoneNumber={$_.telephoneNumber} ;
wWWHomePage={$_.wWWHomePage} ;homePhone={$_.homePhone};
title={$_.title}}}
非常感谢任何帮助。
谢谢
【问题讨论】:
-
这听起来像是 CSV 文件本身的问题。试着自己做,不要用管道输出。
标签: windows powershell csv attributes active-directory