I have been using the following command to output the last known login of a list of computers set for decommissioning. The script works but only on the currently logged on DC. How can I get it to cycle through all DCs in the network.
Get-Content C:\noresponse.csv | Foreach-Object {Get-ADComputer $_ -Properties LastLogonDate} | SortLastLogonDate | FT Name, LastLogonDate -Autosize |Out-File C:\TempComputerLastLogonDa