New-SPConfigurationDatabase
建立新的設定資料庫。
Syntax
New-SPConfigurationDatabase
[-DatabaseName] <String>
[-DatabaseServer] <String>
[[-DirectoryDomain] <String>]
[[-DirectoryOrganizationUnit] <String>]
[[-AdministrationContentDatabaseName] <String>]
[[-DatabaseCredentials] <PSCredential>]
[-FarmCredentials] <PSCredential>
[-Passphrase] <SecureString>
[-SkipRegisterAsDistributedCacheHost]
[-AssignmentCollection <SPAssignmentCollection>]
[-DatabaseFailOverServer <String>]
[-LocalServerRole <SPServerRole>]
[-ServerRoleOptional]
[<CommonParameters>]
Description
New-SPConfigurationDatabase Cmdlet 會在指定的資料庫伺服器上建立新的組態資料庫。 這是用於新 SharePoint 伺服器陣列的中央資料庫。
如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet。
範例
------------------範例 1-----------------------
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential)
此範例會提示使用者提供預設伺服器陣列管理員帳戶的使用者認證。
------------------範例 2-----------------------
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential) -SkipRegisterAsDistributedCacheHost
此範例會提示使用者提供預設伺服器陣列系統管理員帳戶的使用者認證,並略過將伺服器註冊為分散式快取主機。 僅適用于 SharePoint Server 2013 和 SharePoint Server 2016 SharePoint Server 2019。
------------------範例 3-----------------------
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential) -LocalServerRole Custom
此範例會提示使用者提供預設伺服器陣列管理員帳戶的使用者認證,並將伺服器角色設定為自訂。 僅適用于 SharePoint Server 2016 SharePoint Server 2019。
參數
-AdministrationContentDatabaseName
指定新伺服器陣列的管理中心內容資料庫名稱。 若不指定任何名稱,即使用預設的名稱。
Type: | String |
Position: | 5 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-AssignmentCollection
管理物件以適當處置它們。 使用 SPWeb 或 SPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。 您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。 使用 SPWeb、SPSite 或 SPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。
使用 Global 參數時,所有物件會包含在全域儲存區內。 若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DatabaseCredentials
指定資料庫使用者的 Credential 物件。 若使用 SQL Server 驗證,請使用此參數。 若未提供資料庫認證,即使用 Windows 驗證。
Type: | PSCredential |
Position: | 6 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DatabaseFailOverServer
指定SQL Server組態和管理中心資料庫的資料庫鏡像夥伴伺服器。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DatabaseName
指定新設定資料庫的名稱。
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DatabaseServer
指定要建立設定資料庫的資料庫伺服器。 若不指定任何值,即會使用預設值。
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DirectoryDomain
指定新伺服器陣列的目錄網域。 若不指定任何網域,即會使用本機電腦所在之網域。
Type: | String |
Position: | 3 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DirectoryOrganizationUnit
指定新設定資料庫的目錄組織單位。 若不指定任何組織單位,即會使用本機電腦所在之組織單位。
Type: | String |
Position: | 4 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-FarmCredentials
指定伺服器陣列管理員帳戶的認證。
Type: | PSCredential |
Position: | 7 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-LocalServerRole
指定伺服器角色。 所有 SharePoint Server 2016 版本的有效選項,SharePoint Server 2019為: Custom
、、 SingleServerFarm
、 Application
、 WebFrontEnd
、 DistributedCache
Search
新增功能套件 1 後,新的選項包括: ApplicationWithSearch
、 WebFrontEndWithDistributedCache
Type: | SPServerRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2016, SharePoint Server 2019 |
-Passphrase
指定新伺服器陣列的安全密碼片語。 此複雜密碼係用於連結其他電腦與此伺服器陣列。
Type: | SecureString |
Position: | 8 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ServerRoleOptional
將伺服器陣列設定為不需要指定伺服器角色。 若未指定伺服器角色,則伺服器會預設為「自訂」角色。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2016, SharePoint Server 2019 |
-SiteMapDatabaseName
請勿使用。 指定網站地圖網站的資料庫名稱。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2016, SharePoint Server 2019 |
-SiteMapDatabaseServer
請勿使用。 指定網站地圖網站的資料庫伺服器名稱。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2016, SharePoint Server 2019 |
-SkipRegisterAsDistributedCacheHost
伺服器陣列中的所有伺服器預設會註冊為快取主機 (亦即預設會執行 DistributedCacheService )。
使用此參數可免於將伺服器電腦註冊為分散式快取主機。 若您想擁有專用快取主機,則使用此參數以確定未將快取服務安裝於電腦上。
Type: | SwitchParameter |
Position: | 9 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |