locked
Get-Clusternode using Role IP address for a remote cluster RRS feed

  • Question

  • Is there a way to get cluster nodes of a remote cluster using role IP address with powershell cmdlets in a single line.

    Please advice!! I have a to execute this one line command to get cluster nodes. For ex: 

    powershell.exe (Get-ClusterNode).Nodename

    returns:

    CN33
    CN34
    CN44
    CN45

    Above are node names in the local cluster.

    Thanks for help!!

    Thanks,

    Surabhi


    Surabhi

    Friday, July 3, 2020 9:06 AM

All replies

  • Well, the help for this cmdlet shows you how to do that.

    help get-clusternode

    See Example 2


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Friday, July 3, 2020 2:56 PM
  • Try below:

    (Get-ClusterNode -Cluster "remoteclustername").Name

    Friday, July 3, 2020 3:08 PM
  • Hi,
    As this thread has been quiet for a while, so here is a quick question.Was your issue resolved? 
    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.
    Best Regards,
    Yang Yang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, July 6, 2020 1:40 AM
  • Hi,
    As this thread has been quiet for a while, so here is a quick question.Was your issue resolved? 
    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.
    Best Regards,
    Yang Yang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Please refrain from these posts.  You are not a moderator and the original post is two days old.  Since this is a holiday weekend your insistence that it is an old post is quite strange.

    Your company likely sent you here to learn and not to play like you know PowerShell.  You are not an experienced admin or PowerShell user so you are just adding noise.

    Read the topics and learn what is happening and learn how PowerShell is used.  Over time you will learn much.  Pasting your repeated comments serves no purpose.  Users frequently abandon questions or may take a week or more to return due to work priorities or vacations./


    \_(ツ)_/

    Monday, July 6, 2020 3:29 AM
  • Hello,

    The cmdlet below needs clustername. I don't have the clustername, I only have the VirtualIP of a role running on a remote cluster. Is there a way to figure out clusternodes using Role VIP?

    Thanks,

    Surabhi


    Surabhi

    Monday, July 6, 2020 9:24 AM
  • Try this, put your Cluster VIP in the below code and it should list you the cluster nodes.

    $clustername = (Get-cluster -Name 1.1.1.1).Name
    (Get-ClusterNode -Cluster $clustername).Name

    Wednesday, July 8, 2020 3:38 PM
  • Try this, put your Cluster VIP in the below code and it should list you the cluster nodes.

    $clustername = (Get-cluster -Name 1.1.1.1).Name
    (Get-ClusterNode -Cluster $clustername).Name

    And if you have bunch of VIPs and want to get the node details, you can try below code:

    Just put the VIPs in a text file, give the path to it and it should list you the ClusterName and its Node name as well.

    $Ips = Get-Content C:\temp\IPs.txt
    foreach ($ip in $ips)
    {
    $clustername = (Get-cluster -Name $Ip).Name
    Get-ClusterNode -Cluster $clustername | Select @{l='NodeName';e={$_.Nodename}},
    @{l='ClusterName';e={$_.Cluster}}
    
    }



    Wednesday, July 8, 2020 3:50 PM