Get-ADComputers lastlogon date using input file and export a CSV file.
$Computer = Import-Csv -path “C:\Temp\computers.csv”
$Computer| foreach{Get-ADComputer -Identity $_.name -Properties * |select name, samaccountname, LastLogonDate} | Export-Csv output.csv -NoTypeInformation
Input csv Header:Name
Comments