Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell output running out of space

$
0
0

Hi,

When i am running a script to get Name, IP and OU details from a list of computers. The output of the script is truncated.

Name                       IPv4Address                DistinguishedName       
----                       -----------                -----------------       
PS6645                     10.44.168.215              CN=PS6645,OU=Computers...

machine distingushedname is not shown completely. Who can i increase the width of the output.

I tried to use OUT-file and Export-csv But not getting the complete format.

SCRIPT --

$Computers = "d:\checkfile.txt"      # contants list of persistent machines
$Comp = Get-Content $Computers
ForEach ($Computer In $Comp)
{
  Try
  {
    Get-ADComputer $Computer -Properties * | FT Name,IPv4Address,DistinguishedName | Out-File -Enc UTF8 -Append .\found.txt
  }
  Catch
  {
    $Computer  + "    not-in-AD" | Out-File -Enc UTF8 -Append .\notfound.csv  # stores output in this file
  }
}


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>