New-SBFarm

New-SBFarm

You can use this cmdlet to create a new Service Bus for Windows Server farm.

Syntax

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

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

Detailed Description

Run New-SBFarm to create a new Service Bus for Windows Server farm. This is the first step required for getting started with Service Bus for Windows Server. A Farm is a Service Bus for Windows Server configuration stored in a farm management database. It includes the settings required by Service Bus for Windows Server such as databases to use to store settings as well as messages, ports to use either externally with clients or internally between the hosts of the farm.

For the FarmCertificateThumbprint and EncryptionCertificateThumbprint (for SSL) parameters, the New-SBFarm cmdlet expects a string to be passed in which is the thumbprint of the certificate you wish to use. These parameters are needed if you plan to use your own certificates – the certificates must be present in the LocalMachine Cert Store before you call New-SBFarm.

If an error occurs or you are forced to reboot during farm creation, the databases that are created may be left in a corrupt state. In that case, when you try to join a farm, the process may display an error that says that the machine you are trying to add to the farm is not a part of any farm. When you encounter such an error, you must drop the databases and recreate them before you can join any new nodes to the farm.

You can create a Service Bus farm that is managed with the Windows Azure Pack management portal. To enable this configuration, you must specify the basic authentication settings between the Service Bus resource provider and the Windows Azure Pack portal. Those include settings for the admin API as well as the tenant API.

Parameters

-AdminApiCredentials<PSCredential>

Sets the resource provider credentials. 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

BUILTIN\Administrators

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.

For both the FarmCertificateThumbprint and EncryptionCertificateThumbprint (for SSL) parameters, the New-SBFarm cmdlet expects a string to be passed in which is the thumbprint of the certificate you wish to use.

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.

For both the FarmCertificateThumbprint and EncryptionCertificateThumbprint (for SSL) parameters, the New-SBFarm cmdlet expects a string to be passed in which is the thumbprint of the certificate you wish to use.

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

-GatewayDBConnectionString<String>

Represents a connection string of the gateway database. If not passed in will be created in the same SQL Server using SBFarmDBConnectionString with the default name of “SBGatewayDatabase”.

Aliases

none

Required?

false

Position?

named

Default Value

SBGatewayDatabase

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HttpsPort<Int32>

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

Aliases

none

Required?

false

Position?

named

Default Value

9355

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InternalPortRangeStart<Int32>

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

Aliases

none

Required?

false

Position?

named

Default Value

9000-004

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MessageBrokerPort<Int32>

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

Aliases

none

Required?

false

Position?

named

Default Value

9356

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MessageContainerDBConnectionString<String>

Represents a connection string of the message container. If not passed in will be created in the same SQL Server using SBFarmDBConnectionString with the default name of "SBMessageContainer01”.

Aliases

none

Required?

false

Position?

named

Default Value

SBMessageContainer01

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RPHttpsPort<Int32>

This optional parameter specifies the Resource Provider port setting. This port is used by the portal to access the Service Bus farm.

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

9354

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TenantApiCredentials<PSCredential>

Sets the resource provider credentials for the tenant portal. 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

<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

Create a new Service Bus for Windows Server farm with default settings. The farm will use the local host SQLExpress database and will create 3 databases (ManagementDB, GatewayDB and MessageContainer1).

PS C:\> $mycert=ConvertTo-SecureString -string myPassword1 -force –AsPlainText; New-SBFarm  -SBFarmDBConnectionString 'Data Source=localhost\sqlexpress;Integrated Security=True' -CertificateAutoGenerationKey $mycert

Example 2

Create a new Service Bus for Windows Server farm where management and gateway databases are placed on MySQLServer server and the initial message container database is placed on myDedicatedMessagingSQLServer server. The Service Bus for Windows Server services will run under the myServiceAccount domain account and admin permissions are given to the myAdminsGroup Active directory users group.

PS C:\> $mycert=ConvertTo-SecureString -string myPassword1 -force –AsPlainText; New-SBFarm -SBFarmDBConnectionString 'Data Source=mySQLServer;Integrated Security=True' –RunAsAccount myServiceAccount –AdminGroup myAdminsGroup –MessageContainerDBConnectionString 'Data Source=myDedicatedMessagingSQLServer;Integrated Security=True' –CertificateAutoGenerationKey $mycert

Service Bus 1.0 MSDN Community Forum