none
Failover cluster script RRS feed

  • Question

  • we use a bat to failover cluster...

    cluster.exe clustername group
    pause
    cluster.exe clustername group "MSDTC" /move
    pause
    cluster.exe clustername group "cluster group" /move
    pause
    cluster.exe clustername group "SQLSERVER" /move

    This was with 2008r2.....  I guess in Microsoft 2012r2 they want you to use powershell.. Can I make this into powershell script?

    Thursday, April 2, 2015 6:04 PM

Answers

All replies

  • Please see the following documentation on PowerShell failover cluster cmdlets available in Windows Server 2012 R2

    https://technet.microsoft.com/en-us/library/hh847239.aspx


    Steven Hodson | http://www.stevenhodson.com | @_hodders

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This posting is provided "AS IS" with no warranties, and confers no rights.


    Thursday, April 2, 2015 6:10 PM
  • You can quickly find the answer to this all by yourself by using a search engine.

    http://www.bing.com/search?q=failover+cluster+powershell

    Note that the documentation link posted by the previous two respondents is one of the search results.


    -- Bill Stewart [Bill_Stewart]


    Thursday, April 2, 2015 6:16 PM
    Moderator
  • Well thanks for that Bill.... Why didn't I think of that!!!!!
    Thursday, April 2, 2015 6:24 PM
  • Thanks you and Steve.

    I came across that before searching but I am not/wasn't sure if you could save a powershell as a "bat" type of file and my searches on this have not been really helpful at least how to do it (which I assumed you could). Everything I have read has really been confusing. Obviously I have not messed with powershell before.

    Thursday, April 2, 2015 6:29 PM
  • Thanks you and Steve.

    I came across that before searching but I am not/wasn't sure if you could save a powershell as a "bat" type of file and my searches on this have not been really helpful at least how to do it (which I assumed you could). Everything I have read has really been confusing. Obviously I have not messed with powershell before.

    PowerShell scripts use a ps1 extension. There's very good starting material here:

    http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx


    Don't retire TechNet! - (Don't give up yet - 13,225+ strong and growing)

    • Marked as answer by David-71 Thursday, April 2, 2015 6:58 PM
    Thursday, April 2, 2015 6:37 PM
  • You need to save the script with a .ps1 extension

    This link will take you to some videos on learning powershell scripting https://technet.microsoft.com/en-us/scriptcenter/powershell.aspx


    Steven Hodson | http://www.stevenhodson.com | @_hodders

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This posting is provided "AS IS" with no warranties, and confers no rights.


    • Edited by Steven Hodson Thursday, April 2, 2015 6:41 PM
    • Marked as answer by David-71 Thursday, April 2, 2015 6:58 PM
    Thursday, April 2, 2015 6:40 PM
  • Thanks both you and Mike...
    Thursday, April 2, 2015 6:57 PM
  • With PowerShell, there is no need to create a cmd.exe shell script (batch file).

    A PowerShell script is a text file with a .ps1 extension that PowerShell runs.


    -- Bill Stewart [Bill_Stewart]

    Thursday, April 2, 2015 6:58 PM
    Moderator
  • Thanks again Steve and Mike. Those videos should be very helpful in the future... Obviously this was an easy thing once I knew you could do a powershell as ps1..... For my issue it was....

     

    Get-cluster clustername

    pause

    Move-ClusterGroup "MSDTC"

    pause

    Move-ClusterGroup "cluster group"

    pause

    Move-ClusterGroup "SQL SERVER (MSSQLSERVER)"

    Save as .ps1 and we are off to the races... Also this was a very helpful page to go from command to pwrshell.

      https://technet.microsoft.com/en-us/library/ee619744(v=ws.10).aspx 

    As it was a very easy page to follow along.  Thanks again...


    Thursday, April 2, 2015 7:56 PM
  • Thanks again Steve and Mike. Those videos should be very helpful in the future... Obviously this was an easy thing once I knew you could do a powershell as ps1..... For my issue it was....

     

    Get-cluster clustername

    pause

    Move-ClusterGroup "MSDTC"

    pause

    Move-ClusterGroup "cluster group"

    pause

    Move-ClusterGroup "SQL SERVER (MSSQLSERVER)"

    Save as .ps1 and we are off to the races... Also this was a very helpful page to go from command to pwrshell.

      https://technet.microsoft.com/en-us/library/ee619744(v=ws.10).aspx 

    As it was a very easy page to follow along.  Thanks again...


    Actually after playing around with this for a while, I think taking the first line out and replacing with

    Get-ClusterGroup  works nice because it will show you step by step with your pauses where the resources resides... I also added in

    Move-ClusterGroup  "available storage"

    I am really liking this powershell.....

     

    Thursday, April 2, 2015 9:44 PM