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
);
109 status
= dcerpc_netr_LogonControl2(b
, mem_ctx
,
116 if (!NT_STATUS_IS_OK(status
)) {
117 return ntstatus_to_werror(status
);
120 if (!W_ERROR_IS_OK(werr
)) {
124 /* Display results */
129 static WERROR
cmd_netlogon_getanydcname(struct rpc_pipe_client
*cli
,
130 TALLOC_CTX
*mem_ctx
, int argc
,
133 const char *dcname
= NULL
;
137 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
140 fprintf(stderr
, "Usage: %s domainname\n", argv
[0]);
144 /* Make sure to wait for our DC's reply */
145 old_timeout
= rpccli_set_timeout(cli
, 30000); /* 30 seconds. */
146 rpccli_set_timeout(cli
, MAX(old_timeout
, 30000)); /* At least 30 sec */
148 status
= dcerpc_netr_GetAnyDCName(b
, mem_ctx
,
153 rpccli_set_timeout(cli
, old_timeout
);
155 if (!NT_STATUS_IS_OK(status
)) {
156 return ntstatus_to_werror(status
);
159 if (!W_ERROR_IS_OK(werr
)) {
163 /* Display results */
165 printf("%s\n", dcname
);
170 static WERROR
cmd_netlogon_getdcname(struct rpc_pipe_client
*cli
,
171 TALLOC_CTX
*mem_ctx
, int argc
,
174 const char *dcname
= NULL
;
178 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
181 fprintf(stderr
, "Usage: %s domainname\n", argv
[0]);
185 /* Make sure to wait for our DC's reply */
186 old_timeout
= rpccli_set_timeout(cli
, 30000); /* 30 seconds. */
187 rpccli_set_timeout(cli
, MAX(30000, old_timeout
)); /* At least 30 sec */
189 status
= dcerpc_netr_GetDcName(b
, mem_ctx
,
194 rpccli_set_timeout(cli
, old_timeout
);
196 if (!NT_STATUS_IS_OK(status
)) {
197 return ntstatus_to_werror(status
);
200 if (!W_ERROR_IS_OK(werr
)) {
204 /* Display results */
206 printf("%s\n", dcname
);
211 static WERROR
cmd_netlogon_dsr_getdcname(struct rpc_pipe_client
*cli
,
212 TALLOC_CTX
*mem_ctx
, int argc
,
216 WERROR werr
= WERR_OK
;
217 uint32_t flags
= DS_RETURN_DNS_NAME
;
218 const char *server_name
= cli
->desthost
;
219 const char *domain_name
;
220 struct GUID domain_guid
= GUID_zero();
221 struct GUID site_guid
= GUID_zero();
222 struct netr_DsRGetDCNameInfo
*info
= NULL
;
223 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
226 fprintf(stderr
, "Usage: %s [domain_name] [domain_guid] "
227 "[site_guid] [flags]\n", argv
[0]);
232 domain_name
= argv
[1];
235 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[2], &domain_guid
))) {
236 return WERR_NOT_ENOUGH_MEMORY
;
241 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[3], &site_guid
))) {
242 return WERR_NOT_ENOUGH_MEMORY
;
247 sscanf(argv
[4], "%x", &flags
);
249 result
= dcerpc_netr_DsRGetDCName(b
, mem_ctx
,
257 if (!NT_STATUS_IS_OK(result
)) {
258 return ntstatus_to_werror(result
);
261 if (W_ERROR_IS_OK(werr
)) {
262 d_printf("DsGetDcName gave: %s\n",
263 NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DsRGetDCNameInfo
, info
));
267 printf("rpccli_netlogon_dsr_getdcname returned %s\n",
273 static WERROR
cmd_netlogon_dsr_getdcnameex(struct rpc_pipe_client
*cli
,
274 TALLOC_CTX
*mem_ctx
, int argc
,
279 uint32_t flags
= DS_RETURN_DNS_NAME
;
280 const char *server_name
= cli
->desthost
;
281 const char *domain_name
;
282 const char *site_name
= NULL
;
283 struct GUID domain_guid
= GUID_zero();
284 struct netr_DsRGetDCNameInfo
*info
= NULL
;
285 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
288 fprintf(stderr
, "Usage: %s [domain_name] [domain_guid] "
289 "[site_name] [flags]\n", argv
[0]);
293 domain_name
= argv
[1];
296 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[2], &domain_guid
))) {
297 return WERR_NOT_ENOUGH_MEMORY
;
306 sscanf(argv
[4], "%x", &flags
);
309 status
= dcerpc_netr_DsRGetDCNameEx(b
, mem_ctx
,
317 if (!NT_STATUS_IS_OK(status
)) {
318 return ntstatus_to_werror(status
);
321 if (!W_ERROR_IS_OK(result
)) {
325 d_printf("DsRGetDCNameEx gave %s\n",
326 NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DsRGetDCNameInfo
, info
));
331 static WERROR
cmd_netlogon_dsr_getdcnameex2(struct rpc_pipe_client
*cli
,
332 TALLOC_CTX
*mem_ctx
, int argc
,
337 uint32_t flags
= DS_RETURN_DNS_NAME
;
338 const char *server_name
= cli
->desthost
;
339 const char *domain_name
= NULL
;
340 const char *client_account
= NULL
;
342 const char *site_name
= NULL
;
343 struct GUID domain_guid
= GUID_zero();
344 struct netr_DsRGetDCNameInfo
*info
= NULL
;
345 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
348 fprintf(stderr
, "Usage: %s [client_account] [acb_mask] "
349 "[domain_name] [domain_guid] [site_name] "
350 "[flags]\n", argv
[0]);
355 client_account
= argv
[1];
359 mask
= atoi(argv
[2]);
363 domain_name
= argv
[3];
367 if (!NT_STATUS_IS_OK(GUID_from_string(argv
[4], &domain_guid
))) {
368 return WERR_NOT_ENOUGH_MEMORY
;
377 sscanf(argv
[6], "%x", &flags
);
380 status
= dcerpc_netr_DsRGetDCNameEx2(b
, mem_ctx
,
390 if (!NT_STATUS_IS_OK(status
)) {
391 return ntstatus_to_werror(status
);
394 if (!W_ERROR_IS_OK(result
)) {
398 d_printf("DsRGetDCNameEx2 gave %s\n",
399 NDR_PRINT_STRUCT_STRING(mem_ctx
, netr_DsRGetDCNameInfo
, info
));
405 static WERROR
cmd_netlogon_dsr_getsitename(struct rpc_pipe_client
*cli
,
406 TALLOC_CTX
*mem_ctx
, int argc
,
411 const char *sitename
= NULL
;
412 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
415 fprintf(stderr
, "Usage: %s computername\n", argv
[0]);
419 status
= dcerpc_netr_DsRGetSiteName(b
, mem_ctx
,
423 if (!NT_STATUS_IS_OK(status
)) {
424 return ntstatus_to_werror(status
);
427 if (!W_ERROR_IS_OK(werr
)) {
428 printf("rpccli_netlogon_dsr_gesitename returned %s\n",
429 nt_errstr(werror_to_ntstatus(werr
)));
433 printf("Computer %s is on Site: %s\n", argv
[1], sitename
);
438 static WERROR
cmd_netlogon_logon_ctrl(struct rpc_pipe_client
*cli
,
439 TALLOC_CTX
*mem_ctx
, int argc
,
442 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
444 const char *logon_server
= cli
->desthost
;
445 enum netr_LogonControlCode function_code
= 1;
447 union netr_CONTROL_QUERY_INFORMATION info
;
448 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
451 fprintf(stderr
, "Usage: %s <logon_server> <function_code> "
452 "<level>\n", argv
[0]);
457 logon_server
= argv
[1];
461 function_code
= atoi(argv
[2]);
465 level
= atoi(argv
[3]);
468 status
= dcerpc_netr_LogonControl(b
, mem_ctx
,
474 if (!NT_STATUS_IS_OK(status
)) {
475 return ntstatus_to_werror(status
);
478 if (!W_ERROR_IS_OK(werr
)) {
482 /* Display results */
487 /* Log on a domain user */
489 static NTSTATUS
cmd_netlogon_sam_logon(struct rpc_pipe_client
*cli
,
490 TALLOC_CTX
*mem_ctx
, int argc
,
493 NTSTATUS result
= NT_STATUS_UNSUCCESSFUL
;
494 int logon_type
= NetlogonNetworkInformation
;
495 const char *username
, *password
;
496 uint32_t logon_param
= 0;
497 const char *workstation
= NULL
;
498 struct netr_SamInfo3
*info3
= NULL
;
499 uint8_t authoritative
= 0;
501 uint16_t validation_level
;
502 union netr_Validation
*validation
= NULL
;
504 /* Check arguments */
506 if (argc
< 3 || argc
> 6) {
507 fprintf(stderr
, "Usage: samlogon <username> <password> [workstation]"
508 "[logon_type (1 or 2)] [logon_parameter]\n");
516 workstation
= argv
[3];
519 sscanf(argv
[4], "%i", &logon_type
);
522 sscanf(argv
[5], "%x", &logon_param
);
524 if (rpcclient_netlogon_creds
== NULL
) {
525 result
= NT_STATUS_UNSUCCESSFUL
;
529 /* Perform the sam logon */
531 result
= rpccli_netlogon_password_logon(rpcclient_netlogon_creds
,
544 if (!NT_STATUS_IS_OK(result
))
547 result
= map_validation_to_info3(mem_ctx
,
551 if (!NT_STATUS_IS_OK(result
)) {
559 /* Change the trust account password */
561 static NTSTATUS
cmd_netlogon_change_trust_pw(struct rpc_pipe_client
*cli
,
562 TALLOC_CTX
*mem_ctx
, int argc
,
565 NTSTATUS result
= NT_STATUS_UNSUCCESSFUL
;
566 const char *dcname
= cli
->desthost
;
568 /* Check arguments */
571 fprintf(stderr
, "Usage: change_trust_pw");
575 result
= trust_pw_change(rpcclient_netlogon_creds
,
581 if (!NT_STATUS_IS_OK(result
))
588 static WERROR
cmd_netlogon_gettrustrid(struct rpc_pipe_client
*cli
,
589 TALLOC_CTX
*mem_ctx
, int argc
,
592 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
593 WERROR werr
= WERR_GEN_FAILURE
;
594 const char *server_name
= cli
->desthost
;
595 const char *domain_name
= lp_workgroup();
597 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
599 if (argc
< 1 || argc
> 3) {
600 fprintf(stderr
, "Usage: %s <server_name> <domain_name>\n",
606 server_name
= argv
[1];
610 domain_name
= argv
[2];
613 status
= dcerpc_netr_LogonGetTrustRid(b
, mem_ctx
,
618 if (!NT_STATUS_IS_OK(status
)) {
619 werr
= ntstatus_to_werror(status
);
623 if (W_ERROR_IS_OK(werr
)) {
624 printf("Rid: %d\n", rid
);
630 static WERROR
cmd_netlogon_dsr_enumtrustdom(struct rpc_pipe_client
*cli
,
631 TALLOC_CTX
*mem_ctx
, int argc
,
634 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
635 WERROR werr
= WERR_GEN_FAILURE
;
636 const char *server_name
= cli
->desthost
;
637 uint32_t trust_flags
= NETR_TRUST_FLAG_IN_FOREST
;
638 struct netr_DomainTrustList trusts
;
639 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
641 if (argc
< 1 || argc
> 3) {
642 fprintf(stderr
, "Usage: %s <server_name> <trust_flags>\n",
648 server_name
= argv
[1];
652 sscanf(argv
[2], "%x", &trust_flags
);
655 status
= dcerpc_netr_DsrEnumerateDomainTrusts(b
, mem_ctx
,
660 if (!NT_STATUS_IS_OK(status
)) {
661 werr
= ntstatus_to_werror(status
);
665 if (W_ERROR_IS_OK(werr
)) {
668 printf("%d domains returned\n", trusts
.count
);
670 for (i
=0; i
<trusts
.count
; i
++ ) {
672 trusts
.array
[i
].dns_name
,
673 trusts
.array
[i
].netbios_name
);
680 static WERROR
cmd_netlogon_deregisterdnsrecords(struct rpc_pipe_client
*cli
,
681 TALLOC_CTX
*mem_ctx
, int argc
,
684 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
685 WERROR werr
= WERR_GEN_FAILURE
;
686 const char *server_name
= cli
->desthost
;
687 const char *domain
= lp_workgroup();
688 const char *dns_host
= NULL
;
689 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
691 if (argc
< 1 || argc
> 4) {
692 fprintf(stderr
, "Usage: %s <server_name> <domain_name> "
693 "<dns_host>\n", argv
[0]);
698 server_name
= argv
[1];
709 status
= dcerpc_netr_DsrDeregisterDNSHostRecords(b
, mem_ctx
,
716 if (!NT_STATUS_IS_OK(status
)) {
717 werr
= ntstatus_to_werror(status
);
721 if (W_ERROR_IS_OK(werr
)) {
728 static WERROR
cmd_netlogon_dsr_getforesttrustinfo(struct rpc_pipe_client
*cli
,
729 TALLOC_CTX
*mem_ctx
, int argc
,
732 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
733 WERROR werr
= WERR_GEN_FAILURE
;
734 const char *server_name
= cli
->desthost
;
735 const char *trusted_domain_name
= NULL
;
736 struct lsa_ForestTrustInformation
*info
= NULL
;
738 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
740 if (argc
< 1 || argc
> 4) {
741 fprintf(stderr
, "Usage: %s <server_name> <trusted_domain_name> "
742 "<flags>\n", argv
[0]);
747 server_name
= argv
[1];
751 trusted_domain_name
= argv
[2];
755 sscanf(argv
[3], "%x", &flags
);
758 status
= dcerpc_netr_DsRGetForestTrustInformation(b
, mem_ctx
,
764 if (!NT_STATUS_IS_OK(status
)) {
765 werr
= ntstatus_to_werror(status
);
769 if (W_ERROR_IS_OK(werr
)) {
776 static NTSTATUS
cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client
*cli
,
777 TALLOC_CTX
*mem_ctx
, int argc
,
780 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
782 const char *server_name
= cli
->desthost
;
783 struct netr_Blob blob
;
784 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
787 if (argc
< 1 || argc
> 3) {
788 fprintf(stderr
, "Usage: %s <server_name>\n", argv
[0]);
793 server_name
= argv
[1];
796 status
= dcerpc_netr_NetrEnumerateTrustedDomains(b
, mem_ctx
,
800 if (!NT_STATUS_IS_OK(status
)) {
804 if (!NT_STATUS_IS_OK(result
)) {
810 dump_data(1, blob
.data
, blob
.length
);
815 static WERROR
cmd_netlogon_enumtrusteddomainsex(struct rpc_pipe_client
*cli
,
816 TALLOC_CTX
*mem_ctx
, int argc
,
819 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
820 WERROR werr
= WERR_GEN_FAILURE
;
821 const char *server_name
= cli
->desthost
;
822 struct netr_DomainTrustList list
;
823 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
825 if (argc
< 1 || argc
> 3) {
826 fprintf(stderr
, "Usage: %s <server_name>\n", argv
[0]);
831 server_name
= argv
[1];
834 status
= dcerpc_netr_NetrEnumerateTrustedDomainsEx(b
, mem_ctx
,
838 if (!NT_STATUS_IS_OK(status
)) {
839 werr
= ntstatus_to_werror(status
);
843 if (W_ERROR_IS_OK(werr
)) {
850 static WERROR
cmd_netlogon_getdcsitecoverage(struct rpc_pipe_client
*cli
,
851 TALLOC_CTX
*mem_ctx
, int argc
,
854 NTSTATUS status
= NT_STATUS_UNSUCCESSFUL
;
855 WERROR werr
= WERR_GEN_FAILURE
;
856 const char *server_name
= cli
->desthost
;
857 struct DcSitesCtr
*ctr
= NULL
;
858 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
860 if (argc
< 1 || argc
> 3) {
861 fprintf(stderr
, "Usage: %s <server_name>\n", argv
[0]);
866 server_name
= argv
[1];
869 status
= dcerpc_netr_DsrGetDcSiteCoverageW(b
, mem_ctx
,
873 if (!NT_STATUS_IS_OK(status
)) {
874 werr
= ntstatus_to_werror(status
);
878 if (W_ERROR_IS_OK(werr
) && ctr
->num_sites
) {
880 printf("sites covered by this DC: %d\n", ctr
->num_sites
);
881 for (i
=0; i
<ctr
->num_sites
; i
++) {
882 printf("%s\n", ctr
->sites
[i
].string
);
889 static NTSTATUS
cmd_netlogon_capabilities(struct rpc_pipe_client
*cli
,
890 TALLOC_CTX
*mem_ctx
, int argc
,
893 struct netlogon_creds_cli_lck
*lck
;
894 union netr_Capabilities capabilities
;
898 fprintf(stderr
, "Usage: %s\n", argv
[0]);
902 status
= netlogon_creds_cli_lck(rpcclient_netlogon_creds
,
903 NETLOGON_CREDS_CLI_LCK_EXCLUSIVE
,
905 if (!NT_STATUS_IS_OK(status
)) {
906 fprintf(stderr
, "netlogon_creds_cli_lck failed: %s\n",
911 status
= netlogon_creds_cli_check(rpcclient_netlogon_creds
,
914 if (!NT_STATUS_IS_OK(status
)) {
915 fprintf(stderr
, "netlogon_creds_cli_check failed: %s\n",
922 printf("capabilities: 0x%08x\n", capabilities
.server_capabilities
);
927 /* List of commands exported by this module */
929 struct cmd_set netlogon_commands
[] = {
933 { "logonctrl2", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_logon_ctrl2
, &ndr_table_netlogon
, NULL
, "Logon Control 2", "" },
934 { "getanydcname", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_getanydcname
, &ndr_table_netlogon
, NULL
, "Get trusted DC name", "" },
935 { "getdcname", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_getdcname
, &ndr_table_netlogon
, NULL
, "Get trusted PDC name", "" },
936 { "dsr_getdcname", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_getdcname
, &ndr_table_netlogon
, NULL
, "Get trusted DC name", "" },
937 { "dsr_getdcnameex", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_getdcnameex
, &ndr_table_netlogon
, NULL
, "Get trusted DC name", "" },
938 { "dsr_getdcnameex2", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_getdcnameex2
, &ndr_table_netlogon
, NULL
, "Get trusted DC name", "" },
939 { "dsr_getsitename", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_getsitename
, &ndr_table_netlogon
, NULL
, "Get sitename", "" },
940 { "dsr_getforesttrustinfo", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_getforesttrustinfo
, &ndr_table_netlogon
, NULL
, "Get Forest Trust Info", "" },
941 { "logonctrl", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_logon_ctrl
, &ndr_table_netlogon
, NULL
, "Logon Control", "" },
942 { "samlogon", RPC_RTYPE_NTSTATUS
, cmd_netlogon_sam_logon
, NULL
, &ndr_table_netlogon
, NULL
, "Sam Logon", "", .use_netlogon_creds
= true, },
943 { "change_trust_pw", RPC_RTYPE_NTSTATUS
, cmd_netlogon_change_trust_pw
, NULL
, &ndr_table_netlogon
, NULL
, "Change Trust Account Password", "", .use_netlogon_creds
= true, },
944 { "gettrustrid", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_gettrustrid
, &ndr_table_netlogon
, NULL
, "Get trust rid", "" },
945 { "dsr_enumtrustdom", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_enumtrustdom
, &ndr_table_netlogon
, NULL
, "Enumerate trusted domains", "" },
946 { "dsenumdomtrusts", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_dsr_enumtrustdom
, &ndr_table_netlogon
, NULL
, "Enumerate all trusted domains in an AD forest", "" },
947 { "deregisterdnsrecords", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_deregisterdnsrecords
, &ndr_table_netlogon
, NULL
, "Deregister DNS records", "" },
948 { "netrenumtrusteddomains", RPC_RTYPE_NTSTATUS
, cmd_netlogon_enumtrusteddomains
, NULL
, &ndr_table_netlogon
, NULL
, "Enumerate trusted domains", "" },
949 { "netrenumtrusteddomainsex", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_enumtrusteddomainsex
, &ndr_table_netlogon
, NULL
, "Enumerate trusted domains", "" },
950 { "getdcsitecoverage", RPC_RTYPE_WERROR
, NULL
, cmd_netlogon_getdcsitecoverage
, &ndr_table_netlogon
, NULL
, "Get the Site-Coverage from a DC", "" },
951 { "capabilities", RPC_RTYPE_NTSTATUS
, cmd_netlogon_capabilities
, NULL
, &ndr_table_netlogon
, NULL
, "Return Capabilities", "", .use_netlogon_creds
= true, },