I have the following code in a ForEach loop to log output to a CSV file but am having trouble getting it to populate thelastLogonTimestamp values... the output just comes out blank. All the other columns are populating fine. The value definitely exists in AD for these disabled users. I have a hunch that it has something to do with the actual value (e.g. - 130100816639918715) vs. the displayed value (e.g. - 4/10/2013 11:34:23 AM Eastern Standard Time). The syntax is categorized as "Large Integer/Interval." Any ideas?
#Create new object for logging. $obj = New-Object PSObject $obj | Add-Member -MemberType NoteProperty -Name "Name" -Value $DisabledUser.name $obj | Add-Member -MemberType NoteProperty -Name "samAccountName" -Value $DisabledUser.samaccountname $obj | Add-Member -MemberType NoteProperty -Name "DistinguishedName" -Value $DisabledUser.DistinguishedName $obj | Add-Member -MemberType NoteProperty -Name "lastLogonTimestamp" -Value $DisabledUser.lastLogonTimestamp $obj | Add-Member -MemberType NoteProperty -Name "Status" -Value 'Disabled' #Adds object to the log array. $LogArray += $obj #Exports log array to CSV file in the temp directory with a date and time stamp in the file name. $logArray | Export-Csv "C:\Temp\User_Report_$logDate.csv" -NoTypeInformation