{
    "mode": "perldoc",
    "parameter": "Net::LDAP::Control::PasswordPolicy",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AControl%3A%3APasswordPolicy/json",
    "generated": "2026-06-08T07:12:16Z",
    "synopsis": "use Net::LDAP;\nuse Net::LDAP::Control::PasswordPolicy;\nuse Net::LDAP::Constant qw( LDAPCONTROLPASSWORDPOLICY );\n$ldap = Net::LDAP->new( \"ldap.example.com\" );\n$pp = Net::LDAP::Control::PasswordPolicy->new;\n$mesg = $ldap->bind( \"cn=Bob Smith,dc=example,dc=com\",\npassword => \"secret\",\ncontrol => [ $pp ] );\n# Get password policy response\nmy($resp)  = $mesg->control( LDAPCONTROLPASSWORDPOLICY );\nif (defined($resp)) {\nmy $v = $resp->pperror;\nprint \"Password policy error $v\\n\"  if defined $v;\n$v = $resp->timebeforeexpiration;\nprint \"Password expires in $v second(s)\\n\"  if defined $v;\n}",
    "sections": {
        "NAME": {
            "content": "Net::LDAP::Control::PasswordPolicy - LDAPv3 Password Policy control object\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Net::LDAP;\nuse Net::LDAP::Control::PasswordPolicy;\nuse Net::LDAP::Constant qw( LDAPCONTROLPASSWORDPOLICY );\n\n$ldap = Net::LDAP->new( \"ldap.example.com\" );\n\n$pp = Net::LDAP::Control::PasswordPolicy->new;\n\n$mesg = $ldap->bind( \"cn=Bob Smith,dc=example,dc=com\",\npassword => \"secret\",\ncontrol => [ $pp ] );\n\n# Get password policy response\nmy($resp)  = $mesg->control( LDAPCONTROLPASSWORDPOLICY );\n\nif (defined($resp)) {\nmy $v = $resp->pperror;\nprint \"Password policy error $v\\n\"  if defined $v;\n$v = $resp->timebeforeexpiration;\nprint \"Password expires in $v second(s)\\n\"  if defined $v;\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"Net::LDAP::Control::PasswordPolicy\" provides an interface for the creation and manipulation of\nobjects that represent \"PasswordPolicyRequest\"s and \"PasswordPolicyResponse\"s as described by\ndraft-behera-password-policy-09.\n\nThis control can be passed to most operations, including the bind.\n",
            "subsections": []
        },
        "CONSTRUCTOR ARGUMENTS": {
            "content": "There are no constructor arguments other than those provided by Net::LDAP::Control.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "timebeforeexpiration\nIf defined, this is an integer value holding the time left in seconds before the account's\npassword will expire.\n\ngraceauthenticationsremaining\nIf defined, this is an integer value holding the number of authentication requests allowed\nbefore the account is locked.\n\npperror\nIf defined, this contains a more detailed error code for the account. See\nNet::LDAP::Constant for definitions of each. Values can include:\n\nLDAPPPPASSWORDEXPIRED\nLDAPPPACCOUNTLOCKED\nLDAPPPCHANGEAFTERRESET\nLDAPPPPASSWORDMODNOTALLOWED\nLDAPPPMUSTSUPPLYOLDPASSWORD\nLDAPPPINSUFFICIENTPASSWORDQUALITY\nLDAPPPPASSWORDTOOSHORT\nLDAPPPPASSWORDTOOYOUNG\nLDAPPPPASSWORDINHISTORY\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Net::LDAP, Net::LDAP::Control, Net::LDAP::Constant, draft-behera-ldap-password-policy-09.txt\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Chris Ridd <chris.ridd@isode.com>\n\nPlease report any bugs, or post any suggestions, to the perl-ldap mailing list\n<perl-ldap@perl.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 2008 Chris Ridd. All rights reserved. This program is free software; you can\nredistribute it and/or modify it under the same terms as Perl itself.\n",
            "subsections": []
        }
    },
    "summary": "Net::LDAP::Control::PasswordPolicy - LDAPv3 Password Policy control object",
    "flags": [],
    "examples": [],
    "see_also": []
}