One of my customers was getting a strange error when trying to remove permissions in vCenter:
The “Remove Permission” operation failed for the entity with following error message. The object or item referred to could not be found.
But the user was there! I asked him to add a new user and then remove it. He did that without an issue.
Then he showed me that he can add this user second time… Wait… Second time? What the hell???
So we had 2 entries:
MYLAB\DANIEL
<– new one
and
MYLAB\daniel
<– old one
Hmm… And when I checked VPX_ACCESS
table in vCenter database I had only one user there – the old one…
Here is script to check the table:
SELECT [ID],[PRINCIPAL],[ROLE_ID],[ENTITY_ID],[FLAG] FROM [mgmtvcenter].[dbo].[VPX_ACCESS] GO
Remove new user from vCenter – you should be still able to – and then check your user ID
In my case it was:
ID PRINCIPAL ROLE_ID ENTITY_ID FLAG 502 MYLAB\daniel -1 1 1
So… let’s remove that one… STOP!!! Backup the database first!
We can remove our guy:
DELETE FROM VPX_ACCESS WHERE ID = 502;
Restart vCenter service and that’s it!