Hello,
I’m trying to get a list from AD of computers that have not logged to the network in the last 60 days. I have the command worked and just need a bit of help with the date format. What I currently have is:
$LLDate = (Get-Date).AddDays(-60)
Get-ADComputer -Filter * -Properties Name, LastLogonDate, DistinguishedName |
Where { $_.LastLogonDate -lt $LLDate } | Sort LastLogonDate -Descending |
FT Name, LastLogonDate, DistinguishedName -AutoSize
This displays [blockquote]COLINS 31/07/2013 16:13:26 CN=COLINS,CN=Computers,DC=domain,DC=local
IT-TESTPC 25/07/2013 00:54:12 CN=IT-TESTPC,CN=Computers,DC=domain,DC=local
WASIMA 15/07/2013 10:55:46 CN=WASIMA,CN=Computers,DC=domain,DC=local[/blockquote]
Can I get the LastLogonDate to just display as dd/mm/yyyy format?
Thanks
Tony