Platform SDK: Active Directory, ADSI, and Directory Services |
You can disable a user account by setting the AccountDisabled property to True in the IADsUser interface. This is similar to the WinNT provider.
Set usr = GetObject("LDAP:// CN=Jsmith, OU=Sales, DC=Fabrikam, DC=Com") usr.AccountDisabled = TRUE 'disabled the account usr.SetInfo
IADsUser *pUser; HRESULT hr = S_OK; LPWSTR adsPath; adsPath=L"LDAP://serv1/cn=Jeff Smith,cn=Users, dc=Fabrikam, dc=com"; hr = ADsGetObject(adsPath,IID_IADsUser,(void**)&pUser); hr = pUser->put_AccountDisabled(true); hr = pUser->SetInfo();