Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Password modify as admin
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robert Threet  
View profile  
 More options Feb 17 2011, 2:21 pm
Newsgroups: perl.ldap
From: rthr...@usi.edu (Robert Threet)
Date: Thu, 17 Feb 2011 13:21:47 -0600
Local: Thurs, Feb 17 2011 2:21 pm
Subject: Password modify as admin
Not sure this went the first time ...

I have a working Net::LDAP::Entry program for adding users so I decided
to gut it to create a userPassword changer.

I keep getting "Error changing password: no objectClass attribute".

I cannot find examples doing simple one-at-a-time adds like this.  All I
can find are examples using arrays and hashes and cannot seem to
translate it to this.  Any tips?

sub resetMacAcct($newuid,$pw,$newpw){
        $macldapsvr = "XXX.XXX.XXX.XXX";
        $macADMdn = "uid=admin,cn=people,dc=lib-mac,dc=local";
        $macadmpwd ="XXXXXXXX";
        $macBind = Net::LDAP->new($macldapsvr,
                port => 389,
                debug => 0,
                timeout => 60,
                version => 3
        ) or die "Couldn't connect to Mac LDAP server: $@";
        my $conn = $macBind->bind(dn => $macADMdn,
                                    password => $macadmpwd);
        if ($conn->code){
                die 'Cannot bind:' . $conn->error . "\n";}

        my $macEntry = Net::LDAP::Entry->new;
        $newdn="uid=" . $username . ",cn=people,dc=lib-mac,dc=local";
        $macEntry->dn($newdn);
        [removed SSHA1 stuff for clarity]
        $macEntry->replace(userPassword => $newMacpw);
        my $add = $macBind->add($macEntry);
        die "Error changing password: " . $add->error()."\n" if
              $add->code();
        $macBind->unbind();
        }

--
Robert Threet
Systems Manager
USI Computer Center
(812) 465-1082
Confidentiality Statement: This email message, including any
attachments, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »