This is a sort of follow up to my previous post "IADSUser and SetInfo"
from 25/7/05.
Following some useful advice I changed my code for access Active
Directory to use the LDAP provider. Unfortunately I am still unable to
put any changes into the AD. I have tried everything I can think of,
but the following code refuses to work. The first part works in that I
can successfully bind to the object and read out properties, but the
call to setinfo returns a "General Access Denied" message. I do have
access to the accounts as I can modify them using the MMC Snap-in.
If anyone has any good suggestions as to what I can try next feel free
to chip in! Thanks.
ADSGetObject('LDAP://cn=My Test,OU=TESTING,dc=fabrikad,dc=com',
IADSUser, FADSObj);
FADSObj.GetInfo;
//This works....
memo1.Lines.Add('Account Disabled:');
Try
memo1.Lines.Add(BoolToStr(FADSObj.AccountDisabled, True));
Except
memo1.Lines.Add('unable to read account disabled');
end;
//The exception will get triggered..
//ok now try to set the account as disabled.
FADSObj.AccountDisabled := True;
try
FADSObj.SetInfo();
memo1.Lines.Add('info set');
except
memo1.Lines.Add('info not set!');
end;