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

Hello, I need a bit of help understanding two functions in the Win32::NetAdmin module. I want to use it to add a new user to my Windows 2008 server but my problem is the cpan page for the module is a bit vague for me. What it says is this:
UserCreate(server, userName, password, passwordAge, privilege, homeDir +, comment, flags, scriptPath) Creates a user on server with password, passwordAge, privilege, homeDi +r, comment, flags, and scriptPath.
No more mention of the command is used. I understand what "server, UserName, password" would be but can anyone give me more details as to what the rest are and if there optional or not? Thanks so much.

Replies are listed 'Best First'.
Re: Need help understanding Win32:NetAdmin
by Anonymous Monk on Oct 10, 2009 at 16:40 UTC
    win32 netadmin UserCreate:

    Win32 Perl - The Perl Journal, Fall 1997

    Just a few notes about the Win32::NetAdmin::UserCreate() function shown above: $Domain can be a domain name, a server or an empty string (the default domain); $PasswordAge is ignored and will not be used; the privilege must be USER_PRIV_USER (administrator privileges are assigned by group membership); and for the flags you must at specify at least these two flags ORed together: UF_NORMAL_ACCOUNT and UF_SCRIPT. Other flags that you can use are:
    UF_ACCOUNTDISABLE Disable the account UF_PASSWD_NOTREQD No password is required UF_PASSWD_CANT_CHANGE User can't change the password
      Thanks but what about homeDir and comment? Also I don't have any scripts to be ran by the user so would I just leave it an empty script or would that screw up the login?

        This are fields that can be set for Windows users. If you leave them empty it should not be a problem for you.