An API that connects multiple Microsoft services, enabling data access and automation across platforms
As the error message suggests, you don't have permissions to update the password on said user. For this operation to succeed when run against a privileged (admin) user, you need to run it as a Global Administrator assigned the Directory.AccessAsUser.All permission.