Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::AdminMisc

Status
Not open for further replies.

soy4soy

IS-IT--Management
May 22, 2000
100
US
What the F***?!

This line is no longer able to export the SetPassword function:

use Win32::AdminMisc qw/SetPassword/;

So I call it directly, as follows, but it always fails. And the error code i get back from Win32::GetLastError() is 2221, which I can NOTHING on, so I don't know how to diagnose the problem:


Win32::AdminMisc::SetPassword( $DOM, $ID, $PW ) or die "Win32::GetLastError()\n"; # this bombs with error code: 2221

 
Sorry, this is the code that fails:

use Win32::AdminMisc;

Win32::AdminMisc::SetPassword( $DOM, $ID, $PW ) or die "Win32::GetLastError()\n"; # this bombs with error code: 2221
 
Ah! The beauty of Win32::FormatMessage!


Win32::AdminMisc::SetPassword( $DOM, $NEW_ACCOUNT, $NEW_PASSWORD) or
die "Failed to update $DOM\\$NEW_ACCOUNT: ".Win32::FormatMessage Win32::GetLastError()."\n";


This told me that the user ID could not be found! Interesting. But less frustrating since i now know the error message.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top