Powershell cmdlet Connect-PrismCentral is failing | Nutanix Community
Skip to main content

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.

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:

 


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.

 


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

 


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.

 


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)…  🙄


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.

😁