Set-WebSitesConnectionString

Sets a database connection string.

Syntax

Set-WebSitesConnectionString [-Type] <DatabaseType> [-ConnectionString] <String> [-Confirm]
 [-RemoteSettings <RemoteSettings>] [-SuppressRequestIdLine] [-WhatIf] [<CommonParameters>]

Description

The Set-WebSitesConnectionString cmdlet sets a database connection string for the specified database type.
You can set connection strings for either a hosting database or a metering database.

Examples

Example 1: Set a hosting database connection string

PS C:\> Set-WebSitesConnectionString -Type "Hosting" -ConnectionString "Data Source=CN-SERVER01;Initial Catalog=Hosting;User ID=Hosting_HostingAdmin;Password=Password01!"
This command modifies the connection string for the hosting database.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionString

Specifies a connection string for a hosting database.
Connection strings contain information about a data source and how to connect to it; this information includes such things as the server and database name, and the name and password of the user account making the connection.
For example:

-ConnectionString "Server=tcp:contosodb.database.windows.net;Database=Personel;User ID=admin@contoso.com;Password=p@ssw0rd;Trusted_Connection=False;Encrypt=True;"

Type:String
Required:True
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-RemoteSettings

{{Fill RemoteSettings Description}}

Type:RemoteSettings
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-SuppressRequestIdLine

{{Fill SuppressRequestIdLine Description}}

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Type

Specifies the database type.
Valid values are:

- Hosting
- Metering

For example:

-Type "Hosting"

Type:DatabaseType
Parameter Sets:Hosting, Metering
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False