question

surindersinghdhaliwal-3529 avatar image
0 Votes"
surindersinghdhaliwal-3529 asked IanXue-MSFT rolled back

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

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-powershellwindows-server-clustering
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered IanXue-MSFT rolled back

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.