Hi,
I am trying to get the Last Logon Date and Time but I am getting only Date in "dd/MM/yyyy". Can anyone please point out how to get date in "dd/MM/yyyy hh:mm tt" format
Here is the code I have right now.
function TBLDATA {
$(quser.exe /server:$ServerAddr 2>&1 | findstr "Active") -replace "^[\s>]","" -replace "\s+","," | ConvertFrom-Csv -Header $Header | ForEach-Object {
$dListItem = New-Object System.Windows.Forms.ListViewItem ($_.USER_NAME)
$dListItem.Subitems.Add($_.SESSION_NAME) | Out-Null
$dListItem.Subitems.Add($_.SESS_ID) | Out-Null
$dListItem.Subitems.Add($_.STATUS) | Out-Null
$dListItem.Subitems.Add($_.IDLETIME) | Out-Null
$dListItem.Subitems.Add($_.LOGONTIME) | Out-Null
$dList.Items.Add($dListItem) | Out-Null
}
}