<varlistentry><term>lookupdomain</term><listitem><para>Lookup Domain Name</para></listitem></varlistentry>
<varlistentry><term>chgpasswd</term><listitem><para>Change user password</para></listitem></varlistentry>
<varlistentry><term>chgpasswd2</term><listitem><para>Change user password</para></listitem></varlistentry>
- <varlistentry><term>chgpasswd3</term><listitem><para>Change user password</para></listitem></varlistentry>
+ <varlistentry><term>chgpasswd3</term><listitem><para>Change user password (RC4 encrypted)</para></listitem></varlistentry>
+ <varlistentry><term>chgpasswd4</term><listitem><para>Change user password (AES encrypted)</para></listitem></varlistentry>
<varlistentry><term>getdispinfoidx</term><listitem><para>Get Display Information Index</para></listitem></varlistentry>
<varlistentry><term>setuserinfo</term><listitem><para>Set user info</para></listitem></varlistentry>
<varlistentry><term>setuserinfo2</term><listitem><para>Set user info2</para></listitem></varlistentry>
return status;
}
+static NTSTATUS cmd_samr_chgpasswd4(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
+{
+ struct dcerpc_binding_handle *b = cli->binding_handle;
+ const char *srv_name_slash = cli->srv_name_slash;
+ const char *user = NULL;
+ const char *oldpass = NULL;
+ const char *newpass = NULL;
+ NTSTATUS status;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (argc < 4) {
+ printf("Usage: %s username oldpass newpass\n", argv[0]);
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ user = argv[1];
+ oldpass = argv[2];
+ newpass = argv[3];
+
+ /* Change user password */
+ status = dcerpc_samr_chgpasswd_user4(b,
+ mem_ctx,
+ srv_name_slash,
+ user,
+ oldpass,
+ newpass,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ if (!NT_STATUS_IS_OK(result)) {
+ status = result;
+ }
+
+ return status;
+}
+
static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv,
.description = "Change user password",
.usage = "",
},
+ {
+ .name = "chgpasswd4",
+ .returntype = RPC_RTYPE_NTSTATUS,
+ .ntfn = cmd_samr_chgpasswd4,
+ .wfn = NULL,
+ .table = &ndr_table_samr,
+ .rpc_pipe = NULL,
+ .description = "Change user password",
+ .usage = "",
+ },
{
.name = "getdispinfoidx",
.returntype = RPC_RTYPE_NTSTATUS,