net.pm

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

PM
1,799
字号

=item C<group> - Scalar String

The C<group> whose information you wish to obtain.

=item C<level> - Scalar Int

The C<level> of information you wish to retrieve. This can be 0 or 1.
See L<LOCAL GROUP INFO LEVELS>.

=item C<hash> - Hash Reference

The hash that will contain the information.

=back

=head2 LocalGroupGetMembers(server, group, hash)

Retrieves the users belonging to C<group>. Unlike the API call
C<NetLocalGroupGetUsers()>, this function does not allow you to specify
a level (internally it is hardcoded to 0). In Perl it is trivial to
implement the equivalent function (should you need it).

=over 8

=item C<server> - Scalar String

The C<server> from which to retrieve the group information.

=item C<group> - Scalar String

The C<group> whose users you wish to obtain.

=item C<array> - Array Reference

The array to hold the user names retrieved.

=back

=head2 LocalGroupSetInfo(server, level, hash, error)

Sets the information for C<group> according to C<level>.

=over 8

=item C<server> - Scalar String

The C<server> on which to set the C<group> information.

=item C<group> - Scalar String

The C<group> whose information you wish to set.

=item C<level> - Scalar Int

The C<level> of information you are supplying in C<hash>.
Level can be one of 0 or 1. See L<LOCAL GROUP INFO LEVELS>.

=item C<hash> - Hash Reference

The hash containing the required key/value pairs for C<level>.

=item C<error> - Scalar String

On failure, the C<error> parameter will contain a value which specifies
which field caused the error. See L<LOCAL GROUP FIELD ERRORS>.

=back

=head2 LocalGroupSetMembers()

This function has not been implemented at present.


=head1 NET GET FUNCTIONS

=head2 GetDCName(server, domain, domain-controller)

Gets the C<domain-controllder> name for C<server> and C<domain>.

=over 8

=item C<server> - Scalar String

The C<server> whose domain controller you wish to locate.

=item C<domain> - Scalar String

The C<domain> that C<server> is a member of whose domain-controller
you wish the locate.

=item C<domain-controller> - Scalar String (output)

The name of the C<domain-controller> for the requested C<domain>.

=back

Note: This module does not implement the C<NetGetAnyDCName()>API function
as this is obsolete.



=head1 USER INFO LEVELS

Most of the C<User*()> 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<UserGet*()> 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<USER INFO FIELDS> for a description of
the fields.

=over 8

=item Level 0

name

=item Level 1

name, password, passwordAge, priv, homeDir, comment, flags, scriptPath

=item Level 2

name, password, passwordAge, priv, homeDir, comment, flags, scriptPath,
authFlags, fullName, usrComment, parms, workstations, lastLogon,
lastLogoff, acctExpires, maxStorage, unitsPerWeek, logonHours, badPwCount,
numLogons, logonServer, countryCode, codePage

=item Level 3

name, password, passwordAge, priv, homeDir, comment, flags, scriptPath,
authFlags, fullName, usrComment, parms, workstations, lastLogon, lastLogoff,
acctExpires, maxStorage, unitsPerWeek, logonHours, badPwCount, numLogons,
logonServer, countryCode, codePage, userId, primaryGroupId, profile,
homeDirDrive, passwordExpired

=item Level 10

name, comment, usrComment, fullName

=item Level 11

name, comment, usrComment, fullName, priv, authFlags, passwordAge, homeDir,
parms, lastLogon, lastLogoff, badPwCount, numLogons, logonServer,
countryCode, workstations, maxStorage, unitsPerWeek, logonHours, codePage

=item Level 20

name, fullName, comment, flags, userId

=item Level 21

B<Not available in this implementation>

=item Level 22

B<Not available in this implementation>

=item Level 1003

password

=item Level 1005

priv

=item Level 1006

homeDir

=item Level 1007

comment

=item Level 1008

flags

=item Level 1009

scriptPath

=item Level 1010

authFlags

=item Level 1011

fullName

=item Level 1012

usrComment

=item Level 1013

parms

=item Level 1014

workstations

=item Level 1017

acctExpires

=item Level 1018

maxStorage

=item Level 1020

unitsPerWeek, logonHours

=item Level 1023

logonServer

=item Level 1024

countryCode

=item Level 1025

codePage

=item Level 1051

primaryGroupId

=item Level 1052

profile

=item Level 1053

homeDirDrive

=back



=head1 USER INFO FIELDS

The following is an alphabetical listing of each possible field, together
with the data type that the field is expected to contain.

=over 8

=item C<acctExpires> - Scalar Int (UTC)

The time (as the number of seconds since 00:00:00, 1st January 1970) when
the account expires. A -1 in this field specifies that the account never
expires.

=item C<authFlags> - Scalar Int (See USER_AUTH_FLAGS).

The level of authority that this use has. The value this can take depends
on the users group membership - this value is therefore read only and
cannot be set using C<UserAdd()> or C<UserSetInfo()>. Its value can be one
of:

=back


	User belongs to group		Flag value
	---------------------		----------
	Print Operators			Win32API::Net::AF_OP_PRINT()
	Server Operators		Win32API::Net::AF_OP_SERVER()
	Account Operators		Win32API::Net::AF_OP_ACCOUNTS()


=over 8

=item C<badPwCount> - Scalar Int

The number of times that the user has failed to logon by specifying an
incorrect password.

=item C<codePage> - Scalar Int

The code page that this user uses.

=item C<comment> - Scalar String

The comment associated with this user account. This can be any string
(apparently of any length).

=item C<countryCode> - Scalar Int

The country code that this user uses.

=item C<flags> - Scalar Int (Bitwise OR of USER_FLAGS)

The flags for this user. See L<USER FLAGS>.

=item C<fullName> - Scalar String

The users' full name.

=item C<homeDir> - Scalar String

The home directory of the user. This can be either a UNC path or an
absolute path (drive letter + path). Can be the empty string ("").

=item C<homeDirDrive> - Scalar String

The home directory drive that the users home directory is mapped to
(assuming that the specified home directory is a UNC path).

=item C<lastLogon> - Scalar Int (UTC)

The time (as the number of seconds since 00:00:00, 1st January 1970)
that the user last logged on.

=item C<lastLogoff> - Scalar Int (UTC)

The time (as the number of seconds since 00:00:00, 1st January 1970)
that the user last logged off .

=item C<logonHours> - Reference to Array of Integers (length 21 elements)

The times at which the user can logon. This should be an integer array
with 21 elements.  Each element represents an 8 hour period and each bit
represents represents an hour. Only the lower byte of each integer is
used. If this is left undefined then no restrictions are placed on the
account.

=item C<logonServer> - Scalar String

The logon server for this user. Under Windows NT, this value cannot be
set and will always have the value '\\*' when queried.

=item C<maxStorage> - Scalar Int

The current release of Windows NT does not implement disk quotas so
it is believed that the value of this key is ignored.

=item C<name> - Scalar String

The user name that this request applies to. Most of the functions take
the user name as a separate argument. In general, the user name provided
should be the same as that in the one provided in the hash.

=item C<numLogons> - Scalar Int

The number of times that the named user has successfully logged on to
this machine/domain.

=item C<parms> - Scalar String

The value of this key can be used by applications. There are none known
to to author that use it, although it could be used to hold adminitrative
information.

=item C<password> - Scalar String

The password to be set. The password is never returned in a C<UserGet()>
operation.

=item C<passwordAge> - Scalar Int (UTC)

The current age of the password (stored as the number of seconds since
00:00:00, 1st January 1970).

=item C<passwordExpired> - Scalar Int

The value of this key is used in two different ways. When queried via
C<UserGetInfo()> the return value is 0 is the password has not expired
and 1 if it has. When setting the value via C<UserAdd()> or
C<UserSetInfo()> a value of 0 indicates that the users' password has
not expired whereas a value of 1 will force the user to change their
password at the next logon.

=item C<primaryGroupId> - Scalar Int

The id of the primary group that this user belongs to. When creating
accounts with C<UserAdd()> you should use a value of 0x201.

=item C<priv> - Scalar Int (Bitwise OR of USER_PRIVILEGE_FLAGS)

The privilege level that this user has. This is never returned from a
C<UserGet()> call. See L<USER PRIVILEGE FLAGS>.

=item C<profile> - Scalar String

The profile that is associated with the named user. This can be UNC path,
a local path or undefined.

=item C<scriptPath> - Scalar String

The path to the logon script for this user. This should be specified as a
relative path and will cause the logon script to be run from (relative
location) in the logon servers export directory.

=item C<unitsPerWeek> - Scalar Int

The value of this key represents the granularity of the logonHours array.
Its use is beyond the scope of this package.

=item C<usrComment> - Scalar String

The user comment field (contrasted with the comment field ;-).

=item C<workstations> - Scalar String

A comma-separated string containing upto 8 workstation that the named
user can login to.  Setting a value for this key will then allow the
named user to login to only those computers named.

=item C<userId> - Scalar Int

The user id associated with this user This value is generated by the
system and cannot be set or changed using the C<UserAdd()> or
C<UserSetInfo()> calls.

=back



=head1 USER FLAGS

The following is an alphabetical listing of the user flags.
The C<flags> key (see L<USER INFO FIELDS>) should be the bitwise OR of one
or more of these values.

=over 8

=item C<UF_ACCOUNTDISABLE()>

This account has been disabled.

=item C<UF_DONT_EXPIRE_PASSWORD()>

Never expire the password on this account.

=item C<UF_HOMEDIR_REQUIRED()>

A home directory must be specified (ignored for NT).

=item C<UF_INTERDOMAIN_TRUST_ACCOUNT()>

The account represents a interdomain trust account.

=item C<UF_LOCKOUT()>

Lock out this account (or this account has been locked out due to
security policy - i.e.  badLogonCount is greater than your policy allows).
This value can be cleared but not set by a C<UserSetInfo()> call.

⌨️ 快捷键说明

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