I am trying to delete the profile using below code.It always marks the profile for deletion if it is currently being used.The profile does not actually disappear until every client with an active session has disconnected.
I have closed the outlook and communicator.its still not deleting profile.
So how to disconnect the all the active session related to profile immediately using MAPI coding?
res := MAPIAdminProfiles(0, pProfAdmin);
if res = S_OK then
begin
res := pProfAdmin.DeleteProfile(ProfileName, 0);
if not (res = S_OK) then
FailMmessage := 'Error in deleting Profile:'+ IntToStr(res);
end
else
begin
FailMmessage := 'Error in retrieving Admin Profile:'+ IntToStr(res);
end;