Update local account password via REST from Delinea secret server

Kaileb
Tera Contributor

We need to update the password of a local ServiceNow account that is used by automation. We use this account to get an OAuth token and our Secret Server updates AD and an AAD. We would like to automate this process, but we attempted to do this via Postman and using the REST API on the sys_user table. We can see that an update is done to the user profile, but the password does not change. Any suggestions?

2 REPLIES 2

Appli
Mega Sage
Mega Sage

Hi, please share how REST request looks like, what parameters, headers, etc  are being used there

Hope it helps

Hope it helps

Kaileb
Tera Contributor

We used the table api on sys_user. We tried it through PowerShell. Headers were:

Content-Type: application/json

Authorization : Basic <username: password> (encoded)

The user authorizing is the one getting the password changed. Does it need the admin role to change passwords?

function updatePassword($newPassword) {
    
    $uri = 'https://<instance>.service-now.com/api/now/table/sys_user/<user sys_id>?sysparm_input_display_value=true';
    $body =convertto-json -inputobject @{ "user_password" = $newPassword};

   $result = Invoke-RestMethod -Method put -uri $uri -Headers $headers

}