I am attempting to create a PowerShell command that finds and exports the owner of each distribution list provided in a CVS.
[PS] C:\WINDOWS\system32>Import-Csv $path_import | ForEach-Object {Get-QADGroup $_.Identity | select ManagedBy,Name | Export-Csv $path_export}
Currently the script will output to the screen the information I am trying to capture but only export the last line.
Any assistance would be appreciated.
try this:
Import-Csv $path_import | ForEach-Object {Get-QADGroup $_.Identity |
select ManagedBy,Name } | Export-Csv $path_export -notypeinformation