Get Active Directory Information from PC's in a text file - Powershell
问题 I am running to an issue with a Powershell command line I'm attempting to run. What we are needing is to get the PC Name and LastLogonDate from PC's in a list of text files with Powershell. Here is the code I'm attempting to run: Get-Content C:\Hosts.txt | ForEach-Object{Get-ADComputer $_ -Properties Name,LastLogonDate | Select-Object Name,LastLogonDate | Export-Csv C:\Output.csv} When I run that code I get an error stating: "Cannot find a object with identity: 'ComputerName'" despite the