We'd like to use PowerCLI to do some serious automations. We do *not* have *full* admin access to vCenter server or the ESX hosts. So far the privileges we are given allow us to spin new VMs from templates in vSphere Client. We can also delete VMs and change some VM settings etc. With PowerCLI, we are able to run most of the cmdlets without any issue, such as generating reports, create folders, move VMs... etc. But with the following cmdlets, we got no return object, or errors, or permission denied/not allowed. However, someone with *full* admin privilege is able to execute them without any issues. Could someone let me know what permissions are required to run those cmdlets without using the full admin account?
We use both PowerCLI v5 and PowerCLI v4. Here is the info:
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.1 Release 1 build 793510
---------------
Snapin Versions
---------------
VMWare AutoDeploy PowerCLI Component 5.1 build 768137
VMWare ImageBuilder PowerCLI Component 5.1 build 768137
VMware License PowerCLI Component 5.1 build 669840
VMware vSphere PowerCLI Component 5.1 build 793489
PowerCLI Version
----------------
VMware vSphere PowerCLI 4.1 U1 build 332441
---------------
Snapin Versions
---------------
VMWare vSphere PowerCLI 4.1 U1 build 332441
o Get-Datastore
- PowerCLI v4: I can successfully retrieve all the datastore with my account.
- PowerCLI v5: Get-Datastore returns null - same account same datacenter.
Full admin has no issue with this cmdlet using either v4 or v5.
o Set-OSCustomizationSpec
We tried to use this cmdlet to set the timezone for a Redhat Linux. We got the following error with both v4 and v5.
---
Set-OSCustomizationSpec : 12/31/2012 3:13:26 PM Set-OSCustomizationSpec
Cannot update the OS customization spec with OsType 'Linux' with parameters
from the 'Windows' parameter set.
---
o Set-OSCustomizationNicMapping
We tried to use this to set static IP address, netmask, and default gateway. We got operations denied in both v4
and v5. We have no issue with Get-OSCustomizationNicMapping cmdlet.
Full admin is able to run Set-OSCustomizationNicMapping without any error.
o Invoke-VMScript
- PowerCLI v5: I can run basic Unix commands, e.g. ps, grep .. etc. with root credentials, no host credentials.
If I run some application related command, e.g. ITCM caf command, I got "Initialization failed."
- PowerCLI v4: I cannot even run the same basic Unix commands. I always got permissions denied.
We would like to stick with PowerCLI 5 if it is all possible. Thanks!