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

I'm writing a script to add, change, delete, and verify users in an NT Domain. I have a two sided question. First, is there a variable in the Lanman module to set privileges? The program has to handle admin adds from a transaction file, but I can't find the Lanman Man pages anywhere or find anything out about how to set up a user as an admin. However, Win32::NetAdmin can do this really easy. The only problem is, NetAdmin doesn't have a GetLastError feature like Lanman does. So, does anyone know how to make a user an admin using Lanman (or even have the man pages)? Or does anyone know how to get the last error using NetAdmin?

Thanks!
kevin

Replies are listed 'Best First'.
Re: Lanman Privleges?
by joefission (Monk) on Jul 06, 2001 at 19:47 UTC
    I would suggest using Dave Roth's Win32::AdminMisc module. Much easier to use than LanMan (maybe it's the documentation that makes it easier).

    To create an Administrator, you simply add the userid to the Administrator's group (local or domain, depending on your needs).

    Super Search is your friend. You can find scripts to modify for your needs, such as adding users. You might look through the Code Catacombs for Win32 and NT stuff too.

    man pages for lanman can be found after unzipping the file. It should be under the Win32/lanman section of your ActivePerl Help web page. If you installed into c:/perl, look under c:/perl/html/index.html.

    joe

Re: Lanman Privleges?
by LD2 (Curate) on Jul 06, 2001 at 20:04 UTC
    the GetLastError function is part of Win32. If you do use Win32::NetAdmin, add use Win32; in order to access Win32::GetLastError(). You want to format it like this:

    Win32::FormatMessage(Win32::GetLastError());

      Or just use $^E.

              - tye (but my friends call me "Tye")