Previous Topic: Save Changes to ObjectsNext Topic: Manage Password State


Modify a Password Policy

Suppose a company has different password policies defined at different sites, and it decides to standardize certain password policy requirements. The following script can be executed for each site to set the new password policy definitions:

use Netegrity::PolicyMgtAPI;

$policymgtapi = Netegrity::PolicyMgtAPI‑>New();
$session = $policymgtapi‑>CreateSession("adminid", "adminpwd");

@pwdpols=$session‑>GetAllPwdPolicies();
foreach $pwdpol(@pwdpols) {
   $pwdpol‑>Description("Standardized settings 4/15/02");
   print "\n\nPwd Policy: " . $pwdpol‑>Name();
   print "\nUpdated the following settings:";
   print "\n  Minimum length:\t".$pwdpol‑>PwdMinLength(6);
   print "\n  Maximum length:\t".$pwdpol‑>PwdMaxLength(18);
   print "\n  Minimum digits:\t".$pwdpol‑>PwdMinNumbers(3);
   print "\n  Allowable failures:\t".$pwdpol‑>MaxLoginFailures(3);
   print "\n  Days before reuse:\t".$pwdpol‑>PwdReuseDelay(360);
   print "\n  Changes before reuse:\t".$pwdpol‑>PwdReuseCount(6);
   $pwdpol‑>Save();
}