summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-27 14:25:03 +0100
committerGünther Deschner <gd@samba.org>2008-10-27 14:29:04 +0100
commit68aa9bd67f9556f608bfb321d593617bd346915f (patch)
tree09f7d547df17a1a4b1bcc32c1694b7d475c2e0ed /source3/rpcclient
parent5a4b421952e538a5f1cb347f3249150c4e271ecd (diff)
downloadsamba-68aa9bd67f9556f608bfb321d593617bd346915f.tar.gz
samba-68aa9bd67f9556f608bfb321d593617bd346915f.tar.bz2
samba-68aa9bd67f9556f608bfb321d593617bd346915f.zip
s3-rpcclient: add getdcsitecoverage call.
Guenther
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_netlogon.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index cdcc0ec28d..6efa316cf4 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -1003,6 +1003,43 @@ static WERROR cmd_netlogon_enumtrusteddomainsex(struct rpc_pipe_client *cli,
return werr;
}
+static WERROR cmd_netlogon_getdcsitecoverage(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
+{
+ NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+ WERROR werr = WERR_GENERAL_FAILURE;
+ const char *server_name = cli->desthost;
+ struct DcSitesCtr *ctr = NULL;
+
+ if (argc < 1 || argc > 3) {
+ fprintf(stderr, "Usage: %s <server_name>\n", argv[0]);
+ return WERR_OK;
+ }
+
+ if (argc >= 2) {
+ server_name = argv[1];
+ }
+
+ status = rpccli_netr_DsrGetDcSiteCoverageW(cli, mem_ctx,
+ server_name,
+ &ctr,
+ &werr);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
+
+ if (W_ERROR_IS_OK(werr) && ctr->num_sites) {
+ int i;
+ printf("sites covered by this DC: %d\n", ctr->num_sites);
+ for (i=0; i<ctr->num_sites; i++) {
+ printf("%s\n", ctr->sites[i].string);
+ }
+ }
+ done:
+ return werr;
+}
+
/* List of commands exported by this module */
@@ -1029,6 +1066,7 @@ struct cmd_set netlogon_commands[] = {
{ "deregisterdnsrecords", RPC_RTYPE_WERROR, NULL, cmd_netlogon_deregisterdnsrecords, &ndr_table_netlogon.syntax_id, NULL, "Deregister DNS records", "" },
{ "netrenumtrusteddomains", RPC_RTYPE_WERROR, NULL, cmd_netlogon_enumtrusteddomains, &ndr_table_netlogon.syntax_id, NULL, "Enumerate trusted domains", "" },
{ "netrenumtrusteddomainsex", RPC_RTYPE_WERROR, NULL, cmd_netlogon_enumtrusteddomainsex, &ndr_table_netlogon.syntax_id, NULL, "Enumerate trusted domains", "" },
+ { "getdcsitecoverage", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getdcsitecoverage, &ndr_table_netlogon.syntax_id, NULL, "Get the Site-Coverage from a DC", "" },
{ NULL }
};