Restore-SBFarm

Restore-SBFarm

You can use this cmdlet to recreate your Service Bus for Windows Server farm from recovered databases.

Syntax

Parameter Set: AutoCert
Restore-SBFarm -CertificateAutoGenerationKey <SecureString> -GatewayDBConnectionString <String> -SBFarmDBConnectionString <String> [-AdminApiCredentials <PSCredential> ] [-AdminGroup <String> ] [-AmqpPort <Int32> ] [-AmqpsPort <Int32> ] [-FarmDns <String> ] [-Force] [-HttpsPort <Int32> ] [-InternalPortRangeStart <Int32> ] [-MessageBrokerPort <Int32> ] [-RPHttpsPort <Int32> ] [-RunAsAccount <String> ] [-TcpPort <Int32> ] [-TenantApiCredentials <PSCredential> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CustomCert
Restore-SBFarm -FarmCertificateThumbprint <String> -GatewayDBConnectionString <String> -SBFarmDBConnectionString <String> [-AdminApiCredentials <PSCredential> ] [-AdminGroup <String> ] [-AmqpPort <Int32> ] [-AmqpsPort <Int32> ] [-EncryptionCertificateThumbprint <String> ] [-FarmDns <String> ] [-Force] [-HttpsPort <Int32> ] [-InternalPortRangeStart <Int32> ] [-MessageBrokerPort <Int32> ] [-RPHttpsPort <Int32> ] [-RunAsAccount <String> ] [-TcpPort <Int32> ] [-TenantApiCredentials <PSCredential> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Run Restore-SBFarm to recreate your farm configuration from the recovered databases. In a recovery scenario, you need to recover the Service Bus for Windows Server databases, a gateway as well as all message containers, in order to restore all the Service Bus for Windows Server entities such as queues and topics.

The farm configuration must be recreated by calling this cmdlet. This cmdlet is similar to the New-SBFarm cmdlet with the exception of reusing an existing gateway and containers (provided as parameters).

Parameters

-AdminApiCredentials<PSCredential>

Sets the resource provider credentials. If this parameter is omitted, the credentials are not set. The resource provider is a component that exposes the management API to the portal. There are two Service Bus management portals; the Admin portal (which provides a set of resource provider APIs for farm administration), and the Tenant portal (which is the Azure Management Portal). Use these credentials when you manually install the server farm and connect to the Admin portal.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AdminGroup<String>

Represents the admin group.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AmqpPort<Int32>

This optional parameter sets the AMQP port.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AmqpsPort<Int32>

This optional parameter sets the AMQP SSL port.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CertificateAutoGenerationKey<SecureString>

This passphrase is required for certificate auto generation. This parameter is mandatory if you want certificates to be auto generated.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EncryptionCertificateThumbprint<String>

This certificate is used for securing the SQL connection strings. If not provided, it will take the value of the SslCertificate. Represents the encryption certificate.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FarmCertificateThumbprint<String>

Represents the certificate that is used for securing the certificate. Do not provide this certificate if you are providing CertificateAutoGenerationKey for auto generation of certificates.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FarmDns<String>

The DNS prefix that is mapped to all server farm nodes. This cmdlet is used when an administrator registers a server farm. The server farm node value is returned when you call the Get-SBClientConfiguration cmdlet to request a connection string.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Specifies the force value.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-GatewayDBConnectionString<String>

Represents a connection string of the gateway database.

Aliases

none

Required?

true

Position?

named

Default Value

If not passed in will be created in the same SQL Server as SBFarmManagementdatabase with the default name of SBGatewayDatabase

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HttpsPort<Int32>

Represents the port that the Service Bus for Windows Server uses for the HTTPS communication.

Aliases

none

Required?

false

Position?

named

Default Value

12290

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InternalPortRangeStart<Int32>

Represents the start of the port range that the Service Bus for Windows Server uses for internal communication purposes.

Aliases

none

Required?

false

Position?

named

Default Value

9000-003

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MessageBrokerPort<Int32>

Represents the port that the Service Bus for Windows Server uses for the MessageBroker communication.

Aliases

none

Required?

false

Position?

named

Default Value

9356

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RPHttpsPort<Int32>

This optional parameter specifies the Resource Provider port setting.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsAccount<String>

Represents the account under which the service runs. This account must be a domain account.

Aliases

none

Required?

false

Position?

named

Default Value

The account under which configuration is run

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SBFarmDBConnectionString<String>

Represents a connection string of the Service Bus for Windows Server database.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TcpPort<Int32>

Represents the port that the Service Bus for Windows Server uses for TCP.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TenantApiCredentials<PSCredential>

Sets the resource provider credentials for the tenant portal. If this parameter is omitted, the credentials are not set.The resource provider is a component that exposes the management API to the portal. There are two Service Bus management portals; the Admin portal (which provides a set of resource provider APIs for farm administration), and the Tenant portal (which is the Azure Management Portal). Use these credentials when you manually install the server farm and connect to the tenant portal.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1

Recreate your Service Bus for Windows Server farm from recovered databases.

PS C:\> $CertKey=convertto-securestring ‘CertificatePassword’ -asplaintext -force; Restore-SBFarm -GatewayDBConnectionString 'Data Source=SqlServerName;Initial Catalog=SbGatewayDatabase;Integrated Security=True' -SBFarmDBConnectionString 'Data Source=SqlServerName;Initial Catalog=RecoverSbManagementDB;Integrated Security=True' -CertificateAutoGenerationKey $CertKey

Service Bus 1.0 MSDN Community Forum