i am having a problem with the output of for-each loop. i am getting the desired output but for the parameters that I have selected, the heading appears before each line which i don't want.
here's my code:
$list = Get-Content C:\Temp\Description\Servers.txt
Foreach ($server in $list)
{
Get-ADComputer -identity $server -properties * | select name,description | ft -autosize
}
please see image below for current and desired output