Skip to main content
Browse Documentation

Update password

Created by Mike Andrews, last updated 09 Jun 2020

Updating a users password can be achived by calling one of the UpdatePassword method overloads on the user object.

Updating a password requires the correct existing password and a valid new password.

Syntax

public void UpdatePassword(string existingPassword, string newPassword)
{    
}

Parameters

existingPassword

Type: string
The user's existing password.

newPassword

Type: string
The user's new password.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = client.Security.Users.Get("t.durden");

// Update the password
user.UpdatePassword("d0ntT4lk4boutf1ghtClub!", "F1ghtC1ub1234!")

Updating a password requires the correct existing password and a valid new password.

Syntax

public async Task UpdatePasswordAsync(string existingPassword, string newPassword)
{    
}

Parameters

existingPassword

Type: string
The user's existing password.

newPassword

Type: string
The user's new password.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = await client.Security.Users.GetAsync("t.durden");

// Update the password
await user.UpdatePasswordAsync("d0ntT4lk4boutf1ghtClub!", "F1ghtC1ub1234!");

Updating a password as a system administrator only requires a new password to be specified.

Syntax

public void UpdatePassword(string newPassword)
{    
}

Parameters

newPassword

Type: string
The user's new password.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = client.Security.Users.Get("t.durden");

// Update the password
user.UpdatePassword("F1ghtC1ub1234!")

Updating a password as a system administrator only requires a new password to be specified.

Syntax

public async Task UpdatePasswordAsync(string newPassword)
{    
}

Parameters

newPassword

Type: string
The user's new password.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = await client.Security.Users.GetAsync("t.durden");

// Update the password
await user.UpdatePasswordAsync("F1ghtC1ub1234!");