我正在尝试从CSV文件中获取AD组所有者的列表,第二列是我要从中提取的内容,标题为Owners I Want to Keep the Output If Ware Failure All。我是否可以只修改代码中的“Foreach”部分?
Get-Content "C:\tmp\SMB.csv" -OutVariable | foreach {
Get-ADGroup -identity $_ -properties name,managedby| select name,managedby |
out-file c:\temp\test.csv -Append }
1条答案
按热度按时间nkoocmlb1#
要获取所有者值,只需使用