»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 07-31-2003, 07:05 PM   #1 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
C++ Help Need edits

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?

vass0922 is offline   Reply With Quote
Old 08-06-2003, 01:03 PM   #2 (permalink)
Registered User
 
Gait_Keeper's Avatar
 
Join Date: Feb 2003
Location: Da Bronx, NY
Posts: 1,709
Gait_Keeper is on a distinguished road
Send a message via AIM to Gait_Keeper
oh sorry vass I don't know code
Gait_Keeper is offline   Reply With Quote
Old 08-06-2003, 01:35 PM   #3 (permalink)
Banned
 
Siliconjunkie's Avatar
 
Join Date: Feb 2003
Location: Houston, TX
Posts: 1,595
Siliconjunkie is on a distinguished road
Send a message via AIM to Siliconjunkie
Can you give an example of the output? Parsing it shouldnt be that hard. I can prolly come up with something, but it wont be in C.
Siliconjunkie is offline   Reply With Quote
Old 08-06-2003, 07:22 PM   #4 (permalink)
Registered User
 
Join Date: Feb 2002
Posts: 161
Martee is on a distinguished road
Ok, so all you want to do is modify the above code to produce the output on a single line? Just look through all the printf() calls and remove all instances of \n. If you want them to be comma separated, just replace the \n's with commas.
Martee is offline   Reply With Quote
Old 08-06-2003, 07:35 PM   #5 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
Quote:
Originally posted by Martee
Ok, so all you want to do is modify the above code to produce the output on a single line? Just look through all the printf() calls and remove all instances of \n. If you want them to be comma separated, just replace the \n's with commas.

OMG!
I'm a freakin' TARD!

Duh
printf doesn't automatically throw in the carriage return


Thanks I'll try that
vass0922 is offline   Reply With Quote
Old 08-06-2003, 08:38 PM   #6 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
OK that DID do what I wanted it to do!

but now the (*&@#(*& app doesn't work right
it will get me like 2 or 3 mailboxes and die
there's still 500 more on that server alone
arghhhhhh

actually this app kinda sucks because to use it I will have to login to a profile on every mailbox for it to work

bah
details
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 01:53 AM.