netapi: add NetUserGetInfo to IDL.
[ira/wip.git] / source3 / librpc / idl / libnetapi.idl
1 /*
2   libnetapi interface definition
3 */
4
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 */")
8 cpp_quote("#endif")
9
10 [
11         pointer_default(unique)
12 ]
13 interface libnetapi
14 {
15         const int ERROR_MORE_DATA = 234L;
16
17         [public] typedef [v1_enum] enum {
18                 NERR_Success=0
19         } NET_API_STATUS;
20
21         [public] typedef struct {
22                 uint8 sid_rev_num;
23                 uint8 num_auths;
24                 uint8 id_auth[6];
25                 uint32 sub_auths[MAXSUBAUTHS];
26         } domsid;
27
28         /*******************************************/
29         /* NetJoinDomain                           */
30         /*******************************************/
31
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
39                 );
40
41         /*******************************************/
42         /* NetUnjoinDomain                         */
43         /*******************************************/
44
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
50                 );
51
52         /*******************************************/
53         /* NetGetJoinInformation                   */
54         /*******************************************/
55
56         [nopush,nopull] NET_API_STATUS NetGetJoinInformation(
57                 [in,unique] string *server_name,
58                 [out] string **name_buffer,
59                 [out] uint16 *name_type
60                 );
61
62         /*******************************************/
63         /* NetGetJoinableOUs                       */
64         /*******************************************/
65
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,
72                 [out] string ***ous
73                 );
74
75         /*******************************************/
76         /* NetServerGetInfo                        */
77         /*******************************************/
78
79         [public] typedef struct {
80                 string sv1005_comment;
81         } SERVER_INFO_1005;
82
83         [nopush,nopull] NET_API_STATUS NetServerGetInfo(
84                 [in,unique] string *server_name,
85                 [in] uint32 level,
86                 [out] uint8 **buffer
87                 );
88
89         /*******************************************/
90         /* NetServerSetInfo                        */
91         /*******************************************/
92
93         [nopush,nopull] NET_API_STATUS NetServerSetInfo(
94                 [in,unique] string *server_name,
95                 [in] uint32 level,
96                 [in] uint8 *buffer,
97                 [out] uint32 *parm_error
98                 );
99
100         /*******************************************/
101         /* NetGetDCName                            */
102         /*******************************************/
103
104         [nopush,nopull] NET_API_STATUS NetGetDCName(
105                 [in,unique] string *server_name,
106                 [in,unique] string *domain_name,
107                 [out] uint8 **buffer
108                 );
109
110         /*******************************************/
111         /* NetGetAnyDCName                         */
112         /*******************************************/
113
114         [nopush,nopull] NET_API_STATUS NetGetAnyDCName(
115                 [in,unique] string *server_name,
116                 [in,unique] string *domain_name,
117                 [out] uint8 **buffer
118                 );
119
120         /*******************************************/
121         /* DsGetDcName                             */
122         /*******************************************/
123
124         [public] typedef struct {
125                 string domain_controller_name;
126                 string domain_controller_address;
127                 uint32 domain_controller_address_type;
128                 GUID domain_guid;
129                 string domain_name;
130                 string dns_forest_name;
131                 uint32 flags;
132                 string dc_site_name;
133                 string client_site_name;
134         } DOMAIN_CONTROLLER_INFO;
135
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,
141                 [in] uint32 flags,
142                 [out,ref] DOMAIN_CONTROLLER_INFO **dc_info
143                 );
144
145         /*******************************************/
146         /* NetUserAdd                              */
147         /*******************************************/
148
149         [public] typedef struct {
150                 string usri0_name;
151         } USER_INFO_0;
152
153         [public] typedef struct {
154                 string usri1_name;
155                 string usri1_password;
156                 uint32 usri1_password_age;
157                 uint32 usri1_priv;
158                 string usri1_home_dir;
159                 string usri1_comment;
160                 uint32 usri1_flags;
161                 string usri1_script_path;
162         } USER_INFO_1;
163
164         [public] typedef struct {
165                 string usri2_name;
166                 string usri2_password;
167                 uint32 usri2_password_age;
168                 uint32 usri2_priv;
169                 string usri2_home_dir;
170                 string usri2_comment;
171                 uint32 usri2_flags;
172                 string usri2_script_path;
173                 uint32 usri2_auth_flags;
174                 string usri2_full_name;
175                 string usri2_usr_comment;
176                 string usri2_parms;
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;
189         } USER_INFO_2;
190
191         [public] typedef struct {
192                 string usri3_name;
193                 uint32 usri3_password_age;
194                 uint32 usri3_priv;
195                 string usri3_home_dir;
196                 string usri3_comment;
197                 uint32 usri3_flags;
198                 string usri3_script_path;
199                 uint32 usri3_auth_flags;
200                 string usri3_full_name;
201                 string usri3_usr_comment;
202                 string usri3_parms;
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;
220         } USER_INFO_3;
221
222         [public] typedef struct {
223                 string usri4_name;
224                 string usri4_password;
225                 uint32 usri4_password_age;
226                 uint32 usri4_priv;
227                 string usri4_home_dir;
228                 string usri4_comment;
229                 uint32 usri4_flags;
230                 string usri4_script_path;
231                 uint32 usri4_auth_flags;
232                 string usri4_full_name;
233                 string usri4_usr_comment;
234                 string usri4_parms;
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;
252         } USER_INFO_4;
253
254         [public] typedef struct {
255                 string usri10_name;
256                 string usri10_comment;
257                 string usri10_usr_comment;
258                 string usri10_full_name;
259         } USER_INFO_10;
260
261         [public] typedef struct {
262                 string usri11_name;
263                 string usri11_comment;
264                 string usri11_usr_comment;
265                 string usri11_full_name;
266                 uint32 usri11_priv;
267                 uint32 usri11_auth_flags;
268                 uint32 usri11_password_age;
269                 string usri11_home_dir;
270                 string usri11_parms;
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;
282         } USER_INFO_11;
283
284         [public] typedef struct {
285                 string usri20_name;
286                 string usri20_full_name;
287                 string usri20_comment;
288                 uint32 usri20_flags;
289                 uint32 usri20_user_id;
290         } USER_INFO_20;
291
292         [public] typedef struct {
293                 string usri23_name;
294                 string usri23_full_name;
295                 string usri23_comment;
296                 uint32 usri23_flags;
297                 domsid *usri23_user_sid;
298         } USER_INFO_23;
299
300         [public] typedef struct {
301                 string usri1007_comment;
302         } USER_INFO_1007;
303
304         [nopush,nopull] NET_API_STATUS NetUserAdd(
305                 [in,unique] string *server_name,
306                 [in] uint32 level,
307                 [in,ref] uint8 *buffer,
308                 [out,ref] uint32 *parm_error
309                 );
310
311         /*******************************************/
312         /* NetUserDel                              */
313         /*******************************************/
314
315         [nopush,nopull] NET_API_STATUS NetUserDel(
316                 [in,unique] string *server_name,
317                 [in,ref] string *user_name
318                 );
319
320         /*******************************************/
321         /* NetUserEnum                             */
322         /*******************************************/
323
324         const int FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001;
325         const int FILTER_NORMAL_ACCOUNT = 0x0002;
326         const int FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008;
327         const int FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010;
328         const int FILTER_SERVER_TRUST_ACCOUNT = 0x0020;
329
330         [nopush,nopull] NET_API_STATUS NetUserEnum(
331                 [in,unique] string *server_name,
332                 [in] uint32 level,
333                 [in] uint32 filter,
334                 [out,ref] uint8 **buffer,
335                 [in] uint32 prefmaxlen,
336                 [out,ref] uint32 *entries_read,
337                 [out,ref] uint32 *total_entries,
338                 [in,out,ref] uint32 *resume_handle
339                 );
340
341         /*******************************************/
342         /* NetUserChangePassword                   */
343         /*******************************************/
344
345         [nopush,nopull] NET_API_STATUS NetUserChangePassword(
346                 [in] string domain_name,
347                 [in] string user_name,
348                 [in] string old_password,
349                 [in] string new_password
350                 );
351
352         /*******************************************/
353         /* NetUserGetInfo                          */
354         /*******************************************/
355
356         [nopush,nopull] NET_API_STATUS NetUserGetInfo(
357                 [in] string server_name,
358                 [in] string user_name,
359                 [in] uint32 level,
360                 [out] uint8 **buffer
361                 );
362
363         /*******************************************/
364         /* NetQueryDisplayInformation              */
365         /*******************************************/
366
367         [public] typedef struct {
368                 string usri1_name;
369                 string usri1_comment;
370                 uint32 usri1_flags;
371                 string usri1_full_name;
372                 uint32 usri1_user_id;
373                 uint32 usri1_next_index;
374         } NET_DISPLAY_USER;
375
376         [public] typedef struct {
377                 string usri2_name;
378                 string usri2_comment;
379                 uint32 usri2_flags;
380                 uint32 usri2_user_id;
381                 uint32 usri2_next_index;
382         } NET_DISPLAY_MACHINE;
383
384         [public] typedef struct {
385                 string grpi3_name;
386                 string grpi3_comment;
387                 uint32 grpi3_group_id;
388                 uint32 grpi3_attributes;
389                 uint32 grpi3_next_index;
390         } NET_DISPLAY_GROUP;
391
392         [nopush,nopull] NET_API_STATUS NetQueryDisplayInformation(
393                 [in,unique] string *server_name,
394                 [in] uint32 level,
395                 [in] uint32 idx,
396                 [in] uint32 entries_requested,
397                 [in] uint32 prefmaxlen,
398                 [out,ref] uint32 *entries_read,
399                 [out,ref,noprint] void **buffer
400                 );
401
402         /*******************************************/
403         /* NetGroupAdd                             */
404         /*******************************************/
405
406         typedef struct {
407                 string grpi0_name;
408         } GROUP_INFO_0;
409
410         typedef struct {
411                 string grpi1_name;
412                 string grpi1_comment;
413         } GROUP_INFO_1;
414
415         typedef struct {
416                 string grpi2_name;
417                 string grpi2_comment;
418                 uint32 grpi2_group_id;
419                 uint32 grpi2_attributes;
420         } GROUP_INFO_2;
421
422         typedef struct {
423                 string grpi3_name;
424                 string grpi3_comment;
425                 domsid *grpi3_group_sid;
426                 uint32 grpi3_attributes;
427         } GROUP_INFO_3;
428
429         typedef struct {
430                 string grpi1002_comment;
431         } GROUP_INFO_1002;
432
433         typedef struct {
434                 uint32 grpi1005_attributes;
435         } GROUP_INFO_1005;
436
437         [nopush,nopull] NET_API_STATUS NetGroupAdd(
438                 [in] string server_name,
439                 [in] uint32 level,
440                 [in] uint8 *buf,
441                 [out] uint32 *parm_err
442                 );
443
444         /*******************************************/
445         /* NetGroupDel                             */
446         /*******************************************/
447
448         [nopush,nopull] NET_API_STATUS NetGroupDel(
449                 [in] string server_name,
450                 [in] string group_name
451                 );
452
453         /*******************************************/
454         /* NetGroupEnum                            */
455         /*******************************************/
456
457         [nopush,nopull] NET_API_STATUS NetGroupEnum(
458                 [in] string server_name,
459                 [in] uint32 level,
460                 [out,ref] uint8 **buffer,
461                 [in] uint32 prefmaxlen,
462                 [out,ref] uint32 *entries_read,
463                 [out,ref] uint32 *total_entries,
464                 [in,out,ref] uint32 *resume_handle
465                 );
466
467         /*******************************************/
468         /* NetGroupSetInfo                         */
469         /*******************************************/
470
471         [nopush,nopull] NET_API_STATUS NetGroupSetInfo(
472                 [in] string server_name,
473                 [in] string group_name,
474                 [in] uint32 level,
475                 [in] uint8 *buf,
476                 [out] uint32 *parm_err
477                 );
478
479         /*******************************************/
480         /* NetGroupGetInfo                         */
481         /*******************************************/
482
483         [nopush,nopull] NET_API_STATUS NetGroupGetInfo(
484                 [in] string server_name,
485                 [in] string group_name,
486                 [in] uint32 level,
487                 [out] uint8 **buf
488                 );
489
490         /*******************************************/
491         /* NetGroupAddUser                         */
492         /*******************************************/
493
494         [nopush,nopull] NET_API_STATUS NetGroupAddUser(
495                 [in] string server_name,
496                 [in] string group_name,
497                 [in] string user_name
498                 );
499
500         /*******************************************/
501         /* NetGroupDelUser                         */
502         /*******************************************/
503
504         [nopush,nopull] NET_API_STATUS NetGroupDelUser(
505                 [in] string server_name,
506                 [in] string group_name,
507                 [in] string user_name
508                 );
509
510         /*******************************************/
511         /* NetLocalGroupAdd                        */
512         /*******************************************/
513
514         typedef struct {
515                 string lgrpi0_name;
516         } LOCALGROUP_INFO_0;
517
518         typedef struct {
519                 string lgrpi1_name;
520                 string lgrpi1_comment;
521         } LOCALGROUP_INFO_1;
522
523         typedef struct {
524                 string lgrpi1002_comment;
525         } LOCALGROUP_INFO_1002;
526
527         [nopush,nopull] NET_API_STATUS NetLocalGroupAdd(
528                 [in] string server_name,
529                 [in] uint32 level,
530                 [in] uint8 *buf,
531                 [out,ref] uint32 *parm_err
532                 );
533
534         /*******************************************/
535         /* NetLocalGroupDel                        */
536         /*******************************************/
537
538         [nopush,nopull] NET_API_STATUS NetLocalGroupDel(
539                 [in] string server_name,
540                 [in] string group_name
541                 );
542
543         /*******************************************/
544         /* NetLocalGroupGetInfo                    */
545         /*******************************************/
546
547         [nopush,nopull] NET_API_STATUS NetLocalGroupGetInfo(
548                 [in] string server_name,
549                 [in] string group_name,
550                 [in] uint32 level,
551                 [out,ref] uint8 **buf
552                 );
553
554         /*******************************************/
555         /* NetLocalGroupSetInfo                    */
556         /*******************************************/
557
558         [nopush,nopull] NET_API_STATUS NetLocalGroupSetInfo(
559                 [in] string server_name,
560                 [in] string group_name,
561                 [in] uint32 level,
562                 [in,ref] uint8 *buf,
563                 [out,ref] uint32 *parm_err
564                 );
565
566         /*******************************************/
567         /* NetRemoteTOD                            */
568         /*******************************************/
569
570         typedef struct {
571                 uint32 tod_elapsedt;
572                 uint32 tod_msecs;
573                 uint32 tod_hours;
574                 uint32 tod_mins;
575                 uint32 tod_secs;
576                 uint32 tod_hunds;
577                 int32 tod_timezone;
578                 uint32 tod_tinterval;
579                 uint32 tod_day;
580                 uint32 tod_month;
581                 uint32 tod_year;
582                 uint32 tod_weekday;
583         } TIME_OF_DAY_INFO;
584
585         [nopush,nopull] NET_API_STATUS NetRemoteTOD(
586                 [in] string server_name,
587                 [out,ref] uint8 **buf
588                 );
589 }