Platform SDK: Active Directory, ADSI, and Directory Services |
Set usr = GetObject("WinNT://Fabrikam/JSmith") usr.AccountDisabled = TRUE 'disabled the account 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_AccountDisabled(true); hr = pUser->SetInfo();