commands

^

New-DbaConnectionStringBuilder

Author zippy1981 , Chrissy LeMaire (@cl)
Availability Windows, Linux, macOS

 

Synopsis

Returns a System.Data.SqlClient.SqlConnectionStringBuilder with the string specified

Description

Creates a System.Data.SqlClient.SqlConnectionStringBuilder from a connection string.

Syntax

New-DbaConnectionStringBuilder
    [[-ConnectionString] <String[]>]
    [[-ApplicationName] <String>]
    [[-DataSource] <String>]
    [[-InitialCatalog] <String>]
    [[-IntegratedSecurity] <Nullable`1>]
    [[-UserName] <String>]
    [[-Password] <String>]
    [-MultipleActiveResultSets]
    [[-ColumnEncryptionSetting] {Disabled | Enabled}]
    [[-WorkstationId] <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> New-DbaConnectionStringBuilder

Returns an empty ConnectionStringBuilder

Example: 2
PS C:\> "Data Source=localhost,1433;Initial Catalog=AlwaysEncryptedSample;UID=sa;PWD=alwaysB3Encrypt1ng;Application Name=Always Encrypted Sample MVC App;Column Encryption Setting=enabled" |

New-DbaConnectionStringBuilder
Returns a connection string builder that can be used to connect to the local sql server instance on the default port.

Optional Parameters

-ConnectionString

A Connection String

Alias
Required False
Pipeline true (ByValue)
Default Value
-ApplicationName

The application name to tell SQL Server the connection is associated with.

Alias
Required False
Pipeline false
Default Value dbatools Powershell Module
-DataSource

The Sql Server to connect to.

Alias
Required False
Pipeline false
Default Value
-InitialCatalog

The initial database on the server to connect to.

Alias
Required False
Pipeline false
Default Value
-IntegratedSecurity

Set to true to use windows authentication.

Alias
Required False
Pipeline false
Default Value
-UserName

Sql User Name to connect with.

Alias
Required False
Pipeline false
Default Value
-Password

Password to use to connect with.

Alias
Required False
Pipeline false
Default Value
-MultipleActiveResultSets

Enable Multiple Active Result Sets.

Alias MARS
Required False
Pipeline false
Default Value False
-ColumnEncryptionSetting

Enable Always Encrypted.

Alias AlwaysEncrypted
Required False
Pipeline false
Default Value Enabled
-WorkstationId

Set the Workstation Id that is associated with the connection.

Alias
Required False
Pipeline false
Default Value $env:COMPUTERNAME
-WhatIf

If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.

Alias wi
Required False
Pipeline false
Default Value
-Confirm

If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.

Alias cf
Required False
Pipeline false
Default Value

 

Want to see the source code for this command? Check out New-DbaConnectionStringBuilder on GitHub.
Want to see the Bill Of Health for this command? Check out New-DbaConnectionStringBuilder.