Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:31:35+00:00 2026-06-04T09:31:35+00:00

I have been trying to write a powershell program that checks to see if

  • 0

I have been trying to write a powershell program that checks to see if a cluster exists. If it doesn’t then it creates it and adds itself to it.
If another computer wakes up, it checks to see if the cluster exists and if it does, then it adds itself to the cluster.

I’m having trouble trying to get a reference to the cluster object from the cluster ip address. Every node knows its address and the cluster address. I want to avoid every node having a list of all the other nodes in its cluster.

I’m finding that I need to sight the non-cluster ip address to get-nlbcluster to work. Specifying the cluster ip address just errors.

Is there any way I can do this, without having to update this list on every node each time I add or remove nodes from the cluster. I suppose I also want to avoid the situation where a node wakes up and has to poll each of the machines in the “master” list looking for one that is up in order to add itself to the cluster.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:31:36+00:00Added an answer on June 4, 2026 at 9:31 am

    The following script can be run on all nodes in your cluster, if the cluster doesn’t exist then create it, otherwise just add the current computer to the existing cluster. All you need to do is ensure that all your computers in the cluster have a dedicated card with the same name. In the example below the network card is named ‘NLB’.

    Import-Module ServerManager
    
    # Interface cards should be named the same and have a fixed IP
    $interfaceName = "NLB"
    $clusterName = "NLB-Cluster"
    $clusterIpAddress = "1.2.3.0"
    $clusterSubnet = "255.0.0.0"
    
    # Install Network Load Balancing and Tools
    Write-Host "Install Network Load Balancing and Tools"
    Add-WindowsFeature NLB, RSAT-NLB
    Import-Module NetworkLoadBalancingClusters
    
    # If the cluster hasn't been created yet then create it
    if (!(Get-NlbCluster -HostName $clusterIpAddress -ErrorAction SilentlyContinue))
    {
        Write-Host "Creating NLB Cluster: $clusterName" -ForegroundColor yellow 
    
        # Create Cluster (default unicast)
        New-NlbCluster -InterfaceName $interfaceName -ClusterName $clusterName -ClusterPrimaryIP $clusterIpAddress -SubnetMask $clusterSubnet 
    
        # Remove defaults
        Write-Host "Removing default port rules" -ForegroundColor yellow 
        Get-NlbClusterPortRule | Remove-NlbClusterPortRule -Force
    
        # Create port rules
        Get-NlbCluster | Add-NlbClusterPortRule -StartPort 80 -EndPort 80 -Protocol TCP -Affinity None | Out-Null
        Get-NlbCluster | Add-NlbClusterPortRule -StartPort 443 -EndPort 443 -Protocol TCP -Affinity None | Out-Null 
    }
    else
    {
        Get-NlbCluster 
    }
    
    # if this node isn't already a member of a cluster then add it
    if(!(Get-NlbClusterNode -HostName $env:COMPUTERNAME))
    {
        # Add node to cluster
        Write-Host "Adding node to cluster: $clusterName" -ForegroundColor yellow 
        Get-NlbCluster -HostName $clusterIpAddress | Add-NlbClusterNode -NewNodeName $env:COMPUTERNAME -NewNodeInterface $interfaceName
    }
    else
    {
        Get-NlbClusterNode
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to write some applescript that checks to see if the
I have been trying to write a regex that will remove whitespace following a
I have been trying to write a set of htaccess rules that will do
I have been trying to write an app that periodically parses the contents of
Hii , I have been trying to write a program... We have a structure
I've been trying to write a program in R that implements Newton's method. I've
I have been trying to write some code that asks the user for several
I have been trying to write a script that may help me to comment
I have been trying to write a C program which generates all possible permutations
I have been trying to write a program to convert my father's old PTS.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.