Platform SDK: Active Directory, ADSI, and Directory Services |
You can only set the account lockout to FALSE. Only the system can set the account lockout to TRUE. You can also read the value of the account lockout.
Set usr = GetObject("WinNT://Fabrikam/JSmith") usr.IsAccountLocked = FALSE usr.SetInfo
IADsUser *pUser; HRESULT hr = S_OK; LPWSTR adsPath; adsPath=L"WinNT://Fabrikam/JSmith"; hr = ADsGetObject(adsPath,IID_IADsUser,(void**)&pUser); hr = pUser->put_IsAccountLocked(false); hr = pUser->SetInfo(); hr = pUser->Release();