hello, i’m totally new to Powershell. I’m trying to retrieve computer information, by using a text file with a list of computer names. but my line will not work. please help.
$CN = Get-Content -Path “c:\scripts\computername.txt” Get-EventLog -ComputerName $CN -LogName Application -Newest 10 | Export-Csv -Path “c:\scripts\test.txt”.
The computers are in a Active Directory network. Should I be using Get-ADComputer?