I am looking to find the way to add the "days since last log-on" field in the following Powershell script.
Can someone please help me in tweaking the following script to add the days since last logon (value in days) field please.
Import-Module ActiveDirectory
Get-ADComputer -Filter * -Property * | Select-object Name,DistinguishedName,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion,LastLogonDate,CanonicalName | Export-CSV AllServers.csv -NoTypeInformation -Encoding UTF8
Thanks
Amit R