VMware Cloud Community
brosy
Contributor
Contributor

PowerCli 6.3 R1 not returning any results

Working (VMware-PowerCLI-6.0.0-3205540.exe)

Add-Pssnapin - name vmware*

Connect-VIServer <vcenter name> -Credential (Get-Credential)

Get-VM

Not Working (VMware-PowerCLI-6.3.0-3737840.exe)

Add-Pssnapin - name vmware*

Connect-VIServer <vcenter name> -Credential (Get-Credential)

Get-VM

Running on 2012r2

Have tried reinstalling but not working. If i revert to older version it works

Have also tried to console icon and it initializes correctly but no results

Any ideas?

Damian

0 Kudos
10 Replies
RvdNieuwendijk
Leadership
Leadership

VMware is in the transition of moving PowerCLI from snapins to modules. You can try to add the following command after the Add-Pssnapin command:

Get-Module -Name vmware.* -ListAvailable | Import-Module

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
LucD
Leadership
Leadership

Depends which cmdlets you are trying to use.

The ones in your text (Connect-VIserver and Get-VM) should work after adding the PSSnapin like you did.

Adding the PSSnapin, should automatically load the corresponding modules as well.

Note, this does not load all PowerCLI modules !

For those you need to do the explicit Import-Module, as shown in the other reply.

See my short sample session.

pssnap.jpg

But it depends on your PowerShell version as well.

Which one are you using ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ChrisNewell
Contributor
Contributor

I believe we are seeing the same issue.

When a user connects using the 6.3 R1 version of PowerCLI and use get-vm, it returns no results. This only occurs for users which are given access to sub-folders and not the root vCenter.

If the user is given read-only access to the root of the vCenter, then the command will work. I didn't troubleshoot any further than this.

Seems like a bug in the new/updated get-vm command. I tried to log an SR for this issue, but GSS advised that SDK support is required for any issue related to PowerCLI, so i can't even log a bug report.

0 Kudos
brosy
Contributor
Contributor

Hi LucD,

I'm using Powershell 5.0.10586.117 (2012R2 version number different to Win10)

I've also tried windows 10 (5.0.10586.122) and get same result.

After reviewing ChrisNewell's post on here its the same problem i'm having.

Read access on root seems to resolve this when connecting to VCenter

I don't have SDK support with VMware so also cannot take this any further. I will have to revert versions until VMware look into it or someone with SDK support logs ticket

Thanks for your help

regards,

Damian

0 Kudos
LucD
Leadership
Leadership

Strange, earlier you stated that PowerCLI 6 was working ?

And note that Windows 10 is only supported quite recently, so definitely not for PowerCLI 5.x


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
brosy
Contributor
Contributor

powercli 6.0 is working, i'm having a problem with powercli 6.3 as mentioned in first post

I am a limited user in vcenter so i don't have read access to root and this seems to cause the problem with 6.3

in the previous post i mentioned powershell versions i was testing on.

hope that is more clear

0 Kudos
LucD
Leadership
Leadership

Ok, I forwarded the question to the PowerCLI Team, let's see what they have say about this assumption.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
brosy
Contributor
Contributor

Hi LucD

Did you get a chance to discuss with VMware? 

0 Kudos
LucD
Leadership
Leadership

I will ask again to have a look at this thread.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
GalNeb
Enthusiast
Enthusiast

The answer is to add a permission for the user at the vCenter level. It can be just a read-only permission.  This has still not been fixed in 6.5 R1.

Old enough to know better, young enough to try anyway
0 Kudos