How to Update LastPass Users via PowerShell API?

0
2
Asked By SunsetSloth27 On

I'm looking for some help with the LastPass REST API. Specifically, I'm trying to find a way to update user attributes by removing some legacy Active Directory data that was synced over. I've been experimenting with the commands, but I'm having trouble getting the update command to work properly for a user.

The background is that Entra provisioning pushed a field for a manager that LastPass no longer supports, so I have to manually remove this attribute for thousands of users. Any advice would be appreciated!

2 Answers

Answered By TechyTurtle42 On

First, you want to ensure your API request is correctly formed. Check what data you're sending—especially the structure. You might be missing the username in the right place. From your example, it looks like you're sending the payload without the username at the top level. It should look something like this:

```powershell
$data = @{ username = $usernameToUpdate; attribs = @{ Department = $newDepartment; mobile = ''; fullname = 'Test Name' } }
```
Make sure that the `username` is included in that main definition, as it seems to be a requirement. Also, verify the API endpoint is correct. If you still face issues, sharing error messages will help us diagnose further!

CodingCat22 -

Yeah, I had a similar issue. The payload needs to match what the API expects. If adding the username directly still doesn’t update the attributes, it might be worth checking if there are any constraints or if the API requires additional permission for those specific attributes.

Answered By DataDynamo99 On

Have you checked the API documentation from LastPass? Often, they provide specific examples that illustrate how to structure your API calls, including how to handle attributes that are no longer supported. If the delete operation isn’t working, you might have to reach out to LastPass support for guidance on the correct way to remove unsupported fields. Sometimes, the fields might need specific handling when you’re making bulk changes.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.