Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

How to test and set "Password must change at next logon"?

$
0
0

I am already using the VB example from message 38728 so that UserMustChangePasswordAtNextLogon is set whenever a password is changed.    (As described in message 38728 and others.)

 

Now I need a way to set UserMustChangePasswordAtNextLogon if someone clears the setting.

 

Any suggestions on how to do this?

 

 

Here is the code from message 38728 that I am already using:

    Function IsAttributeModified (ByVal strAttributeName, ByRef Request)
        Dim objEntry, nControlCode, boolResult
        IsAttributeModified = False
        Set objEntry = Request.GetPropertyItem(strAttributeName, ADSTYPE_CASE_IGNORE_STRING)
        If (objEntry Is Nothing) Then Exit Function
        If (objEntry.ControlCode = 0) Then Exit Function
       IsAttributeModified = True
    End Function '-- IsAttributeModified
    '-----------------------------------------------

    Sub onPreModify(Request)
        If (Not IsAttributeModified("edsaPassword", Request)) Then Exit Sub
        Request.put "edsvaUserMustChangePasswordAtNextLogon", "TRUE"
    End Sub 


Viewing all articles
Browse latest Browse all 1277

Trending Articles