Advertisement
Guest User

Untitled

a guest
May 24th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Get-Content -Path "c:\users\tyler.hampton\desktop\Computers.txt" | ForEach-OBject {
  2. Get-ADComputer -Filter {Name -like$_} -Properties *  | Sort LastLogonDate | FT Name, LastLogonDate, LastLogonUser, Location -Autosize | Add-Content C:\users\tyler.hampton\desktop\ComputerLastLogonDate.txt
  3. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement