foreach ($pcin$machine) {Get-ADComputer$pc-Properties*|selectname,LastLogonDate|out-filec:\temp\missing\LL.txt-Append}
foreach
($pcin$machine) {(Get-ADComputer$pc-Properties*).LastLogonDate |out-filec:\temp\missing\LL.txt-Append}
The first line of code returns what I want, the computer name and the lastlogdate but the output is terrible. It adds lots of --------- and lots of white spaces.
The second line is what I want but it only gives me the LastLogonDate. how do I juse the ). to get both the name and lastlogondate?