net.pm

来自「ARM上的如果你对底层感兴趣」· PM 代码 · 共 1,799 行 · 第 1/4 页

PM
1,799
字号
=item C<UF_NORMAL_ACCOUNT()>

The account is a normal user account.

=item C<UF_PASSWD_CANT_CHANGE()>

The password for this account cannot be changed (execpt by an Administrator
using one of the above calls).

=item C<UF_PASSWD_NOTREQD()>

A password is not required for this account.

=item C<UF_SCRIPT()>

This <strong>must be set when creating account on Windows NT.

=item C<UF_SERVER_TRUST_ACCOUNT()>

The account represents a Windows NT Backup Domain Controller account in
the domain.

=item C<UF_TEMP_DUPLICATE_ACCOUNT()>

To quote the Microsoft Documentation <em>&quot;This is an account for
users whose primary account is in another domain. This account provides
user access to this domain, but not to any domain that trusts this domain.
The User Manager refers to this account type as a local user account.

=item C<UF_WORKSTATION_TRUST_ACCOUNT()>

The account represents a computer account for a workstation or server in
the domain.

=back

Please note that these are implemented as functions and are therefore
called in the same way as other functions. You should typically use them
like:

	$ufScript = Win32API::Net::UF_SCRIPT();

=head1 USER PRIVILEGE FLAGS

These following values are used in the C<priv> key. This field is never
initialised on a C<UserGet*()> call and once set cannot be changed in a
C<UserSetInfo()> call.

=over 8

=item C<USER_PRIV_ADMIN()>

Account is an an administrative account.

=item C<USER_PRIV_GUEST()>

Account is a guest account.

=item C<USER_PRIV_USER()>

Account is a user account.

=back

Please note that these are implemented as functions and are therefore
called in the same way as other functions. You should typically use them
like:

	$userPrivUser = Win32API::Net::USER_PRIV_USER();

=head1 USER ENUM FILTER

These flags are used in the C<UserEnum()> function to specify which
accounts to retrieve. It should be a bitwise OR of some (or all) of
the following.

=over 8

=item C<FILTER_TEMP_DUPLICATE_ACCOUNT()>

Show temporary duplicate account (one presumes).

=item C<FILTER_NORMAL_ACCOUNT()>

Show normal user account.

=item C<FILTER_INTERDOMAIN_TRUST_ACCOUNT()>

Show interdomain trust accounts.

=item C<FILTER_WORKSTATION_TRUST_ACCOUNT()>

Show workstation trust accounts.

=item C<FILTER_SERVER_TRUST_ACCOUNT()>

Show server trust accounts.

=back

Please note that these are implemented as functions and are therefore
called in the same way as other functions. You should typically use them
like:

	$filterNormalAccounts = Win32API::Net::FILTER_NORMAL_ACCOUNT();

=head1 USER FIELD ERRORS

For the C<User*()> functions that take an C<error> parameter this variable
will, on failure, contain one of the following constants. Note that the
function may fail because more than one key/value was missing from the
input hash. You will only find out about the first one that was incorrectly
specified. This is only really useful in debugging.

=over 8

=item C<USER_ACCT_EXPIRES_PARMNUM()>

C<acctExpires> field was absent or not correctly specified.

=item C<USER_AUTH_FLAGS_PARMNUM()>

C<authFlags> field was absent or not correctly specified.

=item C<USER_BAD_PW_COUNT_PARMNUM()>

C<badPasswordCount> field was absent or not correctly specified.

=item C<USER_CODE_PAGE_PARMNUM()>

C<codePage> field was absent or not correctly specified.

=item C<USER_COMMENT_PARMNUM()>

C<comment> field was absent or not correctly specified.

=item C<USER_COUNTRY_CODE_PARMNUM()>

C<countryCode> field was absent or not correctly specified.

=item C<USER_FLAGS_PARMNUM()>

C<flags> field was absent or not correctly specified.

=item C<USER_FULL_NAME_PARMNUM()>

C<fullName> field was absent or not correctly specified.

=item C<USER_HOME_DIR_DRIVE_PARMNUM()>

C<homeDirDrive> field was absent or not correctly specified.

=item C<USER_HOME_DIR_PARMNUM()>

C<homeDir> field was absent or not correctly specified.

=item C<USER_LAST_LOGOFF_PARMNUM()>

C<lastLogoff> field was absent or not correctly specified.

=item C<USER_LAST_LOGON_PARMNUM()>

C<lastLogon> field was absent or not correctly specified.

=item C<USER_LOGON_HOURS_PARMNUM()>

C<logonHours> field was absent or not correctly specified.

=item C<USER_LOGON_SERVER_PARMNUM()>

C<logonServer> field was absent or not correctly specified.

=item C<USER_MAX_STORAGE_PARMNUM()>

C<maxStorage> field was absent or not correctly specified.

=item C<USER_NAME_PARMNUM()>

C<name> field was absent or not correctly specified.

=item C<USER_NUM_LOGONS_PARMNUM()>

C<numLogons> field was absent or not correctly specified.

=item C<USER_PARMS_PARMNUM()>

C<parms> field was absent or not correctly specified.

=item C<USER_PASSWORD_AGE_PARMNUM()>

C<passwordAge> field was absent or not correctly specified.

=item C<USER_PASSWORD_PARMNUM()>

C<password> field was absent or not correctly specified.

=item C<USER_PRIMARY_GROUP_PARMNUM()>

C<primaryGroup> field was absent or not correctly specified.

=item C<USER_PRIV_PARMNUM()>

C<priv> field was absent or not correctly specified.

=item C<USER_PROFILE_PARMNUM()>

C<profile> field was absent or not correctly specified.

=item C<USER_SCRIPT_PATH_PARMNUM()>

C<scriptPath> field was absent or not correctly specified.

=item C<USER_UNITS_PER_WEEK_PARMNUM()>

C<unitPerWeek> field was absent or not correctly specified.

=item C<USER_USR_COMMENT_PARMNUM()>

C<usrComment> field was absent or not correctly specified.

=item C<USER_WORKSTATIONS_PARMNUM()>

C<workstations> field was absent or not correctly specified.

=back


=head1 GROUP INFO LEVELS

Some of the C<Group*()> functions take a C<level> parameter. This C<level>
specifies how much detail the corresponding C<hash> should contain (or in
the case of a C<GroupGetInfo()> function, will contain after the call).
The following C<level> descriptions provide information on what fields
should be present for a given level. See L<GROUP INFO FIELDS>
for a description of the fields.

=over 8

=item C<Level 0>

name.

=item C<Level 1>

name, comment.

=item C<Level 2>

name, comment, groupId, attributes.

=item C<Level 1002>

comment.

=item C<Level 1005>

attributes.

=back


=head1 GROUP INFO FIELDS

=over 8

=item C<attributes> - Scalar Int

The attributes of the group. These are no longer settable in Windows NT 4.0
and they are not currently supported in this package either.

=item C<comment> - Scalar String

The C<comment> that applies to this group. This is the only value that
can be set via a GroupSetInfo call.

=item C<groupId> - Scalar Int

The groups Id.

=item C<name> - Scalar String

The groups name.

=back



=head1 GROUP FIELD ERRORS

For the C<Group*()> functions that take an C<error> parameter
this variable will, on failure, contain one of the following constants.
Note that the function may fail because more than one key/value was
missing from the input hash. You will only find out about the first one
that was incorrectly specified. This is only really useful for debugging
purposes.

=over 8

=item C<GROUP_ATTRIBUTES_PARMNUM()>

C<attributes> field was absent or not correctly specified.

=item C<GROUP_COMMENT_PARMNUM()>

C<comment> field was absent or not correctly specified.

=item C<GROUP_NAME_PARMNUM()>

C<name> field was absent or not correctly specified.

=back



=head1 GROUP USERS INFO LEVELS

The C<GroupGetUsers()> function can take a level of 0 or 1. These will
return the following:

=over 8

=item C<Level 0>

name.

=item C<Level 1>

name, attributes.

=back


=head1 GROUP USERS INFO FIELDS

=over 8

=item C<name> - Scalar String

The user's name.

=item C<attributes> - Scalar Int

The attributes of the group. These are no longer settable in Windows NT
4.0 and they are not currently supported in this package either.

=back



=head1 LOCAL GROUP INFO LEVELS

=over 8

=item C<Level 0>

name

=item C<Level 1>

name, comment

=item C<Level 1002>

comment


=back



=head1 LOCAL GROUP INFO FIELDS

=over 8

=item C<name> - Scalar String

The groups name

=item C<comment> - Scalar String

The groups 'comment'

=back


=head1 LOCAL GROUP FIELD ERRORS

For the C<LocalGroup*()> functions that take an C<error> parameter this
variable will, on failure, contain one of the following constants. Note
that the function may fail because more than one key/value was missing
or incorrectly specified in the input hash. You will only find out about
the first one that was incorrectly specified. This is only really useful
for debugging purposes.

=over 8

=item C<LOCALGROUP_NAME_PARMNUM()>

The C<name> field was absent or not correctly specified.

=item C<LOCALGROUP_COMMENT_PARMNUM()>

The C<comment> field wasabsent or not correctly specified.

=back

=head1 EXAMPLES

The following example shows how you can create a function in Perl that
has the same functionality as the C<NetUserEnum()> API call. The Perl
version doesn't have the level parameter so you must first use the
C<UserEnum()> function to retrieve all the account names and then iterate
through the returned array issuing C<UserGetInfo()> calls.

    sub userEnumAtLevel {
       my($server, $level, $filter) = @_;
       my(@array);
       Win32API::Net::UserEnum($server, \@array, $filter);
       for $user (@array) {
	  Win32API::Net::UserGetInfo($server, $user, $level, \%hash);
	  print "This could access all level $level settings for $user - eg fullName $hash{fullName}\n";
       }
    }
    userEnumAtLevel("", 2, 0);



=head1 AUTHOR

Bret Giddings, <bret@essex.ac.uk>


=head1 SEE ALSO

C<perl(1)>


=head1 ACKNOWEDGEMENTS

This work was built upon work done by HiP Communications along with
modifications to HiPs code by <michael@ecel.uwa.edu.au> and <rothd@roth.net>.
In addition, I would like to thank Jenny Emby at GEC Marconi, U.K. for
proof reading this manual page and making many suggestions that have led
to its current layout. Last but not least I would like to thank Larry Wall
and all the other Perl contributors for making this truly wonderful
language.

=cut

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?