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 {
153 [public] typedef struct {
155 string usri1_password
;
156 uint32 usri1_password_age
;
158 string usri1_home_dir
;
159 string usri1_comment
;
161 string usri1_script_path
;
164 [public] typedef struct {
166 string usri2_password
;
167 uint32 usri2_password_age
;
169 string usri2_home_dir
;
170 string usri2_comment
;
172 string usri2_script_path
;
173 uint32 usri2_auth_flags
;
174 string usri2_full_name
;
175 string usri2_usr_comment
;
177 string usri2_workstations
;
178 uint32 usri2_last_logon
;
179 uint32 usri2_last_logoff
;
180 uint32 usri2_acct_expires
;
181 uint32 usri2_max_storage
;
182 uint32 usri2_units_per_week
;
183 uint8
*usri2_logon_hours
;
184 uint32 usri2_bad_pw_count
;
185 uint32 usri2_num_logons
;
186 string usri2_logon_server
;
187 uint32 usri2_country_code
;
188 uint32 usri2_code_page
;
191 [public] typedef struct {
193 uint32 usri3_password_age
;
195 string usri3_home_dir
;
196 string usri3_comment
;
198 string usri3_script_path
;
199 uint32 usri3_auth_flags
;
200 string usri3_full_name
;
201 string usri3_usr_comment
;
203 string usri3_workstations
;
204 uint32 usri3_last_logon
;
205 uint32 usri3_last_logoff
;
206 uint32 usri3_acct_expires
;
207 uint32 usri3_max_storage
;
208 uint32 usri3_units_per_week
;
209 uint8
*usri3_logon_hours
;
210 uint32 usri3_bad_pw_count
;
211 uint32 usri3_num_logons
;
212 string usri3_logon_server
;
213 uint32 usri3_country_code
;
214 uint32 usri3_code_page
;
215 uint32 usri3_user_id
;
216 uint32 usri3_primary_group_id
;
217 string usri3_profile
;
218 string usri3_home_dir_drive
;
219 uint32 usri3_password_expired
;
222 [public] typedef struct {
224 string usri4_password
;
225 uint32 usri4_password_age
;
227 string usri4_home_dir
;
228 string usri4_comment
;
230 string usri4_script_path
;
231 uint32 usri4_auth_flags
;
232 string usri4_full_name
;
233 string usri4_usr_comment
;
235 string usri4_workstations
;
236 uint32 usri4_last_logon
;
237 uint32 usri4_last_logoff
;
238 uint32 usri4_acct_expires
;
239 uint32 usri4_max_storage
;
240 uint32 usri4_units_per_week
;
241 uint8
*usri4_logon_hours
;
242 uint32 usri4_bad_pw_count
;
243 uint32 usri4_num_logons
;
244 string usri4_logon_server
;
245 uint32 usri4_country_code
;
246 uint32 usri4_code_page
;
247 dom_sid
*usri4_user_sid
;
248 uint32 usri4_primary_group_id
;
249 string usri4_profile
;
250 string usri4_home_dir_drive
;
251 uint32 usri4_password_expired
;
254 [public] typedef struct {
256 string usri10_comment
;
257 string usri10_usr_comment
;
258 string usri10_full_name
;
261 [public] typedef struct {
263 string usri11_comment
;
264 string usri11_usr_comment
;
265 string usri11_full_name
;
267 uint32 usri11_auth_flags
;
268 uint32 usri11_password_age
;
269 string usri11_home_dir
;
271 uint32 usri11_last_logon
;
272 uint32 usri11_last_logoff
;
273 uint32 usri11_bad_pw_count
;
274 uint32 usri11_num_logons
;
275 string usri11_logon_server
;
276 uint32 usri11_country_code
;
277 string usri11_workstations
;
278 uint32 usri11_max_storage
;
279 uint32 usri11_units_per_week
;
280 uint8
*usri11_logon_hours
;
281 uint32 usri11_code_page
;
284 [public] typedef struct {
286 string usri20_full_name
;
287 string usri20_comment
;
289 uint32 usri20_user_id
;
292 const int ENCRYPTED_PWLEN
= 256;
294 [public] typedef struct {
295 uint8 usri21_password
[ENCRYPTED_PWLEN
];
298 [public] typedef struct {
300 uint8 usri22_password
[ENCRYPTED_PWLEN
];
301 uint32 usri22_password_age
;
303 string usri22_home_dir
;
304 string usri22_comment
;
306 uint32 usri22_script_path
;
307 uint32 usri22_auth_flags
;
308 string usri22_full_name
;
309 string usri22_usr_comment
;
311 string usri22_workstations
;
312 uint32 usri22_last_logon
;
313 uint32 usri22_last_logoff
;
314 uint32 usri22_acct_expires
;
315 uint32 usri22_max_storage
;
316 uint32 usri22_units_per_week
;
317 uint8
*usri22_logon_hours
;
318 uint32 usri22_bad_pw_count
;
319 uint32 usri22_num_logons
;
320 string usri22_logon_server
;
321 uint32 usri22_country_code
;
322 uint32 usri22_code_page
;
325 [public] typedef struct {
327 string usri23_full_name
;
328 string usri23_comment
;
330 domsid
*usri23_user_sid
;
333 [public] typedef struct {
334 string usri1003_password
;
337 [public] typedef struct {
338 uint32 usri1005_priv
;
341 [public] typedef struct {
342 string usri1006_home_dir
;
345 [public] typedef struct {
346 string usri1007_comment
;
349 [public] typedef struct {
350 uint32 usri1008_flags
;
353 [public] typedef struct {
354 string usri1009_script_path
;
357 [public] typedef struct {
358 uint32 usri1010_auth_flags
;
361 [public] typedef struct {
362 string usri1011_full_name
;
365 [public] typedef struct {
366 string usri1012_usr_comment
;
369 [public] typedef struct {
370 string usri1013_parms
;
373 [public] typedef struct {
374 string usri1014_workstations
;
377 [public] typedef struct {
378 uint32 usri1017_acct_expires
;
381 [public] typedef struct {
382 uint32 usri1018_max_storage
;
385 [public] typedef struct {
386 uint32 usri1020_units_per_week
;
387 uint8
*usri1020_logon_hours
;
390 [public] typedef struct {
391 string usri1023_logon_server
;
394 [public] typedef struct {
395 uint32 usri1024_country_code
;
398 [public] typedef struct {
399 uint32 usri1025_code_page
;
402 [public] typedef struct {
403 uint32 usri1051_primary_group_id
;
406 [public] typedef struct {
407 string usri1052_profile
;
410 [public] typedef struct {
411 string usri1053_home_dir_drive
;
414 [public] typedef struct {
416 string usriX_password
;
417 uint32 usriX_password_age
;
419 string usriX_home_dir
;
420 string usriX_comment
;
422 string usriX_script_path
;
423 uint32 usriX_auth_flags
;
424 string usriX_full_name
;
425 string usriX_usr_comment
;
427 string usriX_workstations
;
428 uint32 usriX_last_logon
;
429 uint32 usriX_last_logoff
;
430 uint32 usriX_acct_expires
;
431 uint32 usriX_max_storage
;
432 uint32 usriX_units_per_week
;
433 uint8
*usriX_logon_hours
;
434 uint32 usriX_bad_pw_count
;
435 uint32 usriX_num_logons
;
436 string usriX_logon_server
;
437 uint32 usriX_country_code
;
438 uint32 usriX_code_page
;
441 [nopush
,nopull
] NET_API_STATUS NetUserAdd
(
442 [in,unique] string *server_name
,
444 [in,ref] uint8
*buffer
,
445 [out,ref] uint32
*parm_error
448 /*******************************************/
450 /*******************************************/
452 [nopush
,nopull
] NET_API_STATUS NetUserDel
(
453 [in,unique] string *server_name
,
454 [in,ref] string *user_name
457 /*******************************************/
459 /*******************************************/
461 const int FILTER_TEMP_DUPLICATE_ACCOUNT
= 0x0001;
462 const int FILTER_NORMAL_ACCOUNT
= 0x0002;
463 const int FILTER_INTERDOMAIN_TRUST_ACCOUNT
= 0x0008;
464 const int FILTER_WORKSTATION_TRUST_ACCOUNT
= 0x0010;
465 const int FILTER_SERVER_TRUST_ACCOUNT
= 0x0020;
467 [nopush
,nopull
] NET_API_STATUS NetUserEnum
(
468 [in,unique] string *server_name
,
471 [out,ref] uint8
**buffer
,
472 [in] uint32 prefmaxlen
,
473 [out,ref] uint32
*entries_read
,
474 [out,ref] uint32
*total_entries
,
475 [in,out,ref] uint32
*resume_handle
478 /*******************************************/
479 /* NetUserChangePassword */
480 /*******************************************/
482 [nopush
,nopull
] NET_API_STATUS NetUserChangePassword
(
483 [in] string domain_name
,
484 [in] string user_name
,
485 [in] string old_password
,
486 [in] string new_password
489 /*******************************************/
491 /*******************************************/
493 [nopush
,nopull
] NET_API_STATUS NetUserGetInfo
(
494 [in] string server_name
,
495 [in] string user_name
,
500 /*******************************************/
502 /*******************************************/
504 [nopush
,nopull
] NET_API_STATUS NetUserSetInfo
(
505 [in] string server_name
,
506 [in] string user_name
,
509 [out] uint32
*parm_err
512 /*******************************************/
513 /* NetUserModalsGet */
514 /*******************************************/
516 const int TIMEQ_FOREVER
= (uint32_t
)-1L;
519 uint32 usrmod0_min_passwd_len
;
520 uint32 usrmod0_max_passwd_age
;
521 uint32 usrmod0_min_passwd_age
;
522 uint32 usrmod0_force_logoff
;
523 uint32 usrmod0_password_hist_len
;
524 } USER_MODALS_INFO_0
;
528 string usrmod1_primary
;
529 } USER_MODALS_INFO_1
;
532 string usrmod2_domain_name
;
533 domsid
*usrmod2_domain_id
;
534 } USER_MODALS_INFO_2
;
537 uint32 usrmod3_lockout_duration
;
538 uint32 usrmod3_lockout_observation_window
;
539 uint32 usrmod3_lockout_threshold
;
540 } USER_MODALS_INFO_3
;
543 uint32 usrmod1001_min_passwd_len
;
544 } USER_MODALS_INFO_1001
;
547 uint32 usrmod1002_max_passwd_age
;
548 } USER_MODALS_INFO_1002
;
551 uint32 usrmod1003_min_passwd_age
;
552 } USER_MODALS_INFO_1003
;
555 uint32 usrmod1004_force_logoff
;
556 } USER_MODALS_INFO_1004
;
559 uint32 usrmod1005_password_hist_len
;
560 } USER_MODALS_INFO_1005
;
563 uint32 usrmod1006_role
;
564 } USER_MODALS_INFO_1006
;
567 string usrmod1007_primary
;
568 } USER_MODALS_INFO_1007
;
570 [nopush
,nopull
] NET_API_STATUS NetUserModalsGet
(
571 [in] string server_name
,
573 [out,ref] uint8
**buffer
576 /*******************************************/
577 /* NetUserModalsSet */
578 /*******************************************/
580 [nopush
,nopull
] NET_API_STATUS NetUserModalsSet
(
581 [in] string server_name
,
584 [out,ref] uint32
*parm_err
587 /*******************************************/
588 /* NetQueryDisplayInformation */
589 /*******************************************/
591 [public] typedef struct {
593 string usri1_comment
;
595 string usri1_full_name
;
596 uint32 usri1_user_id
;
597 uint32 usri1_next_index
;
600 [public] typedef struct {
602 string usri2_comment
;
604 uint32 usri2_user_id
;
605 uint32 usri2_next_index
;
606 } NET_DISPLAY_MACHINE
;
608 [public] typedef struct {
610 string grpi3_comment
;
611 uint32 grpi3_group_id
;
612 uint32 grpi3_attributes
;
613 uint32 grpi3_next_index
;
616 [nopush
,nopull
] NET_API_STATUS NetQueryDisplayInformation
(
617 [in,unique] string *server_name
,
620 [in] uint32 entries_requested
,
621 [in] uint32 prefmaxlen
,
622 [out,ref] uint32
*entries_read
,
623 [out,ref,noprint
] void **buffer
626 /*******************************************/
628 /*******************************************/
636 string grpi1_comment
;
641 string grpi2_comment
;
642 uint32 grpi2_group_id
;
643 uint32 grpi2_attributes
;
648 string grpi3_comment
;
649 domsid
*grpi3_group_sid
;
650 uint32 grpi3_attributes
;
654 string grpi1002_comment
;
658 uint32 grpi1005_attributes
;
661 [nopush
,nopull
] NET_API_STATUS NetGroupAdd
(
662 [in] string server_name
,
665 [out] uint32
*parm_err
668 /*******************************************/
670 /*******************************************/
672 [nopush
,nopull
] NET_API_STATUS NetGroupDel
(
673 [in] string server_name
,
674 [in] string group_name
677 /*******************************************/
679 /*******************************************/
681 [nopush
,nopull
] NET_API_STATUS NetGroupEnum
(
682 [in] string server_name
,
684 [out,ref] uint8
**buffer
,
685 [in] uint32 prefmaxlen
,
686 [out,ref] uint32
*entries_read
,
687 [out,ref] uint32
*total_entries
,
688 [in,out,ref] uint32
*resume_handle
691 /*******************************************/
692 /* NetGroupSetInfo */
693 /*******************************************/
695 [nopush
,nopull
] NET_API_STATUS NetGroupSetInfo
(
696 [in] string server_name
,
697 [in] string group_name
,
700 [out] uint32
*parm_err
703 /*******************************************/
704 /* NetGroupGetInfo */
705 /*******************************************/
707 [nopush
,nopull
] NET_API_STATUS NetGroupGetInfo
(
708 [in] string server_name
,
709 [in] string group_name
,
714 /*******************************************/
715 /* NetGroupAddUser */
716 /*******************************************/
718 [nopush
,nopull
] NET_API_STATUS NetGroupAddUser
(
719 [in] string server_name
,
720 [in] string group_name
,
721 [in] string user_name
724 /*******************************************/
725 /* NetGroupDelUser */
726 /*******************************************/
728 [nopush
,nopull
] NET_API_STATUS NetGroupDelUser
(
729 [in] string server_name
,
730 [in] string group_name
,
731 [in] string user_name
734 /*******************************************/
735 /* NetGroupGetUsers */
736 /*******************************************/
738 [public] typedef struct {
740 } GROUP_USERS_INFO_0
;
742 [public] typedef struct {
744 uint32 grui1_attributes
;
745 } GROUP_USERS_INFO_1
;
747 [nopush
,nopull
] NET_API_STATUS NetGroupGetUsers
(
748 [in] string server_name
,
749 [in] string group_name
,
751 [out] uint8
**buffer
,
752 [in] uint32 prefmaxlen
,
753 [out,ref] uint32
*entries_read
,
754 [out,ref] uint32
*total_entries
,
755 [in,out,ref] uint32
*resume_handle
758 /*******************************************/
759 /* NetLocalGroupAdd */
760 /*******************************************/
768 string lgrpi1_comment
;
772 string lgrpi1002_comment
;
773 } LOCALGROUP_INFO_1002
;
775 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAdd
(
776 [in] string server_name
,
779 [out,ref] uint32
*parm_err
782 /*******************************************/
783 /* NetLocalGroupDel */
784 /*******************************************/
786 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDel
(
787 [in] string server_name
,
788 [in] string group_name
791 /*******************************************/
792 /* NetLocalGroupGetInfo */
793 /*******************************************/
795 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetInfo
(
796 [in] string server_name
,
797 [in] string group_name
,
799 [out,ref] uint8
**buffer
802 /*******************************************/
803 /* NetLocalGroupSetInfo */
804 /*******************************************/
806 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetInfo
(
807 [in] string server_name
,
808 [in] string group_name
,
810 [in,ref] uint8
*buffer
,
811 [out,ref] uint32
*parm_err
814 /*******************************************/
815 /* NetLocalGroupEnum */
816 /*******************************************/
818 [nopush
,nopull
] NET_API_STATUS NetLocalGroupEnum
(
819 [in] string server_name
,
821 [out,ref] uint8
**buffer
,
822 [in] uint32 prefmaxlen
,
823 [out,ref] uint32
*entries_read
,
824 [out,ref] uint32
*total_entries
,
825 [in,out,ref] uint32
*resume_handle
828 /*******************************************/
829 /* NetLocalGroupAddMembers */
830 /*******************************************/
837 SidTypeWellKnownGroup
= 5,
838 SidTypeDeletedAccount
= 6,
847 } LOCALGROUP_MEMBERS_INFO_0
;
851 SID_NAME_USE lgrmi1_sidusage
;
853 } LOCALGROUP_MEMBERS_INFO_1
;
857 SID_NAME_USE lgrmi2_sidusage
;
858 string lgrmi2_domainandname
;
859 } LOCALGROUP_MEMBERS_INFO_2
;
862 string lgrmi3_domainandname
;
863 } LOCALGROUP_MEMBERS_INFO_3
;
865 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAddMembers
(
866 [in] string server_name
,
867 [in] string group_name
,
870 [in] uint32 total_entries
873 /*******************************************/
874 /* NetLocalGroupDelMembers */
875 /*******************************************/
877 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDelMembers
(
878 [in] string server_name
,
879 [in] string group_name
,
882 [in] uint32 total_entries
885 /*******************************************/
886 /* NetLocalGroupGetMembers */
887 /*******************************************/
889 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetMembers
(
890 [in] string server_name
,
891 [in] string local_group_name
,
893 [out] uint8
**buffer
,
894 [in] uint32 prefmaxlen
,
895 [out] uint32
*entries_read
,
896 [out] uint32
*total_entries
,
897 [in,out] uint32
*resume_handle
900 /*******************************************/
901 /* NetLocalGroupSetMembers */
902 /*******************************************/
904 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetMembers
(
905 [in] string server_name
,
906 [in] string group_name
,
909 [in] uint32 total_entries
912 /*******************************************/
914 /*******************************************/
924 uint32 tod_tinterval
;
931 [nopush
,nopull
] NET_API_STATUS NetRemoteTOD
(
932 [in] string server_name
,
933 [out,ref] uint8
**buffer