Back to the WFC main page

CPasswordChangeFilter

$Revision: 13 $

Description

This class makes it easy to filter password changes in NT.

Data Members

None.

Methods

BOOL AddFilter( const CString& dll_name )
This method adds the dll_name to the list of DLL's that will be called when a password changes.
BOOL GetCurrentFilters( CStringArray& current_filters )
Retrieves a list of filters currently in use. These are the names of the DLL's that are called when a user's password changes.
BOOL OnChanged( PASSWORD_FILTER_STRING * user_name, ULONG relative_id, PASSWORD_FILTER_STRING * new_password )
This is called when the user changed their password. This is where you would do smurphy things like change passwords on other applications (or operating operating systems). This is the key to "single user logon" setups. Whenever the user changes their password, OnChanged() will get called allowing you to take the appropriate actions to change their password any where else it needs changing.
BOOL OnFilter( PASSWORD_FILTER_STRING * user_name, PASSWORD_FILTER_STRING * full_user_name, PASSWORD_FILTER_STRING * new_password, BOOL was_set )
Called when a user is changing their password. This is where you would put your code to "score" a user's typed in password. If it does not meet your randomness criteria, return FALSE. If the password is OK, then return TRUE. The default is to return TRUE.
BOOL OnInitialize( void )
Returns TRUE. Override it to do what you want.
BOOL RemoveFilter( const CString& dll_name )
This method removes the dll_name from the list of DLL's that will be called when a password changes.

Notes

Notifications and filtering only takes place on the machine that holds the passwords. This could be the Primary Domain Controller (PDC) if you are using domains. If you are using domains, don't forget to install the password filter on the Backup Domain Controllers (BDC) so the filters will continue if an election was forced (i.e. role reversal).

Example

void _tmain()
{
   WFCTRACEINIT( TEXT( "_tmain()" ) );

   CPasswordChangeFilter filter;

   filter.AddFilter( TEXT( "e:\\wfc\\sample\\passwordfilter\\dll\\password.dll" ) );
}

Copyright, 2000, Samuel R. Blackburn
$Workfile: CPasswordChangeFilter.cpp $
$Modtime: 1/17/00 9:09a $