Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks.
Until last week I was programming ASP pages, now I find myself administrating a W2K network.

I'm exploring Win32::NetAdmin and Win32::NetAdmin, but am getting unexplained errors.
So far, UsersExist() and UserDelete() have been successful, but when I try:

if (! UserCreate($domain, "foo", "foo", 0, '', '', '', '', '')) { die GetError(); }
the output is: "87".

What is "87"?
Where can I find error code documentation? Is the error code from Microsoft or from the module?
(and if it's a serious problem) how can I resolve it?

Replies are listed 'Best First'.
Re: Win32::NetAdmin errors
by jsprat (Curate) on Mar 04, 2003 at 14:44 UTC
    87 is "The parameter is incorrect."

    You can use $^E or msdn has a complete list.

    $^E = 87; print $^E, $/; $^E = 86; print $^E; __END__ Output: The parameter is incorrect The specified network password is not correct
Re: Win32::NetAdmin errors
by Jenda (Abbot) on Mar 04, 2003 at 16:44 UTC
    use Win32; print Win32::FormatMessage(87);
    Most probably the $^E variable is set to this number&string as well ($^E is dual, just like $!).

    Maybe you'd get better results from Win32::Lanman. The Win32::NetAdmin is rather old and the docs are almost nonexistant.

    Jenda