summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-11-22 14:10:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:30 -0500
commit63addcb4d7c9c13446d91a0972fe29542a7e1bad (patch)
tree33c02eb431e34273e4f9526a90867ef9484cd61a /source3/rpcclient
parente09cc27d3b0156fd410c1e47cbbb6686819119d4 (diff)
downloadsamba-63addcb4d7c9c13446d91a0972fe29542a7e1bad.tar.gz
samba-63addcb4d7c9c13446d91a0972fe29542a7e1bad.tar.bz2
samba-63addcb4d7c9c13446d91a0972fe29542a7e1bad.zip
r11853: Add Dsr_GetSiteName (handy for experimenting with GPOs).
Guenther (This used to be commit c54430a7b5e40d3bdf8afdc813eb722c0a3b861e)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_netlogon.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 20f11bc3c9..9377f8fde8 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -99,6 +99,31 @@ static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
return result;
}
+static WERROR cmd_netlogon_dsr_getsitename(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
+{
+ WERROR result;
+ char *sitename;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: %s computername\n", argv[0]);
+ return WERR_OK;
+ }
+
+ result = rpccli_netlogon_dsr_getsitename(cli, mem_ctx, argv[1], &sitename);
+
+ if (!W_ERROR_IS_OK(result)) {
+ printf("rpccli_netlogon_dsr_gesitename returned %s\n",
+ nt_errstr(werror_to_ntstatus(result)));
+ return result;
+ }
+
+ printf("Computer %s is on Site: %s\n", argv[1], sitename);
+
+ return WERR_OK;
+}
+
static NTSTATUS cmd_netlogon_logon_ctrl(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
@@ -347,6 +372,7 @@ struct cmd_set netlogon_commands[] = {
{ "logonctrl2", RPC_RTYPE_NTSTATUS, cmd_netlogon_logon_ctrl2, NULL, PI_NETLOGON, NULL, "Logon Control 2", "" },
{ "getdcname", RPC_RTYPE_NTSTATUS, cmd_netlogon_getdcname, NULL, PI_NETLOGON, NULL, "Get trusted DC name", "" },
{ "dsr_getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcname, PI_NETLOGON, NULL, "Get trusted DC name", "" },
+ { "dsr_getsitename", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getsitename, PI_NETLOGON, NULL, "Get sitename", "" },
{ "logonctrl", RPC_RTYPE_NTSTATUS, cmd_netlogon_logon_ctrl, NULL, PI_NETLOGON, NULL, "Logon Control", "" },
{ "samsync", RPC_RTYPE_NTSTATUS, cmd_netlogon_sam_sync, NULL, PI_NETLOGON, NULL, "Sam Synchronisation", "" },
{ "samdeltas", RPC_RTYPE_NTSTATUS, cmd_netlogon_sam_deltas, NULL, PI_NETLOGON, NULL, "Query Sam Deltas", "" },