Update password
Log in to add to favouritesUpdating a users password can be achived by calling one of the UpdatePassword
method overloads on the user object.
- UpdatePassword(string existingPassword, string newPassword)
- UpdatePasswordAsync(string existingPassword, string newPassword)
- UpdatePassword(string newPassword)
- UpdatePasswordAsync(string newPassword)
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!");