From 1d8094172c69ec8d64701b70a87ddf31b0d8f4f9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 17 Sep 2010 13:16:26 +0200 Subject: s3-nltest: add dsregdns command to nltest. Guenther --- source3/lib/netapi/examples/netlogon/nltest.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/lib/netapi/examples/netlogon/nltest.c b/source3/lib/netapi/examples/netlogon/nltest.c index e3ced90a20..0c393ea3be 100644 --- a/source3/lib/netapi/examples/netlogon/nltest.c +++ b/source3/lib/netapi/examples/netlogon/nltest.c @@ -58,7 +58,8 @@ enum { OPT_SITE, OPT_ACCOUNT, OPT_RET_DNS, - OPT_RET_NETBIOS + OPT_RET_NETBIOS, + OPT_DSREGDNS }; /**************************************************************** @@ -207,6 +208,7 @@ int main(int argc, const char **argv) char *opt_account = NULL; int opt_ret_dns = 0; int opt_ret_netbios = 0; + int opt_dsregdns = 0; uint32_t query_level = 0; uint8_t *buffer = NULL; uint32_t flags = 0; @@ -244,6 +246,7 @@ int main(int argc, const char **argv) {"account", 0, POPT_ARG_STRING, &opt_account, OPT_ACCOUNT, "ACCOUNT"}, {"ret_dns", 0, POPT_ARG_NONE, &opt_ret_dns, OPT_RET_DNS, NULL}, {"ret_netbios", 0, POPT_ARG_NONE, &opt_ret_netbios, OPT_RET_NETBIOS, NULL}, + {"dsregdns", 0, POPT_ARG_NONE, &opt_dsregdns, OPT_DSREGDNS, "Force registration of all DC-specific DNS records"}, POPT_COMMON_LIBNETAPI_EXAMPLES POPT_TABLEEND }; @@ -362,6 +365,23 @@ int main(int argc, const char **argv) print_netlogon_info_result(query_level, buffer); + break; + case OPT_DSREGDNS: + query_level = 1; + status = I_NetLogonControl2(opt_server, + NETLOGON_CONTROL_FORCE_DNS_REG, + query_level, + NULL, + &buffer); + if (status != 0) { + fprintf(stderr, "I_NetlogonControl failed: Status = %d 0x%x %s\n", + status, status, + libnetapi_get_error_string(ctx, status)); + goto done; + } + + print_netlogon_info_result(query_level, buffer); + break; case OPT_DSGETDC: if (opt_pdc) -- cgit