|
-
June 21st, 2005, 09:45 AM
#1
ADSI userAccountControl Furtif_00 Project
Hi everybody
I continue the last year project of Furtif_00 that you can see here :
http://www.codeguru.com/forum/showth...=309450&page=4
and i have to modify the "change password" option of a user.
i know that this could be done with the "userAccountControl" .
I try the folowing code in c++ but it doesn't work.
is somebody know how to do this??
thanks for helping me .
here is the code :
bool CActiveDirectory::expire(CCFXRequest *pRequest)
{
USES_CONVERSION;
IADsUser *pUser;
strinExpire = pRequest->GetAttribute( "Expire" );
hr = bindToUser( &pUser, pRequest );
if( SUCCEEDED( hr ))
{
if( pUser )
{
VARIANT var;
//VariantInit(&var);
//V_BSTR(&var) =A2W(strinExpire);
//V_VT(&var)=VT_BSTR;
hr=pUser->Get(L"userAccountControl",&var);
var.intVal = var.intVal^64;
if(FAILED(hr))
{
return false;
}
pUser->Put(L"userAccountControl",var);
pUser->SetInfo();
pUser->Release();
VariantClear(&var);
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|