New-Cluster : Cannot convert 'IP address' to the type & 'System.Collections.Specialized.StringCollection&' required by parameter &'StaticAddress'.

surindersingh dhaliwal 81 Reputation points
2021-04-02T16:33:31.313+00:00

I am creating the cluster with the powershell scripting
Install-Windowsfeature -name Failover-Clustering -IncludeAllSubFeature -IncludeManagementTools -verbose
$Clustername=Read-Host "What is the Failover Cluster Name "
$ClusterIP=Read-host "What is the Failover Cluster IP"
$Hostname=[System.Net.Dns]::GetHostName()
New-Cluster -Name $Clustername -Node $Hostname -StaticAddress $ClusterIP

But when it comes to execute the last command it gives the below error
New-Cluster : Cannot convert '192.168.155.196' to the type 'System.Collections.Specialized.StringCollection' required by parameter 'StaticAddress'. Unable to cast object of type 'System.Net.IPAddress' to type 'System.String'

Please help me on this i am struggling to rid off this issue since long.

Windows Server Clustering
Windows Server Clustering
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Clustering: The grouping of multiple servers in a way that allows them to appear to be a single unit to client computers on a network. Clustering is a means of increasing network capacity, providing live backup in case one of the servers fails, and improving data security.
956 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,486 Reputation points Microsoft Vendor
    2021-04-05T02:41:05.177+00:00

    Hi,

    The type of $ClusterIP is System.Net.IPAddress and it has to be System.String.

    $Clustername=Read-Host "What is the Failover Cluster Name "  
    [string]$ClusterIP=Read-host "What is the Failover Cluster IP"  
    $Hostname=[System.Net.Dns]::GetHostName()  
    New-Cluster -Name $Clustername -Node $Hostname -StaticAddress $ClusterIP  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful