PowerShell Quick-Cluster-Connect Script


Userlevel 3
Badge +11
Hi,

I just wanted to post this small quick-cluster-connect script. Maybe its of use for anyone.

Usage

  1. Install the Nutanix CMDlets from the PRISM console in the Admin section.
  2. copy & paste the below code into a TXT file.
  3. Change the file extension to .PS1
  4. Edit the file and type in your Nutanix Cluster IP
  5. Run the script.
code:

# Quick Connect to Nutanix Cluster

# loading Nutanix PowerShell SnapIns
Add-PSSnapin NutanixCmdletsPSSnapin

# Cluster IP
$server = 'Your NTNX CLUSTER IP'

# Request & Verify credentials
$credentials = Get-Credential -Message "**Enter your Nutanix Admin credentials here**"

$username = $credentials.username
$password = ConvertTo-SecureString $($credentials.GetNetworkCredential().password) -AsPlainText -Force

write-host "Connecting to Cluster..."
Connect-NTNXCluster -Server $server -UserName $UserName -Password $password -AcceptInvalidSSLCerts -ForcedConnection
write-host "Done!"



HINT: If you have issues installing the CMDlets. I worte a post about that here.

Regards

Christian

Reply