VMware Cloud Community
hsimah
Contributor
Contributor

Connect-VIServer - Permission denied in latest verision

I am very impressed with the PowerCLI suite, very nice to use.

I have been running PowerCLI 6.0 Release 2 with no issues. I upgraded to PowerCLI 6.1 Release 1 on Friday and now I cannot connect to my host. Nothing has changed on the host side. If I use my other workstation which I did not upgrade, I can connect without issue.

Some sample code (this gets hard drive use and returns a CSV of the details):

Import-Module VMware.VimAutomation.Core

$VmHostName = "physical_host"

$VmGuestName = "vm_host"

$VmGuestUser = "Administrator"

$VmGuestPassword = (ConvertTo-SecureString -String "mypassword" -AsPlainText -Force)

Connect-VIServer -Server $VmHostName -Credential $(Get-Credential)

$GuestCommand = @"

Get-PSDrive -Name $($Drive -join ',') -PSProvider FileSystem | Select-Object Name,Used,Free | ConvertTo-Csv -NoTypeInformation

"@

$Output = Invoke-VMScript -VM $VmGuestName -GuestUser $VmGuestUser -GuestPassword $VmGuestPassword -ScriptText $GuestCommand | ConvertFrom-Csv

The error I receive is:

Connect-VIServer : Permission to perform this operation was denied.

At line:1 char:1

+ Connect-VIServer -Server $VmHostName -Credential $(Get-Credential ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Connect-VIServer], VimException

    + FullyQualifiedErrorId : VMware.Vim.VimException,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

Has something changed in PowerCLI? Do I need to be added to a permission group on the host or something? I'm not on the infrastructure team, so I will need to request specific access.

Thanks in advance.

Tags (1)
Reply
0 Kudos
1 Reply
hsimah
Contributor
Contributor

As I do not have the time or the access to the hosts I have rolled back to an earlier version of PowerCLI (6.0 R2). If anyone can help me I am happy to upgrade again.

Reply
0 Kudos