Powershell 仅导出为CSV返回字符串长度
我正试图让这个脚本导出到CSV文件,它只列出了字符串长度,而不是我试图拉的电子邮件Powershell 仅导出为CSV返回字符串长度,powershell,export-to-csv,Powershell,Export To Csv,我正试图让这个脚本导出到CSV文件,它只列出了字符串长度,而不是我试图拉的电子邮件 Get-ADGroup -filter {name -like 'Security Group'} | Get-ADGroupMember -Recursive | Get-ADUser -Properties Mail | select -ExpandProperty Mail | Export-Csv -NoType MyCSVfile1.csv Export Csv希望接
Get-ADGroup -filter {name -like 'Security Group'} |
Get-ADGroupMember -Recursive |
Get-ADUser -Properties Mail |
select -ExpandProperty Mail |
Export-Csv -NoType MyCSVfile1.csv
Export Csv
希望接收一个对象,您给了它一个字符串,因此它在输出文件中为您提供了该字符串的属性(即,Length
)
放下-ExpandProperty
,一切都会好起来的
Get-ADGroup -filter {name -like 'Security Group'} |
Get-ADGroupMember -Recursive |
Get-ADUser -Properties Mail |
Select Mail |
Export-Csv -NoType MyCSVfile1.csv
Export Csv
希望接收一个对象,您给了它一个字符串,因此它在输出文件中为您提供了该字符串的属性(即,Length
)
放下-ExpandProperty
,一切都会好起来的
Get-ADGroup -filter {name -like 'Security Group'} |
Get-ADGroupMember -Recursive |
Get-ADUser -Properties Mail |
Select Mail |
Export-Csv -NoType MyCSVfile1.csv
否则,只需将值列表写入一个文件:
…|选择-Expand Mail | Set Content MyCSVfile1.csv
。否则只需将值列表写入一个文件:。|选择-展开邮件|设置内容MyCSVfile1.csv
。哇,我感觉自己像个傻瓜。非常感谢你!哇,我觉得自己像个傻瓜。非常感谢你!