2 libnetapi interface definition
5 cpp_quote
("#define LIBNETAPI_LOCAL_SERVER(x) (!x || is_myname_or_ipaddr(x))")
6 cpp_quote
("#ifndef MAXSUBAUTHS")
7 cpp_quote
("#define MAXSUBAUTHS 15 /* max sub authorities in a SID */")
11 pointer_default(unique)
15 const int ERROR_MORE_DATA
= 234L;
17 [public] typedef [v1_enum] enum {
21 [public] typedef struct {
25 uint32 sub_auths
[MAXSUBAUTHS
];
28 /*******************************************/
30 /*******************************************/
32 [nopush
,nopull
] NET_API_STATUS NetJoinDomain
(
33 [in,unique] string *server
,
34 [in,ref] string *domain
,
35 [in,unique] string *account_ou
,
36 [in,unique] string *account
,
37 [in,unique] string *password
,
38 [in] uint32 join_flags
41 /*******************************************/
43 /*******************************************/
45 [nopush
,nopull
] NET_API_STATUS NetUnjoinDomain
(
46 [in,unique] string *server_name
,
47 [in,unique] string *account
,
48 [in,unique] string *password
,
49 [in] uint32 unjoin_flags
52 /*******************************************/
53 /* NetGetJoinInformation */
54 /*******************************************/
56 [nopush
,nopull
] NET_API_STATUS NetGetJoinInformation
(
57 [in,unique] string *server_name
,
58 [out] string **name_buffer
,
59 [out] uint16
*name_type
62 /*******************************************/
63 /* NetGetJoinableOUs */
64 /*******************************************/
66 [nopush
,nopull
] NET_API_STATUS NetGetJoinableOUs
(
67 [in,unique] string *server_name
,
68 [in,ref] string *domain
,
69 [in,unique] string *account
,
70 [in,unique] string *password
,
71 [out] uint32
*ou_count
,
75 /*******************************************/
76 /* NetServerGetInfo */
77 /*******************************************/
79 [public] typedef struct {
80 string sv1005_comment
;
83 [nopush
,nopull
] NET_API_STATUS NetServerGetInfo
(
84 [in,unique] string *server_name
,
89 /*******************************************/
90 /* NetServerSetInfo */
91 /*******************************************/
93 [nopush
,nopull
] NET_API_STATUS NetServerSetInfo
(
94 [in,unique] string *server_name
,
97 [out] uint32
*parm_error
100 /*******************************************/
102 /*******************************************/
104 [nopush
,nopull
] NET_API_STATUS NetGetDCName
(
105 [in,unique] string *server_name
,
106 [in,unique] string *domain_name
,
110 /*******************************************/
111 /* NetGetAnyDCName */
112 /*******************************************/
114 [nopush
,nopull
] NET_API_STATUS NetGetAnyDCName
(
115 [in,unique] string *server_name
,
116 [in,unique] string *domain_name
,
120 /*******************************************/
122 /*******************************************/
124 [public] typedef struct {
125 string domain_controller_name
;
126 string domain_controller_address
;
127 uint32 domain_controller_address_type
;
130 string dns_forest_name
;
133 string client_site_name
;
134 } DOMAIN_CONTROLLER_INFO
;
136 [nopush
,nopull
] NET_API_STATUS DsGetDcName
(
137 [in,unique] string *server_name
,
138 [in,ref] string *domain_name
,
139 [in,unique] GUID
*domain_guid
,
140 [in,unique] string *site_name
,
142 [out,ref] DOMAIN_CONTROLLER_INFO
**dc_info
145 /*******************************************/
147 /*******************************************/
149 [public] typedef struct {
154 const int USER_PRIV_GUEST
= 0;
155 const int USER_PRIV_USER
= 1;
156 const int USER_PRIV_ADMIN
= 2;
158 [public] typedef struct {
160 string usri1_password
;
161 uint32 usri1_password_age
;
163 string usri1_home_dir
;
164 string usri1_comment
;
166 string usri1_script_path
;
169 /* auth_flags in USER_INFO_2 */
171 const int AF_OP_PRINT
= 0x1;
172 const int AF_OP_COMM
= 0x2;
173 const int AF_OP_SERVER
= 0x4;
174 const int AF_OP_ACCOUNTS
= 0x8;
175 const int AF_SETTABLE_BITS
= (AF_OP_PRINT | AF_OP_COMM | AF_OP_SERVER | AF_OP_ACCOUNTS
);
177 const int USER_MAXSTORAGE_UNLIMITED
= (uint32_t
)-1L;
179 [public] typedef struct {
181 string usri2_password
;
182 uint32 usri2_password_age
;
184 string usri2_home_dir
;
185 string usri2_comment
;
187 string usri2_script_path
;
188 uint32 usri2_auth_flags
;
189 string usri2_full_name
;
190 string usri2_usr_comment
;
192 string usri2_workstations
;
193 uint32 usri2_last_logon
;
194 uint32 usri2_last_logoff
;
195 uint32 usri2_acct_expires
;
196 uint32 usri2_max_storage
;
197 uint32 usri2_units_per_week
;
198 uint8
*usri2_logon_hours
;
199 uint32 usri2_bad_pw_count
;
200 uint32 usri2_num_logons
;
201 string usri2_logon_server
;
202 uint32 usri2_country_code
;
203 uint32 usri2_code_page
;
206 [public] typedef struct {
208 uint32 usri3_password_age
;
210 string usri3_home_dir
;
211 string usri3_comment
;
213 string usri3_script_path
;
214 uint32 usri3_auth_flags
;
215 string usri3_full_name
;
216 string usri3_usr_comment
;
218 string usri3_workstations
;
219 uint32 usri3_last_logon
;
220 uint32 usri3_last_logoff
;
221 uint32 usri3_acct_expires
;
222 uint32 usri3_max_storage
;
223 uint32 usri3_units_per_week
;
224 uint8
*usri3_logon_hours
;
225 uint32 usri3_bad_pw_count
;
226 uint32 usri3_num_logons
;
227 string usri3_logon_server
;
228 uint32 usri3_country_code
;
229 uint32 usri3_code_page
;
230 uint32 usri3_user_id
;
231 uint32 usri3_primary_group_id
;
232 string usri3_profile
;
233 string usri3_home_dir_drive
;
234 uint32 usri3_password_expired
;
237 [public] typedef struct {
239 string usri4_password
;
240 uint32 usri4_password_age
;
242 string usri4_home_dir
;
243 string usri4_comment
;
245 string usri4_script_path
;
246 uint32 usri4_auth_flags
;
247 string usri4_full_name
;
248 string usri4_usr_comment
;
250 string usri4_workstations
;
251 uint32 usri4_last_logon
;
252 uint32 usri4_last_logoff
;
253 uint32 usri4_acct_expires
;
254 uint32 usri4_max_storage
;
255 uint32 usri4_units_per_week
;
256 uint8
*usri4_logon_hours
;
257 uint32 usri4_bad_pw_count
;
258 uint32 usri4_num_logons
;
259 string usri4_logon_server
;
260 uint32 usri4_country_code
;
261 uint32 usri4_code_page
;
262 domsid
*usri4_user_sid
;
263 uint32 usri4_primary_group_id
;
264 string usri4_profile
;
265 string usri4_home_dir_drive
;
266 uint32 usri4_password_expired
;
269 [public] typedef struct {
271 string usri10_comment
;
272 string usri10_usr_comment
;
273 string usri10_full_name
;
276 [public] typedef struct {
278 string usri11_comment
;
279 string usri11_usr_comment
;
280 string usri11_full_name
;
282 uint32 usri11_auth_flags
;
283 uint32 usri11_password_age
;
284 string usri11_home_dir
;
286 uint32 usri11_last_logon
;
287 uint32 usri11_last_logoff
;
288 uint32 usri11_bad_pw_count
;
289 uint32 usri11_num_logons
;
290 string usri11_logon_server
;
291 uint32 usri11_country_code
;
292 string usri11_workstations
;
293 uint32 usri11_max_storage
;
294 uint32 usri11_units_per_week
;
295 uint8
*usri11_logon_hours
;
296 uint32 usri11_code_page
;
299 [public] typedef struct {
301 string usri20_full_name
;
302 string usri20_comment
;
304 uint32 usri20_user_id
;
307 const int ENCRYPTED_PWLEN
= 16;
309 [public] typedef struct {
310 uint8 usri21_password
[ENCRYPTED_PWLEN
];
313 [public] typedef struct {
315 uint8 usri22_password
[ENCRYPTED_PWLEN
];
316 uint32 usri22_password_age
;
318 string usri22_home_dir
;
319 string usri22_comment
;
321 uint32 usri22_script_path
;
322 uint32 usri22_auth_flags
;
323 string usri22_full_name
;
324 string usri22_usr_comment
;
326 string usri22_workstations
;
327 uint32 usri22_last_logon
;
328 uint32 usri22_last_logoff
;
329 uint32 usri22_acct_expires
;
330 uint32 usri22_max_storage
;
331 uint32 usri22_units_per_week
;
332 uint8
*usri22_logon_hours
;
333 uint32 usri22_bad_pw_count
;
334 uint32 usri22_num_logons
;
335 string usri22_logon_server
;
336 uint32 usri22_country_code
;
337 uint32 usri22_code_page
;
340 [public] typedef struct {
342 string usri23_full_name
;
343 string usri23_comment
;
345 domsid
*usri23_user_sid
;
348 [public] typedef struct {
349 string usri1003_password
;
352 [public] typedef struct {
353 uint32 usri1005_priv
;
356 [public] typedef struct {
357 string usri1006_home_dir
;
360 [public] typedef struct {
361 string usri1007_comment
;
364 [public] typedef struct {
365 uint32 usri1008_flags
;
368 [public] typedef struct {
369 string usri1009_script_path
;
372 [public] typedef struct {
373 uint32 usri1010_auth_flags
;
376 [public] typedef struct {
377 string usri1011_full_name
;
380 [public] typedef struct {
381 string usri1012_usr_comment
;
384 [public] typedef struct {
385 string usri1013_parms
;
388 [public] typedef struct {
389 string usri1014_workstations
;
392 [public] typedef struct {
393 uint32 usri1017_acct_expires
;
396 [public] typedef struct {
397 uint32 usri1018_max_storage
;
400 [public] typedef struct {
401 uint32 usri1020_units_per_week
;
402 uint8
*usri1020_logon_hours
;
405 [public] typedef struct {
406 string usri1023_logon_server
;
409 [public] typedef struct {
410 uint32 usri1024_country_code
;
413 [public] typedef struct {
414 uint32 usri1025_code_page
;
417 [public] typedef struct {
418 uint32 usri1051_primary_group_id
;
421 [public] typedef struct {
422 string usri1052_profile
;
425 [public] typedef struct {
426 string usri1053_home_dir_drive
;
429 [public] typedef struct {
431 string usriX_password
;
432 uint32 usriX_password_age
;
434 string usriX_home_dir
;
435 string usriX_comment
;
437 string usriX_script_path
;
438 uint32 usriX_auth_flags
;
439 string usriX_full_name
;
440 string usriX_usr_comment
;
442 string usriX_workstations
;
443 uint32 usriX_last_logon
;
444 uint32 usriX_last_logoff
;
445 uint32 usriX_acct_expires
;
446 uint32 usriX_max_storage
;
447 uint32 usriX_units_per_week
;
448 uint8
*usriX_logon_hours
;
449 uint32 usriX_bad_pw_count
;
450 uint32 usriX_num_logons
;
451 string usriX_logon_server
;
452 uint32 usriX_country_code
;
453 uint32 usriX_code_page
;
454 string usriX_profile
;
455 string usriX_home_dir_drive
;
456 uint32 usriX_primary_group_id
;
459 [nopush
,nopull
] NET_API_STATUS NetUserAdd
(
460 [in,unique] string *server_name
,
462 [in,ref] uint8
*buffer
,
463 [out,ref] uint32
*parm_error
466 /*******************************************/
468 /*******************************************/
470 [nopush
,nopull
] NET_API_STATUS NetUserDel
(
471 [in,unique] string *server_name
,
472 [in,ref] string *user_name
475 /*******************************************/
477 /*******************************************/
479 const int FILTER_TEMP_DUPLICATE_ACCOUNT
= 0x0001;
480 const int FILTER_NORMAL_ACCOUNT
= 0x0002;
481 const int FILTER_INTERDOMAIN_TRUST_ACCOUNT
= 0x0008;
482 const int FILTER_WORKSTATION_TRUST_ACCOUNT
= 0x0010;
483 const int FILTER_SERVER_TRUST_ACCOUNT
= 0x0020;
485 [nopush
,nopull
] NET_API_STATUS NetUserEnum
(
486 [in,unique] string *server_name
,
489 [out,ref] uint8
**buffer
,
490 [in] uint32 prefmaxlen
,
491 [out,ref] uint32
*entries_read
,
492 [out,ref] uint32
*total_entries
,
493 [in,out,ref] uint32
*resume_handle
496 /*******************************************/
497 /* NetUserChangePassword */
498 /*******************************************/
500 [nopush
,nopull
] NET_API_STATUS NetUserChangePassword
(
501 [in] string domain_name
,
502 [in] string user_name
,
503 [in] string old_password
,
504 [in] string new_password
507 /*******************************************/
509 /*******************************************/
511 [nopush
,nopull
] NET_API_STATUS NetUserGetInfo
(
512 [in] string server_name
,
513 [in] string user_name
,
518 /*******************************************/
520 /*******************************************/
522 [nopush
,nopull
] NET_API_STATUS NetUserSetInfo
(
523 [in] string server_name
,
524 [in] string user_name
,
527 [out] uint32
*parm_err
530 /*******************************************/
531 /* NetUserGetGroups */
532 /*******************************************/
534 [public] typedef struct {
536 } GROUP_USERS_INFO_0
;
538 [public] typedef struct {
540 uint32 grui1_attributes
;
541 } GROUP_USERS_INFO_1
;
543 [nopush
,nopull
] NET_API_STATUS NetUserGetGroups
(
544 [in] string server_name
,
545 [in] string user_name
,
547 [out] uint8
**buffer
,
548 [in] uint32 prefmaxlen
,
549 [out,ref] uint32
*entries_read
,
550 [out,ref] uint32
*total_entries
553 /*******************************************/
554 /* NetUserModalsGet */
555 /*******************************************/
557 const int TIMEQ_FOREVER
= (uint32_t
)-1L;
560 uint32 usrmod0_min_passwd_len
;
561 uint32 usrmod0_max_passwd_age
;
562 uint32 usrmod0_min_passwd_age
;
563 uint32 usrmod0_force_logoff
;
564 uint32 usrmod0_password_hist_len
;
565 } USER_MODALS_INFO_0
;
569 string usrmod1_primary
;
570 } USER_MODALS_INFO_1
;
573 string usrmod2_domain_name
;
574 domsid
*usrmod2_domain_id
;
575 } USER_MODALS_INFO_2
;
578 uint32 usrmod3_lockout_duration
;
579 uint32 usrmod3_lockout_observation_window
;
580 uint32 usrmod3_lockout_threshold
;
581 } USER_MODALS_INFO_3
;
584 uint32 usrmod1001_min_passwd_len
;
585 } USER_MODALS_INFO_1001
;
588 uint32 usrmod1002_max_passwd_age
;
589 } USER_MODALS_INFO_1002
;
592 uint32 usrmod1003_min_passwd_age
;
593 } USER_MODALS_INFO_1003
;
596 uint32 usrmod1004_force_logoff
;
597 } USER_MODALS_INFO_1004
;
600 uint32 usrmod1005_password_hist_len
;
601 } USER_MODALS_INFO_1005
;
604 uint32 usrmod1006_role
;
605 } USER_MODALS_INFO_1006
;
608 string usrmod1007_primary
;
609 } USER_MODALS_INFO_1007
;
611 [nopush
,nopull
] NET_API_STATUS NetUserModalsGet
(
612 [in] string server_name
,
614 [out,ref] uint8
**buffer
617 /*******************************************/
618 /* NetUserModalsSet */
619 /*******************************************/
621 [nopush
,nopull
] NET_API_STATUS NetUserModalsSet
(
622 [in] string server_name
,
625 [out,ref] uint32
*parm_err
628 /*******************************************/
629 /* NetQueryDisplayInformation */
630 /*******************************************/
632 [public] typedef struct {
634 string usri1_comment
;
636 string usri1_full_name
;
637 uint32 usri1_user_id
;
638 uint32 usri1_next_index
;
641 [public] typedef struct {
643 string usri2_comment
;
645 uint32 usri2_user_id
;
646 uint32 usri2_next_index
;
647 } NET_DISPLAY_MACHINE
;
649 [public] typedef struct {
651 string grpi3_comment
;
652 uint32 grpi3_group_id
;
653 uint32 grpi3_attributes
;
654 uint32 grpi3_next_index
;
657 [nopush
,nopull
] NET_API_STATUS NetQueryDisplayInformation
(
658 [in,unique] string *server_name
,
661 [in] uint32 entries_requested
,
662 [in] uint32 prefmaxlen
,
663 [out,ref] uint32
*entries_read
,
664 [out,ref,noprint
] void **buffer
667 /*******************************************/
669 /*******************************************/
677 string grpi1_comment
;
682 string grpi2_comment
;
683 uint32 grpi2_group_id
;
684 uint32 grpi2_attributes
;
689 string grpi3_comment
;
690 domsid
*grpi3_group_sid
;
691 uint32 grpi3_attributes
;
695 string grpi1002_comment
;
699 uint32 grpi1005_attributes
;
702 [nopush
,nopull
] NET_API_STATUS NetGroupAdd
(
703 [in] string server_name
,
706 [out] uint32
*parm_err
709 /*******************************************/
711 /*******************************************/
713 [nopush
,nopull
] NET_API_STATUS NetGroupDel
(
714 [in] string server_name
,
715 [in] string group_name
718 /*******************************************/
720 /*******************************************/
722 [nopush
,nopull
] NET_API_STATUS NetGroupEnum
(
723 [in] string server_name
,
725 [out,ref] uint8
**buffer
,
726 [in] uint32 prefmaxlen
,
727 [out,ref] uint32
*entries_read
,
728 [out,ref] uint32
*total_entries
,
729 [in,out,ref] uint32
*resume_handle
732 /*******************************************/
733 /* NetGroupSetInfo */
734 /*******************************************/
736 [nopush
,nopull
] NET_API_STATUS NetGroupSetInfo
(
737 [in] string server_name
,
738 [in] string group_name
,
741 [out] uint32
*parm_err
744 /*******************************************/
745 /* NetGroupGetInfo */
746 /*******************************************/
748 [nopush
,nopull
] NET_API_STATUS NetGroupGetInfo
(
749 [in] string server_name
,
750 [in] string group_name
,
755 /*******************************************/
756 /* NetGroupAddUser */
757 /*******************************************/
759 [nopush
,nopull
] NET_API_STATUS NetGroupAddUser
(
760 [in] string server_name
,
761 [in] string group_name
,
762 [in] string user_name
765 /*******************************************/
766 /* NetGroupDelUser */
767 /*******************************************/
769 [nopush
,nopull
] NET_API_STATUS NetGroupDelUser
(
770 [in] string server_name
,
771 [in] string group_name
,
772 [in] string user_name
775 /*******************************************/
776 /* NetGroupGetUsers */
777 /*******************************************/
779 [nopush
,nopull
] NET_API_STATUS NetGroupGetUsers
(
780 [in] string server_name
,
781 [in] string group_name
,
783 [out] uint8
**buffer
,
784 [in] uint32 prefmaxlen
,
785 [out,ref] uint32
*entries_read
,
786 [out,ref] uint32
*total_entries
,
787 [in,out,ref] uint32
*resume_handle
790 /*******************************************/
791 /* NetLocalGroupAdd */
792 /*******************************************/
800 string lgrpi1_comment
;
804 string lgrpi1002_comment
;
805 } LOCALGROUP_INFO_1002
;
807 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAdd
(
808 [in] string server_name
,
811 [out,ref] uint32
*parm_err
814 /*******************************************/
815 /* NetLocalGroupDel */
816 /*******************************************/
818 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDel
(
819 [in] string server_name
,
820 [in] string group_name
823 /*******************************************/
824 /* NetLocalGroupGetInfo */
825 /*******************************************/
827 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetInfo
(
828 [in] string server_name
,
829 [in] string group_name
,
831 [out,ref] uint8
**buffer
834 /*******************************************/
835 /* NetLocalGroupSetInfo */
836 /*******************************************/
838 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetInfo
(
839 [in] string server_name
,
840 [in] string group_name
,
842 [in,ref] uint8
*buffer
,
843 [out,ref] uint32
*parm_err
846 /*******************************************/
847 /* NetLocalGroupEnum */
848 /*******************************************/
850 [nopush
,nopull
] NET_API_STATUS NetLocalGroupEnum
(
851 [in] string server_name
,
853 [out,ref] uint8
**buffer
,
854 [in] uint32 prefmaxlen
,
855 [out,ref] uint32
*entries_read
,
856 [out,ref] uint32
*total_entries
,
857 [in,out,ref] uint32
*resume_handle
860 /*******************************************/
861 /* NetLocalGroupAddMembers */
862 /*******************************************/
869 SidTypeWellKnownGroup
= 5,
870 SidTypeDeletedAccount
= 6,
879 } LOCALGROUP_MEMBERS_INFO_0
;
883 SID_NAME_USE lgrmi1_sidusage
;
885 } LOCALGROUP_MEMBERS_INFO_1
;
889 SID_NAME_USE lgrmi2_sidusage
;
890 string lgrmi2_domainandname
;
891 } LOCALGROUP_MEMBERS_INFO_2
;
894 string lgrmi3_domainandname
;
895 } LOCALGROUP_MEMBERS_INFO_3
;
897 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAddMembers
(
898 [in] string server_name
,
899 [in] string group_name
,
902 [in] uint32 total_entries
905 /*******************************************/
906 /* NetLocalGroupDelMembers */
907 /*******************************************/
909 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDelMembers
(
910 [in] string server_name
,
911 [in] string group_name
,
914 [in] uint32 total_entries
917 /*******************************************/
918 /* NetLocalGroupGetMembers */
919 /*******************************************/
921 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetMembers
(
922 [in] string server_name
,
923 [in] string local_group_name
,
925 [out] uint8
**buffer
,
926 [in] uint32 prefmaxlen
,
927 [out] uint32
*entries_read
,
928 [out] uint32
*total_entries
,
929 [in,out] uint32
*resume_handle
932 /*******************************************/
933 /* NetLocalGroupSetMembers */
934 /*******************************************/
936 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetMembers
(
937 [in] string server_name
,
938 [in] string group_name
,
941 [in] uint32 total_entries
944 /*******************************************/
946 /*******************************************/
956 uint32 tod_tinterval
;
963 [nopush
,nopull
] NET_API_STATUS NetRemoteTOD
(
964 [in] string server_name
,
965 [out,ref] uint8
**buffer
968 /*******************************************/
970 /*******************************************/
976 uint32 shi2_permissions
;
977 uint32 shi2_max_uses
;
978 uint32 shi2_current_uses
;
983 [nopush
,nopull
] NET_API_STATUS NetShareAdd
(
984 [in] string server_name
,
987 [out] uint32
*parm_err