Freigeben über


Set-SqlAuthenticationMode

Configures the authentication mode of the target instance of SQL Server.

Syntax

ByPath (Standardwert)

Set-SqlAuthenticationMode
    [-Mode] <ServerLoginMode>
    [[-SqlCredential] <PSCredential>]
    [-Credential] <PSCredential>
    [-ForceServiceRestart]
    [-NoServiceRestart]
    [-Path <String[]>]
    [-AutomaticallyAcceptUntrustedCertificates]
    [-ManagementPublicPort <Int32>]
    [-RetryTimeout <Int32>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObject

Set-SqlAuthenticationMode
    [-Mode] <ServerLoginMode>
    [[-SqlCredential] <PSCredential>]
    [-Credential] <PSCredential>
    -InputObject <Server[]>
    [-ForceServiceRestart]
    [-NoServiceRestart]
    [-AutomaticallyAcceptUntrustedCertificates]
    [-ManagementPublicPort <Int32>]
    [-RetryTimeout <Int32>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByName

Set-SqlAuthenticationMode
    [-Mode] <ServerLoginMode>
    [[-SqlCredential] <PSCredential>]
    [-Credential] <PSCredential>
    -ServerInstance <String[]>
    [-ForceServiceRestart]
    [-NoServiceRestart]
    [-AutomaticallyAcceptUntrustedCertificates]
    [-ManagementPublicPort <Int32>]
    [-RetryTimeout <Int32>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Beschreibung

The Set-SqlAuthenticationMode cmdlet configures the authentication mode of the target instance of SQL Server.

SQL ServerCloud Adapter must be running and accessible on the computer that hosts the instance of SQL Server.

This cmdlet supports the following modes of operation:

  • Specify the instance Windows PowerShell path.
  • Specify the server object.
  • Specify the ServerInstance object of the target instance of SQL Server.

Note: This cmdlet ceased to work a long time ago. It's been removed in version 22 of the module.

Beispiele

Example 1: Configure the SQL Server authentication mode

PS C:\> CD SQLSERVER:\SQL\Computer\Instance;
PS SQLSERVER:\SQL\Computer\Instance> Set-SqlAuthenticationMode -Credential $Credential -Mode Integrated -ForceServiceRestart -AcceptSelfSignedCertificate

Example 2: Configure the SQL Server authentication mode on all SQL Server instances

PS C:\> Get-SqlInstance -Credential $Credential -MachineName "Computer005" | Set-SqlAuthenticationMode -Credential $Credential -Mode Mixed -SqlCredential $sqlCredential -NoServiceRestart -AcceptSelfSignedCertificate

This command gets all instances of SQL Server on the computer named Computer005 and configures the authentication mode to Mixed, with the provided SQL credentials for each one of them. The SQL Server service is not restarted automatically. The self-signed certificate of the target machine is automatically accepted without prompting the user.

Parameter

-AutomaticallyAcceptUntrustedCertificates

Indicates that this cmdlet automatically accepts untrusted certificates.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:False
Unterstützt Platzhalter:False
Nicht anzeigen:False
Aliase:cf

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Credential

Specifies a user account with Windows Administrator credentials on the target computer.

Parametereigenschaften

Typ:PSCredential
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:0
Obligatorisch.:True
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-ForceServiceRestart

Indicates that this cmdlet forces the SQL Server service to restart, if necessary, without prompting the user.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-InputObject

Specifies the server object, as an array, of the target instance.

Parametereigenschaften

Typ:

Server[]

Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByObject
Position:Named
Obligatorisch.:True
Wert aus Pipeline:True
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-ManagementPublicPort

Specifies the public management port on the target computer. This parameter should be used when the ports of the target computer are not directly accessible but are exposed through endpoints, which means that this cmdlet needs to connect to a different port.

SQL Server Cloud Adapter must be accessible by this port.

Parametereigenschaften

Typ:Int32
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Mode

Specifies the authentication mode that will be configured on the target instance of SQL Server.

Parametereigenschaften

Typ:ServerLoginMode
Standardwert:None
Zulässige Werte:Normal, Integrated, Mixed, Unknown
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:1
Obligatorisch.:True
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-NoServiceRestart

Indicates that this cmdlet prevents a restart of the SQL Server service without prompting the user.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Path

Specifies the path to the instance of SQL Server, as an array, on which this cmdlet runs the operation. If you do not specify a value for this parameter, the cmdlet defaults to the current working location.

Parametereigenschaften

Typ:

String[]

Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByPath
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-RetryTimeout

Specifies the time period to retry the command on the target sever. After the timeout expires, no retry will be attempted.

Parametereigenschaften

Typ:Int32
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-ServerInstance

Specifies, as a string array, the name of an instance of SQL Server that becomes the target of the operation.

Parametereigenschaften

Typ:

String[]

Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByName
Position:Named
Obligatorisch.:True
Wert aus Pipeline:True
Wert aus Pipeline nach dem Eigenschaftsnamen:True
Wert aus verbleibenden Argumenten:False

-SqlCredential

Specifies the administrator credentials that is created in the target instance of SQL Server if Mixed mode authentication is enabled.

Parametereigenschaften

Typ:PSCredential
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:2
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-WhatIf

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

Parametereigenschaften

Typ:SwitchParameter
Standardwert:False
Unterstützt Platzhalter:False
Nicht anzeigen:False
Aliase:wi

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Eingaben

Microsoft.SqlServer.Management.Smo.Server

System.String