#include "lib/netapi/libnetapi.h"
#include "librpc/gen_ndr/libnet_join.h"
#include "libnet/libnet_join.h"
-#include "../librpc/gen_ndr/cli_wkssvc.h"
+#include "../librpc/gen_ndr/ndr_wkssvc_c.h"
#include "secrets.h"
/****************************************************************
NTSTATUS status;
WERROR werr;
unsigned int old_timeout = 0;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server,
&ndr_table_wkssvc.syntax_id,
goto done;
}
+ b = pipe_cli->binding_handle;
+
if (r->in.password) {
encode_wkssvc_join_password_buffer(ctx,
r->in.password,
old_timeout = rpccli_set_timeout(pipe_cli, 600000);
- status = rpccli_wkssvc_NetrJoinDomain2(pipe_cli, talloc_tos(),
+ status = dcerpc_wkssvc_NetrJoinDomain2(b, talloc_tos(),
r->in.server,
r->in.domain,
r->in.account_ou,
NTSTATUS status;
WERROR werr;
unsigned int old_timeout = 0;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server_name,
&ndr_table_wkssvc.syntax_id,
goto done;
}
+ b = pipe_cli->binding_handle;
+
if (r->in.password) {
encode_wkssvc_join_password_buffer(ctx,
r->in.password,
old_timeout = rpccli_set_timeout(pipe_cli, 60000);
- status = rpccli_wkssvc_NetrUnjoinDomain2(pipe_cli, talloc_tos(),
+ status = dcerpc_wkssvc_NetrUnjoinDomain2(b, talloc_tos(),
r->in.server_name,
r->in.account,
encrypted_password,
NTSTATUS status;
WERROR werr;
const char *buffer = NULL;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server_name,
&ndr_table_wkssvc.syntax_id,
goto done;
}
- status = rpccli_wkssvc_NetrGetJoinInformation(pipe_cli, talloc_tos(),
+ b = pipe_cli->binding_handle;
+
+ status = dcerpc_wkssvc_NetrGetJoinInformation(b, talloc_tos(),
r->in.server_name,
&buffer,
(enum wkssvc_NetJoinStatus *)r->out.name_type,
struct wkssvc_PasswordBuffer *encrypted_password = NULL;
NTSTATUS status;
WERROR werr;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server_name,
&ndr_table_wkssvc.syntax_id,
goto done;
}
+ b = pipe_cli->binding_handle;
+
if (r->in.password) {
encode_wkssvc_join_password_buffer(ctx,
r->in.password,
&encrypted_password);
}
- status = rpccli_wkssvc_NetrGetJoinableOus2(pipe_cli, talloc_tos(),
+ status = dcerpc_wkssvc_NetrGetJoinableOus2(b, talloc_tos(),
r->in.server_name,
r->in.domain,
r->in.account,
struct wkssvc_PasswordBuffer *encrypted_password = NULL;
NTSTATUS status;
WERROR werr;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server_name,
&ndr_table_wkssvc.syntax_id,
goto done;
}
+ b = pipe_cli->binding_handle;
+
if (r->in.password) {
encode_wkssvc_join_password_buffer(ctx,
r->in.password,
&encrypted_password);
}
- status = rpccli_wkssvc_NetrRenameMachineInDomain2(pipe_cli, talloc_tos(),
+ status = dcerpc_wkssvc_NetrRenameMachineInDomain2(b, talloc_tos(),
r->in.server_name,
r->in.new_machine_name,
r->in.account,
#include "includes.h"
#include "rpcclient.h"
-#include "../librpc/gen_ndr/cli_wkssvc.h"
+#include "../librpc/gen_ndr/ndr_wkssvc_c.h"
static WERROR cmd_wkssvc_wkstagetinfo(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint32_t level = 100;
union wkssvc_NetWkstaInfo info;
const char *server_name;
+ struct dcerpc_binding_handle *b = cli->binding_handle;
if (argc > 2) {
printf("usage: %s <level>\n", argv[0]);
server_name = cli->desthost;
- status = rpccli_wkssvc_NetWkstaGetInfo(cli, mem_ctx,
+ status = dcerpc_wkssvc_NetWkstaGetInfo(b, mem_ctx,
server_name,
level,
&info,
enum wkssvc_NetJoinStatus name_type;
NTSTATUS status;
WERROR werr;
+ struct dcerpc_binding_handle *b = cli->binding_handle;
server_name = cli->desthost;
name_buffer = "";
- status = rpccli_wkssvc_NetrGetJoinInformation(cli, mem_ctx,
+ status = dcerpc_wkssvc_NetrGetJoinInformation(b, mem_ctx,
server_name,
&name_buffer,
&name_type,
const char *message = "my message";
NTSTATUS status;
WERROR werr;
+ struct dcerpc_binding_handle *b = cli->binding_handle;
if (argc > 1) {
message = argv[1];
return WERR_NOMEM;
}
- status = rpccli_wkssvc_NetrMessageBufferSend(cli, mem_ctx,
+ status = dcerpc_wkssvc_NetrMessageBufferSend(b, mem_ctx,
server_name,
message_name,
message_sender_name,
NTSTATUS status;
struct wkssvc_ComputerNamesCtr *ctr = NULL;
WERROR werr;
+ struct dcerpc_binding_handle *b = cli->binding_handle;
server_name = cli->desthost;
name_type = atoi(argv[1]);
}
- status = rpccli_wkssvc_NetrEnumerateComputerNames(cli, mem_ctx,
+ status = dcerpc_wkssvc_NetrEnumerateComputerNames(b, mem_ctx,
server_name,
name_type, 0,
&ctr,
struct wkssvc_NetWkstaEnumUsersInfo info;
WERROR werr;
uint32_t i, num_entries, resume_handle;
+ struct dcerpc_binding_handle *b = cli->binding_handle;
server_name = cli->desthost;
info.level = atoi(argv[1]);
}
- status = rpccli_wkssvc_NetWkstaEnumUsers(cli, mem_ctx, server_name,
+ status = dcerpc_wkssvc_NetWkstaEnumUsers(b, mem_ctx, server_name,
&info, 1000, &num_entries,
&resume_handle, &werr);
if (!NT_STATUS_IS_OK(status)) {