Problems with IAccount
Posted: Tue Nov 05, 2013 11:45 am
Hi,
I'm trying to set access rights to a folder for an ActiveDirectory account that has just been created (using ADSI).
It seems it sometimes takes some time for the account to become available for madSecurity.
I'm using this code:
Maybe it's an issue asking a different domain controller with mad.
Is there a way to solve this problem? It's not very helpful to insert "Sleep(5000)" here...
Maybe a dedicated DC can be specified?
.sundance.
I'm trying to set access rights to a folder for an ActiveDirectory account that has just been created (using ADSI).
It seems it sometimes takes some time for the account to become available for madSecurity.
I'm using this code:
Code: Select all
var
UserAccount: IAccount;
Security: ISecurityObject;
begin
Security := madSecurity.FileSecurity(aPathname);
if not Security.Success then Exit;
UserAccount := madSecurity.Account(aUsernameNT4);
if not UserAccount.Success then Exit; // this returns false!
Is there a way to solve this problem? It's not very helpful to insert "Sleep(5000)" here...
Maybe a dedicated DC can be specified?
.sundance.