SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Enable-SqlAlwaysOn cmdlet used to enable AlwaysOn for a SQL Server service is failing


Enable-SqlAlwaysOn cmdlet used to enable AlwaysOn for a SQL Server service is failing

Author
Message
doodlingdba
doodlingdba
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2367 Visits: 733
Hi there
I am developing some PS scripts to set up an AlwaysOn availability group. I am trying to use the Enable-SqlAlwaysOn cmdlet to enable AlwaysOn on a remote server - I get a prompt saying 'You have to restart the SQL service in order for the change to take effect. Do you want to continue?' I click Yes but then get the following failure:

Enable-SqlAlwaysOn : ChangeHADRService failed for Service 'MSSQL$MyInstance_TEST'.
At line:1 char:1
+ Enable-SqlAlwaysOn -Path SQLSERVER:\SQL\MyServer\MyInstance_TEST
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Smile [Enable-SqlAlwaysOn], FailedOperationException
+ FullyQualifiedErrorId : Microsoft.SqlServer.Management.Smo.FailedOperationException,Microsoft.SqlServer.Management.PowerShell.Hadr.EnableSqlHADRServiceCommand

Anyone experienced this or has any thoughts?

Thanks Smile
doodlingdba
doodlingdba
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2367 Visits: 733
I've discovered why I get the error: it's because the server i was testing on wasn't configured in a windows failover cluster - doh! Once the server is a participant in a cluster (a pre-req for AlwaysOn), this cmdlet works.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search