What are the necessary Privileges to connect via PowerCLI to a VCenter?

1

First off: Using an Administrator account works, but it is not desired.

We have a VM which needs to be reset once a week. We added a ScheduledTask to the VCenter Instance which runs these three lines:

VMWare.VimAutomation.Core\Connect-VIServer - Server $server -User $user -Password $password
VMWare.VimAutomation.Core\Set-VM -VM $vm -Snapshot $snap -Confirm:$false
VMWare.VimAutomation.Core\Disconnect-VIServer -Confirm:$false

We get the following error message:

Connect-VIServer : 6/7/19 9:47:35 AM    Connect-VIServer 
    Permission to perform this operation was denied.
    Required privilege 'System.Read' on managed object with id 'OptionManager-VpxSettings'.

So I guess that we need to add more privileges to the role associated with $user?

That User currently is in the "Main User of VM" group (or whatever it is called in the english UI, our version is german).

So how do we add System.Read to OptionManager-VpxSettings?

Malte

Posted 2019-06-07T07:56:56.920

Reputation: 13

You can give the necessary permissions to any user you want. The error message indicates which permission is required. You will have to find the correct documentation for the version your using

– Ramhound – 2019-06-07T15:18:38.173

Thx for your reply and sry for the late response. The thing is: I can't find any reference which points me to Optionmanager-VpxSettings. The docs you linked are for vSphere 4/4.1. We use vSphere 6.5.0. – Malte – 2019-06-11T12:24:14.950

Answers

0

I think you might be hitting some known issue. Any chance you are using PowerCLI 11.2? https://communities.vmware.com/thread/606971 I am not familiar with otionmanager, but i bet this stands on the ROOT object(the optionmanager). You will not see those managers in your vsphere client / webclient though. So one way of doing this is to add this permission to the ROOT/(Virtual center node) and select do not propagate. Then on the particular vm add the same permission. IF you don't want to use that, you might want to downgrade your powerCLI to a different version and check if it works.

Gregu

Posted 2019-06-07T07:56:56.920

Reputation: 26

That was it. Now the problem is gone. – Malte – 2019-09-11T07:42:09.873