VMware Cloud Community
VMMikeC
Enthusiast
Enthusiast
Jump to solution

View PowerCLI no longer working

I don't know what happened, but I have two VMware View connection servers and we can't run any cli commands anymore that are related to View. I can run simple commands such as Get-Date and they work, but if I try any of the View specific commands, I get

PS C:\Windows\system32> Get-Pool

Get-Pool : Object reference not set to an instance of an object.

At line:1 char:9

+ Get-Pool <<<<

    + CategoryInfo          : NotSpecified: (:) [Get-Pool], NullReferenceExcep

   tion

    + FullyQualifiedErrorId : System.NullReferenceException,vmware.view.powers

   hell.cmdlets.GetPool

Have a ticket with support, but after spending a few hours, still don't have a solution

Reply
0 Kudos
1 Solution

Accepted Solutions
VMMikeC
Enthusiast
Enthusiast
Jump to solution

I was able to get it working. The fix was simply shut down all the Connection Servers, restart vCenter, and then start the connection servers back up. So weird, but it worked. I'm not complaining Smiley Happy

Eco thanks for all the assistance

View solution in original post

Reply
0 Kudos
8 Replies
EKardinal
Enthusiast
Enthusiast
Jump to solution

Hi,

Try to run this command in a normal powershell session (don't use the ViewCLI Shortcut):

Add-PSSnapin "VMware.View.Broker"

Do you see any errors? If not, have you already reinstalled the ViewCLI?

Are there any additional commands in your Profile.ps1?

Windows PowerShell Profiles

Regards

Emanuel

VMMikeC
Enthusiast
Enthusiast
Jump to solution

I can add that snap-in without a problem but when I run any ViewCLI command, I get

PS C:\Users\admin> get-pool

Get-Pool : Object reference not set to an instance of an object.

At line:1 char:9

+ get-pool <<<<

    + CategoryInfo          : NotSpecified: (:) [Get-Pool], NullReferenceException

    + FullyQualifiedErrorId : System.NullReferenceException,vmware.view.powershell.cmdlets.GetPool

Reply
0 Kudos
VMMikeC
Enthusiast
Enthusiast
Jump to solution

also, I don't know how to reinstall View PowerCLI. I never installed it, it installed when I installed the View Connection server

The server knows about the cmdlets because I can get help on any View PowerCLI cmdlet


PS C:\Users\admin> Get-Help Get-Pool

NAME
    Get-Pool

SYNOPSIS
    Returns a list of Pools in this View environment


SYNTAX
    Get-Pool [-Pool_id [<string>]] [-DisplayName [<string>]] [-Description [<string>]] [-Enabled [<string>]] [-Protocol
     [<string>]] [-VcServerName [<string>]] [-PoolType [<string>]] [<CommonParameters>]


DESCRIPTION

RELATED LINKS

REMARKS
    To see the examples, type: "get-help Get-Pool -examples".
    For more information, type: "get-help Get-Pool -detailed".
    For technical information, type: "get-help Get-Pool -full".

Reply
0 Kudos
EKardinal
Enthusiast
Enthusiast
Jump to solution

To uninstall the PowerCLI View Snapin, run the following PowerShell script

"%programfiles%\VMware\VMware View\Server\extras\PowerShell\uninstall-snapin.ps1"

and after that, the add-snapin.ps1 in the same directory to reinstall it.

Could you also fire the Get-Pool command once again and directly after the following and post the output

$Error[0].Exception | Select-Object -Property *

VMMikeC
Enthusiast
Enthusiast
Jump to solution

uninstall and reinstall didnt help.

Here is the output

PS C:\Program Files\VMware\VMware View\Server\bin> $Error[0].Exception | Select-
Object -Property *


Message        : Object reference not set to an instance of an object.
Data           : {}
InnerException :
TargetSite     : System.String getErrorText()
StackTrace     :    at vmware.view.mfw.PropertyBag.getErrorText()
                    at vmware.view.powershell.cmdlets.ViewCmdlet.sendRequest(St
                 ring hint, PropertyBag Params, PropertyBag Response)
                    at vmware.view.powershell.cmdlets.GetPool.BeginProcessing()
                    at System.Management.Automation.Cmdlet.DoBeginProcessing()
                    at System.Management.Automation.CommandProcessorBase.DoBegi
                 n()
HelpLink       :
Source         : cs_mfwapi

Reply
0 Kudos
VMMikeC
Enthusiast
Enthusiast
Jump to solution

I was able to get it working. The fix was simply shut down all the Connection Servers, restart vCenter, and then start the connection servers back up. So weird, but it worked. I'm not complaining Smiley Happy

Eco thanks for all the assistance

Reply
0 Kudos
EKardinal
Enthusiast
Enthusiast
Jump to solution

I'm glad to hear that, because I had no additional idea anymore. Smiley Happy

Just for interest, did VMware knew some solution or why this was happen?

Reply
0 Kudos
VMMikeC
Enthusiast
Enthusiast
Jump to solution

Nope, VMware just told me to power everything down and power it back up.

They think the View Connection servers were out of sync with vCenter. I don't understand that, but as long as it works Smiley Happy

Reply
0 Kudos