Look at line #14 in the code you posted:
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameterWrite-Host
Remove the trailing "Write-Host" from that line.
Also check lines 18, 19, 21,25, and 26 for mistakes.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi All
I am following the below article to add a probe port, i am getting the error, experts correct me with the script.
$ProbePort = 12345
$ClusterRoleName = "SAPRole"
$IPResourceName = "SAP IP" # the IP Address resource name
$ListenerILBIP = "192.168.10.5"
$IPResourceClusterParameters = Get-ClusterResource $IPresourceName | Get-ClusterParameter
$IPAddress = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Address" }).Value
$NetworkName = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Network" }).Value
$SubnetMask = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "SubnetMask" }).Value
$OverrideAddressMatch = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "OverrideAddressMatch" }).Value
$EnableDhcp = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "EnableDhcp" }).Value
$OldProbePort = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "ProbePort" }).Value
$var = Get-ClusterResource | Where-Object { $_.name -eq $IPresourceName }
Write-Host "Current configuration parameters for SAP IP cluster resource '$IPresourceName' are:" -ForegroundColor Cyan
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameterWrite-Host
Write-Host "Current probe port property of the SAP cluster resource '$IPresourceName' is '$OldProbePort'." -ForegroundColor Cyan
Write-Host
Write-Host "Setting the new probe port property of the SAP cluster resource '$IPresourceName' to '$ProbePort' ..." -ForegroundColor Cyan
Write-Host$var | Set-ClusterParameter -Multiple @{"Address"=$IPAddress;"ProbePort"=$ProbePort;"Subnetmask"=$SubnetMask;"Network"=$NetworkName;"OverrideAddressMatch"=$OverrideAddressMatch;"EnableDhcp"=$EnableDhcp}
Write-Host$ActivateChanges = Read-Host "Do you want to take restart SAP cluster role '$ClusterRoleName', to activate the changes (yes/no)?"if($ActivateChanges -eq "yes"){
Write-Host
Write-Host "Activating changes..." -ForegroundColor CyanWrite-Host
write-host "Taking SAP cluster IP resource '$IPresourceName' offline ..." -ForegroundColor Cyan
Stop-ClusterResource -Name $IPresourceName
sleep 5Write-Host "Starting SAP cluster role '$ClusterRoleName' ..." -ForegroundColor Cyan
Start-ClusterGroup -Name $ClusterRoleNameWrite-Host "New ProbePort parameter is active." -ForegroundColor Green
Write-HostWrite-Host "New configuration parameters for SAP IP cluster resource '$IPresourceName':" -ForegroundColor Cyan
Write-Host
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameter
}else
{
Write-Host "Changes are not activated."
}
Where-Object : A positional parameter cannot be found that accepts argument 'Write-Host'.
At line:12 char:30
Get-ClusterParameterWrite-Host : The term 'Get-ClusterParameterWrite-Host' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:13 char:45
Current probe port property of the SAP cluster resource 'SAP IP' is '0'.
Setting the new probe port property of the SAP cluster resource 'SAP IP' to '12345' ...
Write-Host$var : The term 'Write-Host$var' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:17 char:1
Write-Host "Changes are not activated."
Look at line #14 in the code you posted:
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameterWrite-Host
Remove the trailing "Write-Host" from that line.
Also check lines 18, 19, 21,25, and 26 for mistakes.
i have modified the script but still the probe port is not listening
$ProbePort = 12345
$ClusterRoleName = "SAPRole"
$IPResourceName = "SAP IP" # the IP Address resource name
$ListenerILBIP = "192.168.10.5"
$IPResourceClusterParameters = Get-ClusterResource $IPresourceName | Get-ClusterParameter
$IPAddress = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Address" }).Value
$NetworkName = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "Network" }).Value
$SubnetMask = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "SubnetMask" }).Value
$OverrideAddressMatch = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "OverrideAddressMatch" }).Value
$EnableDhcp = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "EnableDhcp" }).Value
$OldProbePort = ($IPResourceClusterParameters | Where-Object {$_.Name -eq "ProbePort" }).Value
$var = Get-ClusterResource | Where-Object { $_.name -eq $IPresourceName }Write-Host "Current configuration parameters for SAP IP cluster resource '$IPresourceName' are:" -ForegroundColor Cyan
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameter
Write-Host "Current probe port property of the SAP cluster resource '$IPresourceName' is '$OldProbePort'." -ForegroundColor Cyan
Write-Host "Setting the new probe port property of the SAP cluster resource '$IPresourceName' to '$ProbePort' ..." -ForegroundColor Cyan
Write-Host $var | Set-ClusterParameter -Multiple @{"Address"=$IPAddress;"ProbePort"=$ProbePort;"Subnetmask"=$SubnetMask;"Network"=$NetworkName;"OverrideAddressMatch"=$OverrideAddressMatch;"EnableDhcp"=$EnableDhcp}
Write-Host $ActivateChanges = Read-Host "Do you want to take restart SAP cluster role '$ClusterRoleName', to activate the changes (yes/no)?"if($ActivateChanges -eq "yes"){
Write-Host "Activating changes..." -ForegroundColor Cyan
write-host "Taking SAP cluster IP resource '$IPresourceName' offline ..." -ForegroundColor Cyan
Stop-ClusterResource -Name $IPresourceName
sleep 5
Write-Host "Starting SAP cluster role '$ClusterRoleName' ..." -ForegroundColor Cyan
Start-ClusterGroup -Name $ClusterRoleName
Write-Host "New ProbePort parameter is active." -ForegroundColor Green
Write-HostWrite-Host "New configuration parameters for SAP IP cluster resource '$IPresourceName':" -ForegroundColor Cyan
Get-ClusterResource -Name $IPresourceName | Get-ClusterParameter
}else
{
Write-Host "Changes are not activated."
}