From c88263ab9e8b3111742e5ce53b5aa29bba65e5ee Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 30 Nov 2007 20:20:54 +0100 Subject: Add "net dom unjoin" code. Guenther (This used to be commit 58d49023b9bc7d27e770f18a25cc6cebdc95b300) --- source3/utils/net_dom.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c index a4f5d1dd03..79130a8810 100644 --- a/source3/utils/net_dom.c +++ b/source3/utils/net_dom.c @@ -25,6 +25,8 @@ static int net_dom_usage(int argc, const char **argv) { d_printf("usage: net dom join " " \n"); + d_printf("usage: net dom unjoin " + " \n"); return -1; } @@ -33,10 +35,59 @@ int net_help_dom(int argc, const char **argv) { d_printf("net dom join"\ "\n Join a remote machine\n"); + d_printf("net dom unjoin"\ + "\n Unjoin a remote machine\n"); return -1; } +static int net_dom_unjoin(int argc, const char **argv) +{ + const char *server_name = NULL; + const char *account = NULL; + const char *password = NULL; + uint32_t unjoin_flags = WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE | + WKSSVC_JOIN_FLAGS_JOIN_TYPE; + bool reboot = false; + WERROR werr; + int i; + + if (argc < 1) { + return net_dom_usage(argc, argv); + } + + server_name = opt_host; + + for (i=0; i