Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Win32::OLE Password Change?

by jpavel (Sexton)
on Mar 24, 2003 at 18:30 UTC ( [id://245500]=note: print w/replies, xml ) Need Help??


in reply to Re: Win32::OLE Password Change?
in thread Win32::OLE Password Change?

That was a huge help! I think I misspoke.... I knew I was attempting to bind to ADSI and not WMI in the second snippet. My problem was in using alternate credentials for an OLE ADSI binding.

In case anyone reads this in the future and would like my resolution, here it is:

$winntobj = Win32::OLE->GetObject('WinNT:') or croak( 'Cannot create WINNT object - ', $! ); if ($debug) { print "Attempting bind to WINNT on $server for authenticating $use +r/$password...\n"; } $userobj = $winntobj->OpenDSObject( "WinNT://$server/$pworduser,User", $user, $password, 1 ); my $err = Win32::OLE->LastError(); if ($err == 0) { print STDOUT "Successful authentication!\n"; else { print STDOUT $err; } $userobj->SetPassword($newpassword);
...and this works as long as the authenticated user has administrative rights. I'd still be interested in knowing if anyone has a WMI solution for this as well, but I am very happy using ADSI. Thanks again!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://245500]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found