Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2006.09.03;
Скачать: [xml.tar.bz2];

Вниз

Получение e-mail пользователя из Active Directory   Найти похожие ветки 

 
Lexer ©   (2006-07-20 18:50) [0]

Нужно получить e-mail указанный в свойстве пользователя.
Думал ничего сложного - NetUserGetInfo. но...
USER_INFO_0,1,2,3,10,11,20 не содержат такой информации :(


 
oxffff ©   (2006-07-20 22:55) [1]

Скорее всего придется использовать LDAP или ADSI.


 
oxffff ©   (2006-07-20 22:58) [2]

Active Directory Service Interfaces
Purpose

Active Directory Service Interfaces (ADSI) is a set of COM interfaces used to access the features of directory services from different network providers. ADSI is used in a distributed computing environment to present a single set of directory service interfaces for managing network resources. Administrators and developers can use ADSI services to enumerate and manage the resources in a directory service, no matter which network environment contains the resource.

ADSI enables common administrative tasks, such as adding new users, managing printers, and locating resources in a distributed computing environment.

Where Applicable

Network Administrators can use ADSI to automate common tasks, such as adding users and groups, managing printers, and setting permissions on network resources.

Independent Software Vendors and end-user developers can use ADSI to "directory enable" their products and applications. Services can publish themselves in a directory, clients can use the directory to find the services, and both can use the directory to find and manipulate other objects of interest. Because Active Directory Service Interfaces are independent of the underlying directory service(s), directory-enabled products and applications can operate successfully in multiple network and directory environments.


 
oxffff ©   (2006-07-20 23:13) [3]

Нашел
The IADsUser interface
get_EmailAddress


 
lexer ©   (2006-07-21 11:00) [4]

oxffff, большое спасиба, поюзаю ADSI, думаю направление правильное, а то меня что-то к MAPI потянуло


 
lexer ©   (2006-07-21 18:42) [5]

Огромное спасибо oxfff, вот что у меня в итоге получилось, может кому пригодится:

uses ActiveX, ActiveDs_TLB, ComObj;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
 Usr: IADsUser;
 Comp: IADsComputer;
 Cont: IADsContainer;
begin
 try
   Usr := GetObject("LDAP://CN=Иванов Иван,CN=Users,DC=CIT") as IADsUser;
   FUserEmail :=  Usr.EmailAddress;
 except
   on E: EOleException do
   begin
     ShowMessage(E.message);
   end;
 end;
end;

function TForm1.GetObject(const name: string): IDispatch;
var
 Moniker: IMoniker;
 Eaten: integer;
 BindContext: IBindCtx;
 Dispatch: IDispatch;
begin
 OleCheck(CreateBindCtx(0, BindContext));
 OleCheck(MkParseDisplayName(BindContext, PWideChar(WideString(name)), Eaten, Moniker));
 OleCheck(Moniker.BindToObject(BindContext, nil, IDispatch, Dispatch));
 Result := Dispatch;
end;



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2006.09.03;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.04 c
2-1155546683
ZX48
2006-08-14 13:11
2006.09.03
ini файл


15-1154986259
matt
2006-08-08 01:30
2006.09.03
Вэб камеры онлайн


15-1154965015
vrem
2006-08-07 19:36
2006.09.03
Проект приказа


4-1147201306
grisme
2006-05-09 23:01
2006.09.03
Отслеживание создания файла.


2-1155296090
fast2
2006-08-11 15:34
2006.09.03
Как сделать, чтоб можна было двигать дочерней формой...





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский