You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 09:34:49