in reply to Disable an AD Account via LDAP

Per http://support.microsoft.com/kb/305144, the UAC code for a Normal_Account is 512. Make it 514 to disable the account.
my $ldap = Net::LDAP->new($host) or die "$@"; my $bind = $ldap->bind($bind_dn, password => $bind_pw); my $result = $ldap->modify($user_dn, replace => { userAccountControl = +> '512' }); $ldap->unbind();