Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Wed, 9 Jul 2008 11:20:01 -0700,    group: microsoft.public.platformsdk.active.directory        back       


Change Notification Support on ADAM.   
Hi,

I have written a piece of code using LDAP native APIs following MSDN 
guidelines and have managed to receive LDAP change notifications from Active 
Directory. However, running the same code against ADAM does not return any 
notifications. 

I am using following server control for notifications.
Server Control for Notifications = '1.2.840.113556.1.4.528'

Can somebody suggest if ADAM supports change notifications or not. If it 
supports then what i would need to do.

Thanks in advance.

Cheers.

Nasir Mahmood
date: Wed, 9 Jul 2008 11:20:01 -0700   author:   Nasir

Re: Change Notification Support on ADAM.   
It should work although I don't think I've tried it personally.  Can you 
show the code you are using or a shortened sample?

-- 
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Nasir"  wrote in message 
news:34A32425-6B02-496A-AE1A-D12ADD7FA9CB@microsoft.com...
> Hi,
>
> I have written a piece of code using LDAP native APIs following MSDN
> guidelines and have managed to receive LDAP change notifications from 
> Active
> Directory. However, running the same code against ADAM does not return any
> notifications.
>
> I am using following server control for notifications.
> Server Control for Notifications = '1.2.840.113556.1.4.528'
>
> Can somebody suggest if ADAM supports change notifications or not. If it
> supports then what i would need to do.
>
> Thanks in advance.
>
> Cheers.
>
> Nasir Mahmood
>
>
>
date: Wed, 9 Jul 2008 15:49:08 -0500   author:   Joe Kaplan

Re: Change Notification Support on ADAM.   
Hi Joe,

Thanks for your instant reply spotting that ADAM does support the change 
notifications.

I would like to give you some more information based on the tests I carried 
out today.

We have the ADAM installed on two machines; one is on Windows XP and other 
is on Windows 2003.

1-> Same code picks the notifications on 2003 machine. Add/Update are coming 
through but Delete is not being received.
2-> Running the same code on XP machine does not receive Add/Update/Delete 
notifications.  

Amazing behaviour. I suspect, there could be some components/server controls 
missing on XP machine that use to get installed on 2003 by default. Any idea 
on it. 

Here is a code segment of the relevant area that use to get register for 
notifications and a dedicated thread is used to pool for 2 seconds to see if 
there are any pending notifications:

FILTER_ALL_RECORDS                   = 'ObjectClass=*';
NOTIFICATION_WAIT_TIMEOUT       = 2; // Seconds
LDAP_AD_SERVER_NOTIFICATION_OID  = '1.2.840.113556.1.4.528';

LDAP_MSG_ONE = 0;
LDAP_RES_ANY  = -1;

Routine to register for LDAP notification:
function RegisterForNotifications(BaseDN : PChar; Scope : DWORD): Cardinal;  
var
SearchSimpleServerControl: LDAPControl;
SearchServerControlArray: array [0..1] of PLDAPControl;
SearchPtrServerLDAPControl: ^PLDAPControl;
SearchPtrClientLDAPControl: ^PLDAPControl;
SearchMessageNumber: Cardinal;

begin

    SearchSimpleServerControl.ldctl_oid := LDAP_AD_SERVER_NOTIFICATION_OID;
    SearchSimpleServerControl.ldctl_iscritical := TRUE;
    SearchSimpleServerControl.ldctl_value.bv_len := 0;
    SearchSimpleServerControl.ldctl_value.bv_val := nil;

    SearchServerControlArray[0] := @SearchSimpleServerControl;
    SearchServerControlArray[1] := nil;

    SearchPtrServerLDAPControl:= @SearchServerControlArray;
    SearchPtrClientLDAPControl:= nil;

    FNotificationBaseDN := BaseDN;

    Result := 
ldap_search_ext(FActiveDirSession,BaseDN,Scope,FILTER_ALL_RECORDS,nil,0,SearchPtrServerLDAPControl^,SearchPtrClientLDAPControl^,0,0,SearchMessageNumber);

end;

Threaded Routine attempts Directory for if any change:
procedure CallWaitForNotification;
var
PLDAPMsg : PLDAPMessage;
WaitResult : Cardinal
begin

 WaitResult:= WaitForNotification(PLDAPMsg);

 if (WaitResult = LDAP_SUCCESS) {and does not get timed out} then
 begin
   //Process message result received....
 end;

end;

function WaitForNotification(MessageOut : PPLDAPMessage) : Cardinal;  
var
TimeOutStruct: LDAP_TIMEVAL;

begin

  TimeOutStruct.tv_sec := NOTIFICATION_WAIT_TIMEOUT;
  TimeOutStruct.tv_usec := 0;

  Result := 
ldap_result(FActiveDirSession,Cardinal(LDAP_RES_ANY),Cardinal(LDAP_MSG_ONE),TimeOutStruct, MessageOut^);         

  Result := FActiveDirSession.ld_errno;      

end;

Regards,

Nasir Mahmood


"Joe Kaplan" wrote:

> It should work although I don't think I've tried it personally.  Can you 
> show the code you are using or a shortened sample?
> 
> -- 
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "Nasir"  wrote in message 
> news:34A32425-6B02-496A-AE1A-D12ADD7FA9CB@microsoft.com...
> > Hi,
> >
> > I have written a piece of code using LDAP native APIs following MSDN
> > guidelines and have managed to receive LDAP change notifications from 
> > Active
> > Directory. However, running the same code against ADAM does not return any
> > notifications.
> >
> > I am using following server control for notifications.
> > Server Control for Notifications = '1.2.840.113556.1.4.528'
> >
> > Can somebody suggest if ADAM supports change notifications or not. If it
> > supports then what i would need to do.
> >
> > Thanks in advance.
> >
> > Cheers.
> >
> > Nasir Mahmood
> >
> >
> > 
> 
> 
>
date: Thu, 10 Jul 2008 11:09:06 -0700   author:   Nasir

Re: Change Notification Support on ADAM.   
Hi Joe,

Thanks for your instant reply spotting that ADAM does support the change 
notifications.

I would like to give you some more information based on the tests I carried 
out today.

We have the ADAM installed on two machines; one is on Windows XP and other 
is on Windows 2003.

1-> Same code picks the notifications on 2003 machine. Add/Update are coming 
through but Delete is not being received.
2-> Running the same code on XP machine does not receive Add/Update/Delete 
notifications.  

Amazing behaviour. I suspect, there could be some components/server controls 
missing on XP machine that use to get installed on 2003 by default. Any idea 
on it. 

Here is a code segment of the relevant area that use to get register for 
notifications and a dedicated thread is used to pool for 2 seconds to see if 
there are any pending notifications:

FILTER_ALL_RECORDS                   = 'ObjectClass=*';
NOTIFICATION_WAIT_TIMEOUT       = 2; // Seconds
LDAP_AD_SERVER_NOTIFICATION_OID  = '1.2.840.113556.1.4.528';

LDAP_MSG_ONE = 0;
LDAP_RES_ANY  = -1;

Routine to register for LDAP notification:
function RegisterForNotifications(BaseDN : PChar; Scope : DWORD): Cardinal;  
var
SearchSimpleServerControl: LDAPControl;
SearchServerControlArray: array [0..1] of PLDAPControl;
SearchPtrServerLDAPControl: ^PLDAPControl;
SearchPtrClientLDAPControl: ^PLDAPControl;
SearchMessageNumber: Cardinal;

begin

    SearchSimpleServerControl.ldctl_oid := LDAP_AD_SERVER_NOTIFICATION_OID;
    SearchSimpleServerControl.ldctl_iscritical := TRUE;
    SearchSimpleServerControl.ldctl_value.bv_len := 0;
    SearchSimpleServerControl.ldctl_value.bv_val := nil;

    SearchServerControlArray[0] := @SearchSimpleServerControl;
    SearchServerControlArray[1] := nil;

    SearchPtrServerLDAPControl:= @SearchServerControlArray;
    SearchPtrClientLDAPControl:= nil;

    FNotificationBaseDN := BaseDN;

    Result := 
ldap_search_ext(FActiveDirSession,BaseDN,Scope,FILTER_ALL_RECORDS,nil,0,SearchPtrServerLDAPControl^,SearchPtrClientLDAPControl^,0,0,SearchMessageNumber);

end;

Threaded Routine attempts Directory for if any change:
procedure CallWaitForNotification;
var
PLDAPMsg : PLDAPMessage;
WaitResult : Cardinal
begin

 WaitResult:= WaitForNotification(PLDAPMsg);

 if (WaitResult = LDAP_SUCCESS) {and does not get timed out} then
 begin
   //Process message result received....
 end;

end;

function WaitForNotification(MessageOut : PPLDAPMessage) : Cardinal;  
var
TimeOutStruct: LDAP_TIMEVAL;

begin

  TimeOutStruct.tv_sec := NOTIFICATION_WAIT_TIMEOUT;
  TimeOutStruct.tv_usec := 0;

  Result := 
ldap_result(FActiveDirSession,Cardinal(LDAP_RES_ANY),Cardinal(LDAP_MSG_ONE),TimeOutStruct, MessageOut^);         

  Result := FActiveDirSession.ld_errno;      

end;

Regards,

Nasir Mahmood


"Joe Kaplan" wrote:

> It should work although I don't think I've tried it personally.  Can you 
> show the code you are using or a shortened sample?
> 
> -- 
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "Nasir"  wrote in message 
> news:34A32425-6B02-496A-AE1A-D12ADD7FA9CB@microsoft.com...
> > Hi,
> >
> > I have written a piece of code using LDAP native APIs following MSDN
> > guidelines and have managed to receive LDAP change notifications from 
> > Active
> > Directory. However, running the same code against ADAM does not return any
> > notifications.
> >
> > I am using following server control for notifications.
> > Server Control for Notifications = '1.2.840.113556.1.4.528'
> >
> > Can somebody suggest if ADAM supports change notifications or not. If it
> > supports then what i would need to do.
> >
> > Thanks in advance.
> >
> > Cheers.
> >
> > Nasir Mahmood
> >
> >
> > 
> 
> 
>
date: Thu, 10 Jul 2008 11:10:04 -0700   author:   Nasir

Re: Change Notification Support on ADAM.   
This could be a limitation of ADAM on XP.  I don't know for sure.  This is 
probably something that someone else will need to comment on.

I'm not sure if Dmitri or Lee read this newsgroup though, so you might 
consider reposting you question on 
microsoft.public.windows.server.active_directory.

Best of luck!

Joe K.
-- 
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Nasir"  wrote in message 
news:CFBA8A47-AF2F-4FA7-A8C7-81B8A640D2EC@microsoft.com...
> Hi Joe,
>
> Thanks for your instant reply spotting that ADAM does support the change
> notifications.
>
> I would like to give you some more information based on the tests I 
> carried
> out today.
>
> We have the ADAM installed on two machines; one is on Windows XP and other
> is on Windows 2003.
>
> 1-> Same code picks the notifications on 2003 machine. Add/Update are 
> coming
> through but Delete is not being received.
> 2-> Running the same code on XP machine does not receive Add/Update/Delete
> notifications.
>
> Amazing behaviour. I suspect, there could be some components/server 
> controls
> missing on XP machine that use to get installed on 2003 by default. Any 
> idea
> on it.
>
> Here is a code segment of the relevant area that use to get register for
> notifications and a dedicated thread is used to pool for 2 seconds to see 
> if
> there are any pending notifications:
>
> FILTER_ALL_RECORDS                   = 'ObjectClass=*';
> NOTIFICATION_WAIT_TIMEOUT       = 2; // Seconds
> LDAP_AD_SERVER_NOTIFICATION_OID  = '1.2.840.113556.1.4.528';
>
> LDAP_MSG_ONE = 0;
> LDAP_RES_ANY  = -1;
>
> Routine to register for LDAP notification:
> function RegisterForNotifications(BaseDN : PChar; Scope : DWORD): 
> Cardinal;
> var
> SearchSimpleServerControl: LDAPControl;
> SearchServerControlArray: array [0..1] of PLDAPControl;
> SearchPtrServerLDAPControl: ^PLDAPControl;
> SearchPtrClientLDAPControl: ^PLDAPControl;
> SearchMessageNumber: Cardinal;
>
> begin
>
>    SearchSimpleServerControl.ldctl_oid := LDAP_AD_SERVER_NOTIFICATION_OID;
>    SearchSimpleServerControl.ldctl_iscritical := TRUE;
>    SearchSimpleServerControl.ldctl_value.bv_len := 0;
>    SearchSimpleServerControl.ldctl_value.bv_val := nil;
>
>    SearchServerControlArray[0] := @SearchSimpleServerControl;
>    SearchServerControlArray[1] := nil;
>
>    SearchPtrServerLDAPControl:= @SearchServerControlArray;
>    SearchPtrClientLDAPControl:= nil;
>
>    FNotificationBaseDN := BaseDN;
>
>    Result :=
> ldap_search_ext(FActiveDirSession,BaseDN,Scope,FILTER_ALL_RECORDS,nil,0,SearchPtrServerLDAPControl^,SearchPtrClientLDAPControl^,0,0,SearchMessageNumber);
>
> end;
>
> Threaded Routine attempts Directory for if any change:
> procedure CallWaitForNotification;
> var
> PLDAPMsg : PLDAPMessage;
> WaitResult : Cardinal
> begin
>
> WaitResult:= WaitForNotification(PLDAPMsg);
>
> if (WaitResult = LDAP_SUCCESS) {and does not get timed out} then
> begin
>   //Process message result received....
> end;
>
> end;
>
> function WaitForNotification(MessageOut : PPLDAPMessage) : Cardinal;
> var
> TimeOutStruct: LDAP_TIMEVAL;
>
> begin
>
>  TimeOutStruct.tv_sec := NOTIFICATION_WAIT_TIMEOUT;
>  TimeOutStruct.tv_usec := 0;
>
>  Result :=
> ldap_result(FActiveDirSession,Cardinal(LDAP_RES_ANY),Cardinal(LDAP_MSG_ONE),TimeOutStruct, 
> MessageOut^);
>
>  Result := FActiveDirSession.ld_errno;
>
> end;
>
> Regards,
>
> Nasir Mahmood
>
>
> "Joe Kaplan" wrote:
>
>> It should work although I don't think I've tried it personally.  Can you
>> show the code you are using or a shortened sample?
>>
>> -- 
>> Joe Kaplan-MS MVP Directory Services Programming
>> Co-author of "The .NET Developer's Guide to Directory Services 
>> Programming"
>> http://www.directoryprogramming.net
>> --
>> "Nasir"  wrote in message
>> news:34A32425-6B02-496A-AE1A-D12ADD7FA9CB@microsoft.com...
>> > Hi,
>> >
>> > I have written a piece of code using LDAP native APIs following MSDN
>> > guidelines and have managed to receive LDAP change notifications from
>> > Active
>> > Directory. However, running the same code against ADAM does not return 
>> > any
>> > notifications.
>> >
>> > I am using following server control for notifications.
>> > Server Control for Notifications = '1.2.840.113556.1.4.528'
>> >
>> > Can somebody suggest if ADAM supports change notifications or not. If 
>> > it
>> > supports then what i would need to do.
>> >
>> > Thanks in advance.
>> >
>> > Cheers.
>> >
>> > Nasir Mahmood
>> >
>> >
>> >
>>
>>
>>
date: Fri, 11 Jul 2008 12:26:21 -0500   author:   Joe Kaplan

Re: Change Notification Support on ADAM.   
Thanks Joe for all your help on it. I will repost the query on the suggested 
newsgroup.

"Joe Kaplan" wrote:

> This could be a limitation of ADAM on XP.  I don't know for sure.  This is 
> probably something that someone else will need to comment on.
> 
> I'm not sure if Dmitri or Lee read this newsgroup though, so you might 
> consider reposting you question on 
> microsoft.public.windows.server.active_directory.
> 
> Best of luck!
> 
> Joe K.
> -- 
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "Nasir"  wrote in message 
> news:CFBA8A47-AF2F-4FA7-A8C7-81B8A640D2EC@microsoft.com...
> > Hi Joe,
> >
> > Thanks for your instant reply spotting that ADAM does support the change
> > notifications.
> >
> > I would like to give you some more information based on the tests I 
> > carried
> > out today.
> >
> > We have the ADAM installed on two machines; one is on Windows XP and other
> > is on Windows 2003.
> >
> > 1-> Same code picks the notifications on 2003 machine. Add/Update are 
> > coming
> > through but Delete is not being received.
> > 2-> Running the same code on XP machine does not receive Add/Update/Delete
> > notifications.
> >
> > Amazing behaviour. I suspect, there could be some components/server 
> > controls
> > missing on XP machine that use to get installed on 2003 by default. Any 
> > idea
> > on it.
> >
> > Here is a code segment of the relevant area that use to get register for
> > notifications and a dedicated thread is used to pool for 2 seconds to see 
> > if
> > there are any pending notifications:
> >
> > FILTER_ALL_RECORDS                   = 'ObjectClass=*';
> > NOTIFICATION_WAIT_TIMEOUT       = 2; // Seconds
> > LDAP_AD_SERVER_NOTIFICATION_OID  = '1.2.840.113556.1.4.528';
> >
> > LDAP_MSG_ONE = 0;
> > LDAP_RES_ANY  = -1;
> >
> > Routine to register for LDAP notification:
> > function RegisterForNotifications(BaseDN : PChar; Scope : DWORD): 
> > Cardinal;
> > var
> > SearchSimpleServerControl: LDAPControl;
> > SearchServerControlArray: array [0..1] of PLDAPControl;
> > SearchPtrServerLDAPControl: ^PLDAPControl;
> > SearchPtrClientLDAPControl: ^PLDAPControl;
> > SearchMessageNumber: Cardinal;
> >
> > begin
> >
> >    SearchSimpleServerControl.ldctl_oid := LDAP_AD_SERVER_NOTIFICATION_OID;
> >    SearchSimpleServerControl.ldctl_iscritical := TRUE;
> >    SearchSimpleServerControl.ldctl_value.bv_len := 0;
> >    SearchSimpleServerControl.ldctl_value.bv_val := nil;
> >
> >    SearchServerControlArray[0] := @SearchSimpleServerControl;
> >    SearchServerControlArray[1] := nil;
> >
> >    SearchPtrServerLDAPControl:= @SearchServerControlArray;
> >    SearchPtrClientLDAPControl:= nil;
> >
> >    FNotificationBaseDN := BaseDN;
> >
> >    Result :=
> > ldap_search_ext(FActiveDirSession,BaseDN,Scope,FILTER_ALL_RECORDS,nil,0,SearchPtrServerLDAPControl^,SearchPtrClientLDAPControl^,0,0,SearchMessageNumber);
> >
> > end;
> >
> > Threaded Routine attempts Directory for if any change:
> > procedure CallWaitForNotification;
> > var
> > PLDAPMsg : PLDAPMessage;
> > WaitResult : Cardinal
> > begin
> >
> > WaitResult:= WaitForNotification(PLDAPMsg);
> >
> > if (WaitResult = LDAP_SUCCESS) {and does not get timed out} then
> > begin
> >   //Process message result received....
> > end;
> >
> > end;
> >
> > function WaitForNotification(MessageOut : PPLDAPMessage) : Cardinal;
> > var
> > TimeOutStruct: LDAP_TIMEVAL;
> >
> > begin
> >
> >  TimeOutStruct.tv_sec := NOTIFICATION_WAIT_TIMEOUT;
> >  TimeOutStruct.tv_usec := 0;
> >
> >  Result :=
> > ldap_result(FActiveDirSession,Cardinal(LDAP_RES_ANY),Cardinal(LDAP_MSG_ONE),TimeOutStruct, 
> > MessageOut^);
> >
> >  Result := FActiveDirSession.ld_errno;
> >
> > end;
> >
> > Regards,
> >
> > Nasir Mahmood
> >
> >
> > "Joe Kaplan" wrote:
> >
> >> It should work although I don't think I've tried it personally.  Can you
> >> show the code you are using or a shortened sample?
> >>
> >> -- 
> >> Joe Kaplan-MS MVP Directory Services Programming
> >> Co-author of "The .NET Developer's Guide to Directory Services 
> >> Programming"
> >> http://www.directoryprogramming.net
> >> --
> >> "Nasir"  wrote in message
> >> news:34A32425-6B02-496A-AE1A-D12ADD7FA9CB@microsoft.com...
> >> > Hi,
> >> >
> >> > I have written a piece of code using LDAP native APIs following MSDN
> >> > guidelines and have managed to receive LDAP change notifications from
> >> > Active
> >> > Directory. However, running the same code against ADAM does not return 
> >> > any
> >> > notifications.
> >> >
> >> > I am using following server control for notifications.
> >> > Server Control for Notifications = '1.2.840.113556.1.4.528'
> >> >
> >> > Can somebody suggest if ADAM supports change notifications or not. If 
> >> > it
> >> > supports then what i would need to do.
> >> >
> >> > Thanks in advance.
> >> >
> >> > Cheers.
> >> >
> >> > Nasir Mahmood
> >> >
> >> >
> >> >
> >>
> >>
> >> 
> 
> 
>
date: Mon, 14 Jul 2008 07:04:04 -0700   author:   Nasir

Re: Change Notification Support on ADAM.   
Thanks Joe for all your help on it. I will repost the query on the suggested 
newsgroup.

"Joe Kaplan" wrote:

> This could be a limitation of ADAM on XP.  I don't know for sure.  This is 
> probably something that someone else will need to comment on.
> 
> I'm not sure if Dmitri or Lee read this newsgroup though, so you might 
> consider reposting you question on 
> microsoft.public.windows.server.active_directory.
> 
> Best of luck!
> 
> Joe K.
> -- 
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "Nasir"  wrote in message 
> news:CFBA8A47-AF2F-4FA7-A8C7-81B8A640D2EC@microsoft.com...
> > Hi Joe,
> >
> > Thanks for your instant reply spotting that ADAM does support the change
> > notifications.
> >
> > I would like to give you some more information based on the tests I 
> > carried
> > out today.
> >
> > We have the ADAM installed on two machines; one is on Windows XP and other
> > is on Windows 2003.
> >
> > 1-> Same code picks the notifications on 2003 machine. Add/Update are 
> > coming
> > through but Delete is not being received.
> > 2-> Running the same code on XP machine does not receive Add/Update/Delete
> > notifications.
> >
> > Amazing behaviour. I suspect, there could be some components/server 
> > controls
> > missing on XP machine that use to get installed on 2003 by default. Any 
> > idea
> > on it.
> >
> > Here is a code segment of the relevant area that use to get register for
> > notifications and a dedicated thread is used to pool for 2 seconds to see 
> > if
> > there are any pending notifications:
> >
> > FILTER_ALL_RECORDS                   = 'ObjectClass=*';
> > NOTIFICATION_WAIT_TIMEOUT       = 2; // Seconds
> > LDAP_AD_SERVER_NOTIFICATION_OID  = '1.2.840.113556.1.4.528';
> >
> > LDAP_MSG_ONE = 0;
> > LDAP_RES_ANY  = -1;
> >
> > Routine to register for LDAP notification:
> > function RegisterForNotifications(BaseDN : PChar; Scope : DWORD): 
> > Cardinal;
> > var
> > SearchSimpleServerControl: LDAPControl;
> > SearchServerControlArray: array [0..1] of PLDAPControl;
> > SearchPtrServerLDAPControl: ^PLDAPControl;
> > SearchPtrClientLDAPControl: ^PLDAPControl;
> > SearchMessageNumber: Cardinal;
> >
> > begin
> >
> >    SearchSimpleServerControl.ldctl_oid := LDAP_AD_SERVER_NOTIFICATION_OID;
> >    SearchSimpleServerControl.ldctl_iscritical := TRUE;
> >    SearchSimpleServerControl.ldctl_value.bv_len := 0;
> >    SearchSimpleServerControl.ldctl_value.bv_val := nil;
> >
> >    SearchServerControlArray[0] := @SearchSimpleServerControl;
> >    SearchServerControlArray[1] := nil;
> >
> >    SearchPtrServerLDAPControl:= @SearchServerControlArray;
> >    SearchPtrClientLDAPControl:= nil;
> >
> >    FNotificationBaseDN := BaseDN;
> >
> >    Result :=
> > ldap_search_ext(FActiveDirSession,BaseDN,Scope,FILTER_ALL_RECORDS,nil,0,SearchPtrServerLDAPControl^,SearchPtrClientLDAPControl^,0,0,SearchMessageNumber);
> >
> > end;
> >
> > Threaded Routine attempts Directory for if any change:
> > procedure CallWaitForNotification;
> > var
> > PLDAPMsg : PLDAPMessage;
> > WaitResult : Cardinal
> > begin
> >
> > WaitResult:= WaitForNotification(PLDAPMsg);
> >
> > if (WaitResult = LDAP_SUCCESS) {and does not get timed out} then
> > begin
> >   //Process message result received....
> > end;
> >
> > end;
> >
> > function WaitForNotification(MessageOut : PPLDAPMessage) : Cardinal;
> > var
> > TimeOutStruct: LDAP_TIMEVAL;
> >
> > begin
> >
> >  TimeOutStruct.tv_sec := NOTIFICATION_WAIT_TIMEOUT;
> >  TimeOutStruct.tv_usec := 0;
> >
> >  Result :=
> > ldap_result(FActiveDirSession,Cardinal(LDAP_RES_ANY),Cardinal(LDAP_MSG_ONE),TimeOutStruct, 
> > MessageOut^);
> >
> >  Result := FActiveDirSession.ld_errno;
> >
> > end;
> >
> > Regards,
> >
> > Nasir Mahmood
> >
> >
> > "Joe Kaplan" wrote:
> >
> >> It should work although I don't think I've tried it personally.  Can you
> >> show the code you are using or a shortened sample?
> >>
> >> -- 
> >> Joe Kaplan-MS MVP Directory Services Programming
> >> Co-author of "The .NET Developer's Guide to Directory Services 
> >> Programming"
> >> http://www.directoryprogramming.net
> >> --
> >> "Nasir"  wrote in message
> >> news:34A32425-6B02-496A-AE1A-D12ADD7FA9CB@microsoft.com...
> >> > Hi,
> >> >
> >> > I have written a piece of code using LDAP native APIs following MSDN
> >> > guidelines and have managed to receive LDAP change notifications from
> >> > Active
> >> > Directory. However, running the same code against ADAM does not return 
> >> > any
> >> > notifications.
> >> >
> >> > I am using following server control for notifications.
> >> > Server Control for Notifications = '1.2.840.113556.1.4.528'
> >> >
> >> > Can somebody suggest if ADAM supports change notifications or not. If 
> >> > it
> >> > supports then what i would need to do.
> >> >
> >> > Thanks in advance.
> >> >
> >> > Cheers.
> >> >
> >> > Nasir Mahmood
> >> >
> >> >
> >> >
> >>
> >>
> >> 
> 
> 
>
date: Mon, 14 Jul 2008 07:04:05 -0700   author:   Nasir

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us