I am modifying the 'Inactive Computers' report so we can see a calculation of the days since the computer was active. I added a script column, and have this script. It doesn't seem to be getting the last logon date though as it returns 0. If I put a real date ($starttime = '5/6/19'), it does the calculation as expected. I also tried enclosing the %lastLogonTimeStamp% in quotes as I usually end up doing in powershell scripts but that didn't help.
# Assign a column value to $Context.Value
$starttime = %lastLogonTimestamp%
$endtime = (get-date)
$timespan = NEW-TIMESPAN -Start $starttime -End $endtime
$Context.Value = $timespan.days
I am trying to use Adaxes to make my team more efficient so thanks for your help on my recent tickets.