Ok just realized this is C not C++
minor difference
Ok I need the code from this application slightly edited...
Unfortunately I'm overly rusty on this so am asking for a little help...
GetLastLogin
Trying to get the last login date of a mailbox in Exchange.
What I need is an output of
DisplayName, NTUserName, LastLoginDate
THe properties I need...
Code:
LPSPropValue lpDNspv = PpropFindProp(
lpRows->aRow[i].lpProps,
lpRows->aRow[i].cValues,
PR_DISPLAY_NAME );
printf("Display Name: %s\n", lpDNspv->Value.lpszA);
LPSPropValue lpNTUSERspv = PpropFindProp(
lpRows->aRow[i].lpProps,
lpRows->aRow[i].cValues,
PR_NT_USER_NAME );
printf("NT User: %s\n", lpNTUSERspv->Value.lpszA);
LPSPropValue lpLastLogonTimespv = PpropFindProp(
lpRows->aRow[i].lpProps,
lpRows->aRow[i].cValues,
PR_LAST_LOGON_TIME );
fSucceeded = FileTimeToSystemTime(&(lpLastLogonTimespv->Value.ft), &sLogonSystemTime);
if (fSucceeded)
{
TIME_ZONE_INFORMATION tzi;
GetTimeZoneInformation(&tzi);
SystemTimeToTzSpecificLocalTime(&tzi, &sLogonSystemTime, &sLogonLocalTime);
printf("PR_LAST_LOGON_TIME : %2.2d/", sLogonLocalTime.wMonth);
printf("%2.2d/", sLogonLocalTime.wDay);
printf("%2.2d ", sLogonLocalTime.wYear);
printf("%2.2d:", sLogonLocalTime.wHour);
printf("%2.2d\n", sLogonLocalTime.wMinute);
}
This will print out on seperate lines which isn't very useful for me unless I want to create another script that will parse through it.. so if I could get it all on one line that would be awesome!
Anybody up for the challenge?