2 Unix SMB/CIFS implementation.
5 Copyright (C) Tim Potter 2000
6 Copyright (C) Guenther Deschner 2008
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "rpcclient.h"
24 #include "../libcli/auth/libcli_auth.h"
25 #include "../librpc/gen_ndr/ndr_netlogon.h"
26 #include "../librpc/gen_ndr/ndr_netlogon_c.h"
27 #include "rpc_client/cli_netlogon.h"
29 #include "../libcli/auth/netlogon_creds_cli.h"
30 #include "rpc_client/util_netlogon.h"
32 static WERROR
cmd_netlogon_logon_ctrl2(struct rpc_pipe_client
*cli
,
33 TALLOC_CTX
*mem_ctx
, int argc
,
36 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
38 const char *logon_server
= cli
->desthost
;
39 enum netr_LogonControlCode function_code
= NETLOGON_CONTROL_REDISCOVER
;
41 union netr_CONTROL_DATA_INFORMATION data
;
42 union netr_CONTROL_QUERY_INFORMATION query
;
43 const char *domain
= lp_workgroup();
44 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
46 #define fn_code_level(x, item) { x, #x, #item }
48 enum netr_LogonControlCode code
;
51 } supported_levels
[] = {
52 fn_code_level(NETLOGON_CONTROL_REDISCOVER
, domain
),
53 fn_code_level(NETLOGON_CONTROL_TC_QUERY
, domain
),
54 fn_code_level(NETLOGON_CONTROL_TRANSPORT_NOTIFY
, domain
),
55 fn_code_level(NETLOGON_CONTROL_FIND_USER
, user
),
56 fn_code_level(NETLOGON_CONTROL_CHANGE_PASSWORD
, domain
),
57 fn_code_level(NETLOGON_CONTROL_TC_VERIFY
, domain
),
58 fn_code_level(NETLOGON_CONTROL_SET_DBFLAG
, debug_level
),
62 if ((argc
> 5) || (argc
< 2)) {
63 fprintf(stderr
, "Usage: %s <logon_server> <function_code> "
64 "<level:1..4> <argument>\n", argv
[0]);
65 fprintf(stderr
, "Supported combinations:\n");
66 fprintf(stderr
, "function_code\targument\n");
67 for(i
=0; supported_levels
[i
].code
; i
++) {
68 fprintf(stderr
, "%7d\t\t%s\t(%s)\n",
69 supported_levels
[i
].code
,
70 supported_levels
[i
].argument
,
71 supported_levels
[i
].name
);
77 logon_server
= argv
[1];
81 function_code
= atoi(argv
[2]);
85 level
= atoi(argv
[3]);
92 switch (function_code
) {
93 case NETLOGON_CONTROL_REDISCOVER
:
94 case NETLOGON_CONTROL_TC_QUERY
:
95 case NETLOGON_CONTROL_CHANGE_PASSWORD
:
96 case NETLOGON_CONTROL_TRANSPORT_NOTIFY
:
97 case NETLOGON_CONTROL_TC_VERIFY
:
100 case NETLOGON_CONTROL_FIND_USER
:
103 case NETLOGON_CONTROL_SET_DBFLAG
:
104 data
.debug_level
= atoi(domain
);
110 status
= dcerpc_netr_LogonControl2(b
, mem_ctx
,
117 if (!NT_STATUS_IS_OK(status
)) {
118 return ntstatus_to_werror(status
);
121 if (!W_ERROR_IS_OK(werr
)) {
125 /* Display results */
130 static WERROR
cmd_netlogon_getanydcname(struct rpc_pipe_client
*cli
,
131 TALLOC_CTX
*mem_ctx
, int argc
,
134 const char *dcname
= NULL
;
138 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
141 fprintf(stderr
, "Usage: %s domainname\n", argv
[0]);
145 /* Make sure to wait for our DC's reply */
146 old_timeout
= rpccli_set_timeout(cli
, 30000); /* 30 seconds. */
147 rpccli_set_timeout(cli
, MAX(old_timeout
, 30000)); /* At least 30 sec */
149 status
= dcerpc_netr_GetAnyDCName(b
, mem_ctx
,
154 rpccli_set_timeout(cli
, old_timeout
);
156 if (!NT_STATUS_IS_OK(status
)) {
157 return ntstatus_to_werror(status
);
160 if (!W_ERROR_IS_OK(werr
)) {
164 /* Display results */
166 printf("%s\n", dcname
);
171 static WERROR
cmd_netlogon_getdcname(struct rpc_pipe_client
*cli
,
172 TALLOC_CTX
*mem_ctx
, int argc
,
175 const char *dcname
= NULL
;
179 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
182 fprintf(stderr
, "Usage: %s domainname\n", argv
[0]);
186 /* Make sure to wait for our DC's reply */
187 old_timeout
= rpccli_set_timeout(cli
, 30000); /* 30 seconds. */
188 rpccli_set_timeout(cli
, MAX(30000, old_timeout
)); /* At least 30 sec */
190 status
= dcerpc_netr_GetDcName(b
, mem_ctx
,
195 rpccli_set_timeout(cli
, old_timeout
);
197 if (!NT_STATUS_IS_OK(status
)) {
198 return ntstatus_to_werror(status
);
201 if (!W_ERROR_IS_OK(werr
)) {
205 /* Display results */
207 printf("%s\n", dcname
);
212 static WERROR
cmd_netlogon_dsr_getdcname(struct rpc_pipe_client
*cli
,
213 TALLOC_CTX
*mem_ctx
, int argc
,
217 WERROR werr
= WERR_OK
;
218 uint32_t flags
= DS_RETURN_DNS_NAME
;
219 const char *server_name
= cli
->desthost
;
220 const char *domain_name
= NULL
;
221 struct GUID domain_guid
= GUID_zero();
222 struct GUID site_guid
= GUID_zero();
223 struct netr_DsRGetDCNameInfo
*info
= NULL
;
224 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
227 fprintf(stderr
, "Usage: %s [domain_name] [domain_guid] "
228 "[site_guid] [flags]\n", argv
[0]);
233 domain_name
= argv
[1];
236 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[2], &domain_guid
))) {
237 return WERR_NOT_ENOUGH_MEMORY
;
242 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[3], &site_guid
))) {
243 return WERR_NOT_ENOUGH_MEMORY
;
248 sscanf(argv
[4], "%x", &flags
);
250 result
= dcerpc_netr_DsRGetDCName(b
, mem_ctx
,
258 if (!NT_STATUS_IS_OK(result
)) {
259 return ntstatus_to_werror(result
);
262 if (W_ERROR_IS_OK(werr
)) {
263 d_printf("DsGetDcName gave: %s\n",
264 NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DsRGetDCNameInfo
, info
));
268 printf("rpccli_netlogon_dsr_getdcname returned %s\n",
274 static WERROR
cmd_netlogon_dsr_getdcnameex(struct rpc_pipe_client
*cli
,
275 TALLOC_CTX
*mem_ctx
, int argc
,
280 uint32_t flags
= DS_RETURN_DNS_NAME
;
281 const char *server_name
= cli
->desthost
;
282 const char *domain_name
;
283 const char *site_name
= NULL
;
284 struct GUID domain_guid
= GUID_zero();
285 struct netr_DsRGetDCNameInfo
*info
= NULL
;
286 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
289 fprintf(stderr
, "Usage: %s [domain_name] [domain_guid] "
290 "[site_name] [flags]\n", argv
[0]);
294 domain_name
= argv
[1];
297 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[2], &domain_guid
))) {
298 return WERR_NOT_ENOUGH_MEMORY
;
307 sscanf(argv
[4], "%x", &flags
);
310 status
= dcerpc_netr_DsRGetDCNameEx(b
, mem_ctx
,
318 if (!NT_STATUS_IS_OK(status
)) {
319 return ntstatus_to_werror(status
);
322 if (!W_ERROR_IS_OK(result
)) {
326 d_printf("DsRGetDCNameEx gave %s\n",
327 NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DsRGetDCNameInfo
, info
));
332 static WERROR
cmd_netlogon_dsr_getdcnameex2(struct rpc_pipe_client
*cli
,
333 TALLOC_CTX
*mem_ctx
, int argc
,
338 uint32_t flags
= DS_RETURN_DNS_NAME
;
339 const char *server_name
= cli
->desthost
;
340 const char *domain_name
= NULL
;
341 const char *client_account
= NULL
;
343 const char *site_name
= NULL
;
344 struct GUID domain_guid
= GUID_zero();
345 struct netr_DsRGetDCNameInfo
*info
= NULL
;
346 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
349 fprintf(stderr
, "Usage: %s [client_account] [acb_mask] "
350 "[domain_name] [domain_guid] [site_name] "
351 "[flags]\n", argv
[0]);
356 client_account
= argv
[1];
360 mask
= atoi(argv
[2]);
364 domain_name
= argv
[3];
368 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[4], &domain_guid
))) {
369 return WERR_NOT_ENOUGH_MEMORY
;
378 sscanf(argv
[6], "%x", &flags
);
381 status
= dcerpc_netr_DsRGetDCNameEx2(b
, mem_ctx
,
391 if (!NT_STATUS_IS_OK(status
)) {
392 return ntstatus_to_werror(status
);
395 if (!W_ERROR_IS_OK(result
)) {
399 d_printf("DsRGetDCNameEx2 gave %s\n",
400 NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DsRGetDCNameInfo
, info
));
406 static WERROR
cmd_netlogon_dsr_getsitename(struct rpc_pipe_client
*cli
,
407 TALLOC_CTX
*mem_ctx
, int argc
,
412 const char *sitename
= NULL
;
413 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
416 fprintf(stderr
, "Usage: %s computername\n", argv
[0]);
420 status
= dcerpc_netr_DsRGetSiteName(b
, mem_ctx
,
424 if (!NT_STATUS_IS_OK(status
)) {
425 return ntstatus_to_werror(status
);
428 if (!W_ERROR_IS_OK(werr
)) {
429 printf("rpccli_netlogon_dsr_gesitename returned %s\n",
430 nt_errstr(werror_to_ntstatus(werr
)));
434 printf("Computer %s is on Site: %s\n", argv
[1], sitename
);
439 static WERROR
cmd_netlogon_logon_ctrl(struct rpc_pipe_client
*cli
,
440 TALLOC_CTX
*mem_ctx
, int argc
,
443 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
445 const char *logon_server
= cli
->desthost
;
446 enum netr_LogonControlCode function_code
= 1;
448 union netr_CONTROL_QUERY_INFORMATION info
;
449 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
452 fprintf(stderr
, "Usage: %s <logon_server> <function_code> "
453 "<level>\n", argv
[0]);
458 logon_server
= argv
[1];
462 function_code
= atoi(argv
[2]);
466 level
= atoi(argv
[3]);
469 status
= dcerpc_netr_LogonControl(b
, mem_ctx
,
475 if (!NT_STATUS_IS_OK(status
)) {
476 return ntstatus_to_werror(status
);
479 if (!W_ERROR_IS_OK(werr
)) {
483 /* Display results */
488 /* Log on a domain user */
490 static NTSTATUS
cmd_netlogon_sam_logon(struct rpc_pipe_client
*cli
,
491 TALLOC_CTX
*mem_ctx
, int argc
,
494 NTSTATUS result
= NT_STATUS_UNSUCCESSFUL
;
495 int logon_type
= NetlogonNetworkInformation
;
496 const char *username
, *password
;
497 uint32_t logon_param
= 0;
498 const char *workstation
= NULL
;
499 struct netr_SamInfo3
*info3
= NULL
;
500 uint8_t authoritative
= 1;
502 uint16_t validation_level
;
503 union netr_Validation
*validation
= NULL
;
504 uint64_t logon_id
= 0;
506 /* Check arguments */
508 if (argc
< 3 || argc
> 6) {
509 fprintf(stderr
, "Usage: samlogon <username> <password> [workstation]"
510 "[logon_type (1 or 2)] [logon_parameter]\n");
518 workstation
= argv
[3];
521 sscanf(argv
[4], "%i", &logon_type
);
524 sscanf(argv
[5], "%x", &logon_param
);
526 if (rpcclient_netlogon_creds
== NULL
) {
527 result
= NT_STATUS_UNSUCCESSFUL
;
530 logon_id
= generate_random_u64();
532 /* Perform the sam logon */
534 result
= rpccli_netlogon_password_logon(rpcclient_netlogon_creds
,
548 if (!NT_STATUS_IS_OK(result
))
551 result
= map_validation_to_info3(mem_ctx
,
555 if (!NT_STATUS_IS_OK(result
)) {
563 /* Change the trust account password */
565 static NTSTATUS
cmd_netlogon_change_trust_pw(struct rpc_pipe_client
*cli
,
566 TALLOC_CTX
*mem_ctx
, int argc
,
569 NTSTATUS result
= NT_STATUS_UNSUCCESSFUL
;
570 const char *dcname
= cli
->desthost
;
572 /* Check arguments */
575 fprintf(stderr
, "Usage: change_trust_pw");
579 result
= trust_pw_change(rpcclient_netlogon_creds
,
585 if (!NT_STATUS_IS_OK(result
))
592 static WERROR
cmd_netlogon_gettrustrid(struct rpc_pipe_client
*cli
,
593 TALLOC_CTX
*mem_ctx
, int argc
,
596 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
597 WERROR werr
= WERR_GEN_FAILURE
;
598 const char *server_name
= cli
->desthost
;
599 const char *domain_name
= lp_workgroup();
601 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
603 if (argc
< 1 || argc
> 3) {
604 fprintf(stderr
, "Usage: %s <server_name> <domain_name>\n",
610 server_name
= argv
[1];
614 domain_name
= argv
[2];
617 status
= dcerpc_netr_LogonGetTrustRid(b
, mem_ctx
,
622 if (!NT_STATUS_IS_OK(status
)) {
623 werr
= ntstatus_to_werror(status
);
627 if (W_ERROR_IS_OK(werr
)) {
628 printf("Rid: %d\n", rid
);
634 static WERROR
cmd_netlogon_dsr_enumtrustdom(struct rpc_pipe_client
*cli
,
635 TALLOC_CTX
*mem_ctx
, int argc
,
638 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
639 WERROR werr
= WERR_GEN_FAILURE
;
640 const char *server_name
= cli
->desthost
;
641 uint32_t trust_flags
= NETR_TRUST_FLAG_IN_FOREST
;
642 struct netr_DomainTrustList trusts
;
643 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
645 if (argc
< 1 || argc
> 3) {
646 fprintf(stderr
, "Usage: %s <server_name> <trust_flags>\n",
652 server_name
= argv
[1];
656 sscanf(argv
[2], "%x", &trust_flags
);
659 status
= dcerpc_netr_DsrEnumerateDomainTrusts(b
, mem_ctx
,
664 if (!NT_STATUS_IS_OK(status
)) {
665 werr
= ntstatus_to_werror(status
);
669 if (W_ERROR_IS_OK(werr
)) {
672 printf("%d domains returned\n", trusts
.count
);
674 for (i
=0; i
<trusts
.count
; i
++ ) {
676 trusts
.array
[i
].dns_name
,
677 trusts
.array
[i
].netbios_name
);
684 static WERROR
cmd_netlogon_deregisterdnsrecords(struct rpc_pipe_client
*cli
,
685 TALLOC_CTX
*mem_ctx
, int argc
,
688 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
689 WERROR werr
= WERR_GEN_FAILURE
;
690 const char *server_name
= cli
->desthost
;
691 const char *domain
= lp_workgroup();
692 const char *dns_host
= NULL
;
693 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
695 if (argc
< 1 || argc
> 4) {
696 fprintf(stderr
, "Usage: %s <server_name> <domain_name> "
697 "<dns_host>\n", argv
[0]);
702 server_name
= argv
[1];
713 status
= dcerpc_netr_DsrDeregisterDNSHostRecords(b
, mem_ctx
,
720 if (!NT_STATUS_IS_OK(status
)) {
721 werr
= ntstatus_to_werror(status
);
725 if (W_ERROR_IS_OK(werr
)) {
732 static WERROR
cmd_netlogon_dsr_getforesttrustinfo(struct rpc_pipe_client
*cli
,
733 TALLOC_CTX
*mem_ctx
, int argc
,
736 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
737 WERROR werr
= WERR_GEN_FAILURE
;
738 const char *server_name
= cli
->desthost
;
739 const char *trusted_domain_name
= NULL
;
740 struct lsa_ForestTrustInformation
*info
= NULL
;
742 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
744 if (argc
< 1 || argc
> 4) {
745 fprintf(stderr
, "Usage: %s <server_name> <trusted_domain_name> "
746 "<flags>\n", argv
[0]);
751 server_name
= argv
[1];
755 trusted_domain_name
= argv
[2];
759 sscanf(argv
[3], "%x", &flags
);
762 status
= dcerpc_netr_DsRGetForestTrustInformation(b
, mem_ctx
,
768 if (!NT_STATUS_IS_OK(status
)) {
769 werr
= ntstatus_to_werror(status
);
773 if (W_ERROR_IS_OK(werr
)) {
780 static NTSTATUS
cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client
*cli
,
781 TALLOC_CTX
*mem_ctx
, int argc
,
784 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
786 const char *server_name
= cli
->desthost
;
787 struct netr_Blob blob
;
788 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
791 if (argc
< 1 || argc
> 3) {
792 fprintf(stderr
, "Usage: %s <server_name>\n", argv
[0]);
797 server_name
= argv
[1];
800 status
= dcerpc_netr_NetrEnumerateTrustedDomains(b
, mem_ctx
,
804 if (!NT_STATUS_IS_OK(status
)) {
808 if (!NT_STATUS_IS_OK(result
)) {
814 dump_data(1, blob
.data
, blob
.length
);
819 static WERROR
cmd_netlogon_enumtrusteddomainsex(struct rpc_pipe_client
*cli
,
820 TALLOC_CTX
*mem_ctx
, int argc
,
823 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
824 WERROR werr
= WERR_GEN_FAILURE
;
825 const char *server_name
= cli
->desthost
;
826 struct netr_DomainTrustList list
;
827 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
829 if (argc
< 1 || argc
> 3) {
830 fprintf(stderr
, "Usage: %s <server_name>\n", argv
[0]);
835 server_name
= argv
[1];
838 status
= dcerpc_netr_NetrEnumerateTrustedDomainsEx(b
, mem_ctx
,
842 if (!NT_STATUS_IS_OK(status
)) {
843 werr
= ntstatus_to_werror(status
);
847 if (W_ERROR_IS_OK(werr
)) {
854 static WERROR
cmd_netlogon_getdcsitecoverage(struct rpc_pipe_client
*cli
,
855 TALLOC_CTX
*mem_ctx
, int argc
,
858 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
859 WERROR werr
= WERR_GEN_FAILURE
;
860 const char *server_name
= cli
->desthost
;
861 struct DcSitesCtr
*ctr
= NULL
;
862 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
864 if (argc
< 1 || argc
> 3) {
865 fprintf(stderr
, "Usage: %s <server_name>\n", argv
[0]);
870 server_name
= argv
[1];
873 status
= dcerpc_netr_DsrGetDcSiteCoverageW(b
, mem_ctx
,
877 if (!NT_STATUS_IS_OK(status
)) {
878 werr
= ntstatus_to_werror(status
);
882 if (W_ERROR_IS_OK(werr
) && ctr
->num_sites
) {
884 printf("sites covered by this DC: %d\n", ctr
->num_sites
);
885 for (i
=0; i
<ctr
->num_sites
; i
++) {
886 printf("%s\n", ctr
->sites
[i
].string
);
893 static NTSTATUS
cmd_netlogon_capabilities(struct rpc_pipe_client
*cli
,
894 TALLOC_CTX
*mem_ctx
, int argc
,
897 struct netlogon_creds_cli_lck
*lck
;
898 union netr_Capabilities capabilities
;
902 fprintf(stderr
, "Usage: %s\n", argv
[0]);
906 status
= netlogon_creds_cli_lck(rpcclient_netlogon_creds
,
907 NETLOGON_CREDS_CLI_LCK_EXCLUSIVE
,
909 if (!NT_STATUS_IS_OK(status
)) {
910 fprintf(stderr
, "netlogon_creds_cli_lck failed: %s\n",
915 status
= netlogon_creds_cli_check(rpcclient_netlogon_creds
,
918 if (!NT_STATUS_IS_OK(status
)) {
919 fprintf(stderr
, "netlogon_creds_cli_check failed: %s\n",
926 printf("capabilities: 0x%08x\n", capabilities
.server_capabilities
);
931 static NTSTATUS
cmd_netlogon_logongetdomaininfo(struct rpc_pipe_client
*cli
,
932 TALLOC_CTX
*mem_ctx
, int argc
,
935 union netr_WorkstationInfo query
;
936 struct netr_WorkstationInformation workstation_info
;
937 union netr_DomainInfo
*domain_info
;
942 fprintf(stderr
, "Usage: %s\n", argv
[0]);
946 ZERO_STRUCT(workstation_info
);
948 query
.workstation_info
= &workstation_info
;
950 status
= netlogon_creds_cli_LogonGetDomainInfo(rpcclient_netlogon_creds
,
956 if (!NT_STATUS_IS_OK(status
)) {
957 fprintf(stderr
, "netlogon_creds_cli_LogonGetDomainInfo failed: %s\n",
962 s
= NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DomainInformation
, domain_info
->domain_info
);
971 /* List of commands exported by this module */
973 struct cmd_set netlogon_commands
[] = {
980 .name
= "logonctrl2",
981 .returntype
= RPC_RTYPE_WERROR
,
983 .wfn
= cmd_netlogon_logon_ctrl2
,
984 .table
= &ndr_table_netlogon
,
986 .description
= "Logon Control 2",
990 .name
= "getanydcname",
991 .returntype
= RPC_RTYPE_WERROR
,
993 .wfn
= cmd_netlogon_getanydcname
,
994 .table
= &ndr_table_netlogon
,
996 .description
= "Get trusted DC name",
1000 .name
= "getdcname",
1001 .returntype
= RPC_RTYPE_WERROR
,
1003 .wfn
= cmd_netlogon_getdcname
,
1004 .table
= &ndr_table_netlogon
,
1006 .description
= "Get trusted PDC name",
1010 .name
= "dsr_getdcname",
1011 .returntype
= RPC_RTYPE_WERROR
,
1013 .wfn
= cmd_netlogon_dsr_getdcname
,
1014 .table
= &ndr_table_netlogon
,
1016 .description
= "Get trusted DC name",
1020 .name
= "dsr_getdcnameex",
1021 .returntype
= RPC_RTYPE_WERROR
,
1023 .wfn
= cmd_netlogon_dsr_getdcnameex
,
1024 .table
= &ndr_table_netlogon
,
1026 .description
= "Get trusted DC name",
1030 .name
= "dsr_getdcnameex2",
1031 .returntype
= RPC_RTYPE_WERROR
,
1033 .wfn
= cmd_netlogon_dsr_getdcnameex2
,
1034 .table
= &ndr_table_netlogon
,
1036 .description
= "Get trusted DC name",
1040 .name
= "dsr_getsitename",
1041 .returntype
= RPC_RTYPE_WERROR
,
1043 .wfn
= cmd_netlogon_dsr_getsitename
,
1044 .table
= &ndr_table_netlogon
,
1046 .description
= "Get sitename",
1050 .name
= "dsr_getforesttrustinfo",
1051 .returntype
= RPC_RTYPE_WERROR
,
1053 .wfn
= cmd_netlogon_dsr_getforesttrustinfo
,
1054 .table
= &ndr_table_netlogon
,
1056 .description
= "Get Forest Trust Info",
1060 .name
= "logonctrl",
1061 .returntype
= RPC_RTYPE_WERROR
,
1063 .wfn
= cmd_netlogon_logon_ctrl
,
1064 .table
= &ndr_table_netlogon
,
1066 .description
= "Logon Control",
1071 .returntype
= RPC_RTYPE_NTSTATUS
,
1072 .ntfn
= cmd_netlogon_sam_logon
,
1074 .table
= &ndr_table_netlogon
,
1076 .description
= "Sam Logon",
1078 .use_netlogon_creds
= true,
1081 .name
= "change_trust_pw",
1082 .returntype
= RPC_RTYPE_NTSTATUS
,
1083 .ntfn
= cmd_netlogon_change_trust_pw
,
1085 .table
= &ndr_table_netlogon
,
1087 .description
= "Change Trust Account Password",
1089 .use_netlogon_creds
= true,
1092 .name
= "gettrustrid",
1093 .returntype
= RPC_RTYPE_WERROR
,
1095 .wfn
= cmd_netlogon_gettrustrid
,
1096 .table
= &ndr_table_netlogon
,
1098 .description
= "Get trust rid",
1102 .name
= "dsr_enumtrustdom",
1103 .returntype
= RPC_RTYPE_WERROR
,
1105 .wfn
= cmd_netlogon_dsr_enumtrustdom
,
1106 .table
= &ndr_table_netlogon
,
1108 .description
= "Enumerate trusted domains",
1112 .name
= "dsenumdomtrusts",
1113 .returntype
= RPC_RTYPE_WERROR
,
1115 .wfn
= cmd_netlogon_dsr_enumtrustdom
,
1116 .table
= &ndr_table_netlogon
,
1118 .description
= "Enumerate all trusted domains in an AD forest",
1122 .name
= "deregisterdnsrecords",
1123 .returntype
= RPC_RTYPE_WERROR
,
1125 .wfn
= cmd_netlogon_deregisterdnsrecords
,
1126 .table
= &ndr_table_netlogon
,
1128 .description
= "Deregister DNS records",
1132 .name
= "netrenumtrusteddomains",
1133 .returntype
= RPC_RTYPE_NTSTATUS
,
1134 .ntfn
= cmd_netlogon_enumtrusteddomains
,
1136 .table
= &ndr_table_netlogon
,
1138 .description
= "Enumerate trusted domains",
1142 .name
= "netrenumtrusteddomainsex",
1143 .returntype
= RPC_RTYPE_WERROR
,
1145 .wfn
= cmd_netlogon_enumtrusteddomainsex
,
1146 .table
= &ndr_table_netlogon
,
1148 .description
= "Enumerate trusted domains",
1152 .name
= "getdcsitecoverage",
1153 .returntype
= RPC_RTYPE_WERROR
,
1155 .wfn
= cmd_netlogon_getdcsitecoverage
,
1156 .table
= &ndr_table_netlogon
,
1158 .description
= "Get the Site-Coverage from a DC",
1162 .name
= "capabilities",
1163 .returntype
= RPC_RTYPE_NTSTATUS
,
1164 .ntfn
= cmd_netlogon_capabilities
,
1166 .table
= &ndr_table_netlogon
,
1168 .description
= "Return Capabilities",
1170 .use_netlogon_creds
= true,
1173 .name
= "logongetdomaininfo",
1174 .returntype
= RPC_RTYPE_NTSTATUS
,
1175 .ntfn
= cmd_netlogon_logongetdomaininfo
,
1177 .table
= &ndr_table_netlogon
,
1179 .description
= "Return LogonGetDomainInfo",
1181 .use_netlogon_creds
= true,