-
July 31st, 2010, 03:38 PM
#1
C++ ActiveDirectory user information problem
Hi I have some problem with my code which should view user information.
#include "stdafx.h"
#include "activeds.h"
#include <exception>
#include <atlbase.h>
using namespace std;
int main(int argc, char* argv[])
{
IADsUser *pUser;
HRESULT hr = CoInitialize(NULL);
VARIANT telephone;
hr = ADsGetObject(L"WinNT://domena.local
/robert",IID_IADsUser,(void**)&;pUser);
if (FAILED(hr)) {
printf("blad");
return NULL;}
BSTR bstr;
hr = pUser->get_EmailAddress(&bstr);
printf("email: %S\n", bstr);
bstr=L"\n";
hr = pUser->get_FullName(&bstr);
printf("fullname: %S\n", bstr);
bstr=L"\n";
hr = pUser->get_Description(&bstr);
printf("desc: %S\n", bstr);
bstr=L"\n";
hr = pUser->get_EmployeeID(&bstr);
printf("id: %S\n", bstr);
bstr=L"\n";
hr = pUser->get_FirstName(&bstr);
printf("first name: %S\n", bstr);
SysFreeString(bstr);
return 0;
}
In the link bellow I attach screen where is example of using my code. I can't get information about email.
http://term-lux.pl/screen.jpg
-
August 12th, 2010, 02:32 AM
#2
Re: C++ ActiveDirectory user information problem
hi,
I have no idea about of this , i need suggestions.
pl help me
thanks for help
regards,
phe9oxis,
http://www.guidebuddha.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|