Connect-SPConfigurationDatabase

連接本機伺服器電腦與伺服器陣列。

Syntax

Connect-SPConfigurationDatabase
       [-DatabaseName] <String>
       [-SkipRegisterAsDistributedCacheHost]
       [-Passphrase] <SecureString>
       -DatabaseServer <String>
       [-AssignmentCollection <SPAssignmentCollection>]
       [-DatabaseCredentials <PSCredential>]
       [-DatabaseFailOverPartner <String>]
       [-LocalServerRole <SPServerRole>]
       [<CommonParameters>]

Description

Connect-SPConfigurationDatabase Cmdlet 會將目前的伺服器連接到指定的設定資料庫。

Essentially, this cmdlet connects the server to the farm. If the current computer cannot be connected to a farm, the following error message is displayed:

「本電腦已經連接到 SharePoint 伺服器陣列。 請參閱:Dismount-SPConfigurationDatabase」

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

------------------範例------------------

Connect-SPConfigurationDatabase -DatabaseServer "ServerName\InstanceName" -DatabaseName "SharePointConfigurationDatabaseName" -Passphrase (ConvertTo-SecureString "MyP@ssw0rd" -AsPlainText -Force)
Start-Service SPTimerv4

此範例會將本機伺服器電腦連接到伺服器陣列 (該伺服器陣列已設定為使用 SQL Server 執行個體上的 SharePointConfigurationDatabase 資料庫),方法是使用名稱 ServerName\InstanceName 及密碼 MyP@ssw0rd。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseCredentials

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication. If this parameter is not specified, the current user is used.

此類型必須為有效的 PSCredential 物件。

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseFailOverPartner

指定SQL Server實例的資料庫鏡像夥伴。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseName

指定伺服器要連接的設定資料庫名稱。

此類型必須是有效的資料庫名稱,例如 DB1。

Type:String
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseServer

指定要建立設定資料庫的伺服器。 預設值為本機電腦名稱。

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-LocalServerRole

指定指派給本機伺服器的 MinRole。

Type:SPServerRole
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Passphrase

指定用來將目前伺服器連接到設定資料庫的安全密碼片語。

此類型必須是有效的安全字串,例如 MyBDCApp1serverkey。

Type:SecureString
Position:9
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-SkipRegisterAsDistributedCacheHost

伺服器陣列中的所有伺服器預設會註冊為快取主機 (亦即預設會執行 DistributedCacheService )。

Use this parameter to not register the server computer as a distributed cache host. If you want to have a dedicated cache host, then use this parameter to make sure that caching service is not installed on the computer.

Type:SwitchParameter
Position:10
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition