使用PowerShell Export-Csv导出AD用户数据时提示“name参数值无效”的问题求助
PowerShell Export-Csv导出AD用户数据时提示“name参数值无效”的问题求助
各位好,我现在尝试把存储AD用户配置文件数据的System.Object对象通过Export-Csv导出到CSV文件,但一直报错,想请大家帮忙看看问题出在哪。
我的$output对象里的AD用户数据结构是这样的:
EmployeeID : ******** EmailAddress : ******** FirstName : ******** LastName : ******** UserPrincipalName : ********
我执行的导出命令如下:
$outputFile = "C:\Users\vbhardw9\AD_Lookup_Powershell\Output.csv" $output | Export-Csv -Path $outputFile -Append -NoTypeInformation -Force
运行后弹出了以下错误信息:
Export-Csv : Cannot process argument because the value of argument "name" is
not valid. Change the value of the "name" argument and run the operation again.
At C:\Users\vbhardw9\AD_Lookup_Powershell\sampleps.ps1:60 char:31
- ... $output | Export-Csv -Path $outputFile -Append -NoTypeInformation - ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidArgument: (:) [Export-Csv], PSArgumentExc
eption- FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.ExportCsv
Command
麻烦各位帮忙分析下这个错误的原因,以及怎么解决这个问题,谢谢!
备注:内容来源于stack exchange,提问作者Vaibhav
相关产品推荐
相关产品推荐

