in reply to NET::LDAP disable AD user
I've never used that module, but I've got a few ideas. Hopefully I'm not too off base with them.
Here's my guess on what may be happening. In your code, you're trying to delete the userAccountControl attribute and then add it back in with a value. Active Directory is probably considering this to be a required and/or protected attribute and is throwing an error when you try to delete it.
After taking a quick peek at the Net::LDAP module's documentation, I'd recommend trying to use 'replace' method instead of the 'delete' and 'add' combo. In other words, something like:
$res = $ldap->modify ($distinguishedName, replace => {userAccountControl => "514"} };
I'm not guaranteeing that this will for sure work, but it seems to make sense in my mind at least.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: NET::LDAP disable AD user
by OldManYoss (Initiate) on Sep 28, 2010 at 12:27 UTC | |
by dasgar (Priest) on Sep 28, 2010 at 12:53 UTC | |
by locked_user sundialsvc4 (Abbot) on Sep 28, 2010 at 13:32 UTC | |
by OldManYoss (Initiate) on Sep 30, 2010 at 07:52 UTC | |
|
Re^2: NET::LDAP disable AD user
by Anonymous Monk on Mar 22, 2013 at 09:16 UTC |