Solved

Powershell cmdlet Connect-PrismCentral is failing

  • 6 March 2024
  • 6 replies
  • 102 views

Userlevel 2
Badge +3

I am working on converting my scripts to Powershell 7.x. I tried to use the Nutanix cmdlets 2.0.1 provided for Prism Central. Attempting to connect to Prism Central is failing. Six months ago I played around with it and it worked then but now does not.

Our main Prism Central instance is pc.2023.1.0.2. We also have a test instance which is pc.2023.4. I get the same error when attempting to connect to either.

PS H:\Scripts\Nutanix> Connect-PrismCentral -Server MLBPRISMTST1.cs.myharris.net -Credential $AdminCred -AcceptInvalidSSLCerts
Connect-PrismCentral: Error from MLBPRISMTST1.cs.myharris.net: Could not connect. Please make sure to the remote server is Prism Central.
PS H:\Scripts\Nutanix> Connect-PrismCentral -Server MLBPRISMTST1.cs.myharris.net -Credential $AdminCred -AcceptInvalidSSLCerts -ForcedConnection
Connect-PrismCentral: Error from MLBPRISMTST1.cs.myharris.net: Could not connect. Please make sure to the remote server is Prism Central.

I am not encouraged by the Reddit post I found which shows the exact issue I am encountering: https://www.reddit.com/r/nutanix/comments/zelz8q/assistance_getting_nutanix_powershell_working/

I have a workaround, I have been using a REST API call to get the information I need (I currently connect to Prism Central to obtain a list of clusters). I was just trying to make use of the Nutanix provided cmdlets to make things a bit easier.

I just wondered if anyone has additional information on this issue or any resolutions.

Thank you.

icon

Best answer by TimGaray 6 March 2024, 18:21

View original

This topic has been closed for comments

6 replies

Userlevel 6
Badge +8

Are you 100% sure that MLBPRISMTST1.cs.myharris.net is pointing to the prism central ip? 

Here I screendump from me connecting to my pc:

 

Userlevel 2
Badge +3

Yes, I tried the IP address as well but get the same message.

 

From your screenshot, I see that both my PCs are newer versions.  It may be a case where it only works to older versions.  I need to look around in the environment and see if I can find an older one and test that hypothesis.

 

Userlevel 2
Badge +3

Maybe not.  I found one that is pc.2022.6.0.5 and get the same message connecting to that one as well.

 

Userlevel 2
Badge +3

Interesting update…

 

I just tried from a different machine and it worked fine.

Could Powershell version be an issue?  7.2.10 is what is installed on the machine that doesn’t work.

7.3.4 is what is installed on the machine that does work.

Maybe I will try and install an older version on another machine and see.

 

Userlevel 2
Badge +3

More interesting…

Not the version of Powershell.  I found two even older versions and it works just fine.

So now I am down to why doesn’t it work on this one particular machine (which of course is the one machine I am supposed to do all my work from)…  🙄

Userlevel 2
Badge +3

Ok - I quit!

Never mind…  I closed the PS7 window on this machine (that didn’t work before) and launched a new window and now it works just fine.

Must’ve had something messing it up from some previous work I was doing.

😁