Skip to content

Commit 05a8ff2

Browse files
committed
Load libwin32-0.12 into trunk.
1 parent 8acb3ce commit 05a8ff2

File tree

3 files changed

+596
-24
lines changed

3 files changed

+596
-24
lines changed

Changes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
Revision history for Perl extension Win32::NetAdmin.
22

3+
0.05 Sun May 10 22:39:01 1998
4+
- removed broken #ifdefs that disabled UserChangePassword() and
5+
other functions
6+
- fix broken constants and add new ones (courtesy Dave Roth
7+
8+
- export :ALL functions (courtesy Tye McQueen <[email protected]>)
9+
- New functions GetAliasFromRID(), GetUserGroupFromRID(), and
10+
GetServerDisks(). LocalGroupGetMembersWithDomain() fixes
11+
(courtesy Jutta M. Klebe <[email protected]>)
12+
13+
0.04 (unreleased)
14+
- added LocalGroupGetMembersWithDomain() via
15+
David Gardiner <[email protected]>
316

417
0.03 Fri Feb 6 21:02:31 1998
518
- fixes and enhancements courtesy Jutta Klebe <[email protected]>

NetAdmin.pm

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package Win32::NetAdmin;
55
#Written by [email protected]
66
#
77

8-
$VERSION = '0.03';
8+
$VERSION = '0.05';
99

1010
require Exporter;
1111
require DynaLoader;
@@ -17,6 +17,20 @@ die "The Win32::NetAdmin module works only on Windows NT" if(!Win32::IsWinNT() )
1717
# names by default without a very good reason. Use EXPORT_OK instead.
1818
# Do not simply export all your public functions/methods/constants.
1919
@EXPORT = qw(
20+
DOMAIN_ALIAS_RID_ACCOUNT_OPS
21+
DOMAIN_ALIAS_RID_ADMINS
22+
DOMAIN_ALIAS_RID_BACKUP_OPS
23+
DOMAIN_ALIAS_RID_GUESTS
24+
DOMAIN_ALIAS_RID_POWER_USERS
25+
DOMAIN_ALIAS_RID_PRINT_OPS
26+
DOMAIN_ALIAS_RID_REPLICATOR
27+
DOMAIN_ALIAS_RID_SYSTEM_OPS
28+
DOMAIN_ALIAS_RID_USERS
29+
DOMAIN_GROUP_RID_ADMINS
30+
DOMAIN_GROUP_RID_GUESTS
31+
DOMAIN_GROUP_RID_USERS
32+
DOMAIN_USER_RID_ADMIN
33+
DOMAIN_USER_RID_GUEST
2034
FILTER_TEMP_DUPLICATE_ACCOUNT
2135
FILTER_NORMAL_ACCOUNT
2236
FILTER_INTERDOMAIN_TRUST_ACCOUNT
@@ -32,7 +46,9 @@ die "The Win32::NetAdmin module works only on Windows NT" if(!Win32::IsWinNT() )
3246
SV_TYPE_NOVELL
3347
SV_TYPE_DOMAIN_MEMBER
3448
SV_TYPE_PRINT
49+
SV_TYPE_PRINTQ_SERVER
3550
SV_TYPE_DIALIN
51+
SV_TYPE_DIALIN_SERVER
3652
SV_TYPE_XENIX_SERVER
3753
SV_TYPE_NT
3854
SV_TYPE_WFW
@@ -41,6 +57,15 @@ die "The Win32::NetAdmin module works only on Windows NT" if(!Win32::IsWinNT() )
4157
SV_TYPE_MASTER_BROWSER
4258
SV_TYPE_DOMAIN_MASTER
4359
SV_TYPE_DOMAIN_ENUM
60+
SV_TYPE_SERVER_UNIX
61+
SV_TYPE_SERVER_MFPN
62+
SV_TYPE_SERVER_NT
63+
SV_TYPE_SERVER_OSF
64+
SV_TYPE_SERVER_VMS
65+
SV_TYPE_WINDOWS
66+
SV_TYPE_DFS
67+
SV_TYPE_ALTERNATE_XPORT
68+
SV_TYPE_LOCAL_LIST_ONLY
4469
SV_TYPE_ALL
4570
UF_TEMP_DUPLICATE_ACCOUNT
4671
UF_NORMAL_ACCOUNT
@@ -66,6 +91,43 @@ die "The Win32::NetAdmin module works only on Windows NT" if(!Win32::IsWinNT() )
6691
USER_PRIV_ADMIN
6792
);
6893

94+
@EXPORT_OK = qw(
95+
GetError
96+
GetDomainController
97+
GetAnyDomainController
98+
UserCreate
99+
UserDelete
100+
UserGetAttributes
101+
UserSetAttributes
102+
UserChangePassword
103+
UsersExist
104+
GetUsers
105+
GroupCreate
106+
GroupDelete
107+
GroupGetAttributes
108+
GroupSetAttributes
109+
GroupAddUsers
110+
GroupDeleteUsers
111+
GroupIsMember
112+
GroupGetMembers
113+
LocalGroupCreate
114+
LocalGroupDelete
115+
LocalGroupGetAttributes
116+
LocalGroupSetAttributes
117+
LocalGroupIsMember
118+
LocalGroupGetMembers
119+
LocalGroupGetMembersWithDomain
120+
LocalGroupAddUsers
121+
LocalGroupDeleteUsers
122+
GetServers
123+
GetTransports
124+
LoggedOnUsers
125+
GetAliasFromRID
126+
GetUserGroupFromRID
127+
GetServerDisks
128+
);
129+
$EXPORT_TAGS{ALL}= \@EXPORT_OK;
130+
69131
=head1 NAME
70132
71133
Win32::NetAdmin - manage network groups and users in perl
@@ -186,6 +248,23 @@ Returns TRUE if user is a member of groupName.
186248
187249
Fills userArrayRef with the members of groupName.
188250
251+
=item LocalGroupGetMembersWithDomain(server, groupName, userRef)
252+
253+
This function is similar LocalGroupGetMembers but accepts an array or
254+
a hash reference. Unlike LocalGroupGetMembers it returns each user name
255+
as C<DOMAIN\USERNAME>. If a hash reference is given, the function
256+
returns to each user or group name the type (group, user, alias etc.).
257+
The possible types are as follows:
258+
259+
$SidTypeUser = 1;
260+
$SidTypeGroup = 2;
261+
$SidTypeDomain = 3;
262+
$SidTypeAlias = 4;
263+
$SidTypeWellKnownGroup = 5;
264+
$SidTypeDeletedAccount = 6;
265+
$SidTypeInvalid = 7;
266+
$SidTypeUnknown = 8;
267+
189268
=item LocalGroupAddUsers(server, groupName, users)
190269
191270
Adds a user to a group.
@@ -212,6 +291,36 @@ Gets an array or hash with the users logged on at the specified computer. If
212291
userRef is a hash reference, the value is a semikolon separated string of
213292
username, logon domain and logon server.
214293
294+
=item GetAliasFromRID(server, RID, returnedName)
295+
296+
=item GetUserGroupFromRID(server, RID, returnedName)
297+
298+
Retrieves the name of an alias (i.e local group) or a user group for a RID
299+
from the specified server. These functions can be used for example to get the
300+
account name for the administrator account if it is renamed or localized.
301+
302+
Possible values for C<RID>:
303+
304+
DOMAIN_ALIAS_RID_ACCOUNT_OPS
305+
DOMAIN_ALIAS_RID_ADMINS
306+
DOMAIN_ALIAS_RID_BACKUP_OPS
307+
DOMAIN_ALIAS_RID_GUESTS
308+
DOMAIN_ALIAS_RID_POWER_USERS
309+
DOMAIN_ALIAS_RID_PRINT_OPS
310+
DOMAIN_ALIAS_RID_REPLICATOR
311+
DOMAIN_ALIAS_RID_SYSTEM_OPS
312+
DOMAIN_ALIAS_RID_USERS
313+
DOMAIN_GROUP_RID_ADMINS
314+
DOMAIN_GROUP_RID_GUESTS
315+
DOMAIN_GROUP_RID_USERS
316+
DOMAIN_USER_RID_ADMIN
317+
DOMAIN_USER_RID_GUEST
318+
319+
=item GetServerDisks(server, arrayRef)
320+
321+
Returns an array with the disk drives of the specified server. The array
322+
contains two-character strings (drive letter followed by a colon).
323+
215324
=back
216325
217326
=cut
@@ -236,6 +345,15 @@ sub AUTOLOAD {
236345
goto &$AUTOLOAD;
237346
}
238347

348+
$SidTypeUser = 1;
349+
$SidTypeGroup = 2;
350+
$SidTypeDomain = 3;
351+
$SidTypeAlias = 4;
352+
$SidTypeWellKnownGroup = 5;
353+
$SidTypeDeletedAccount = 6;
354+
$SidTypeInvalid = 7;
355+
$SidTypeUnknown = 8;
356+
239357
bootstrap Win32::NetAdmin;
240358

241359
1;

0 commit comments

Comments
 (0)