New-SPConfigurationDatabase

创建新的配置数据库。

语法

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>]

说明

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
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseCredentials

Specifies the Credential object for the database user. Use this parameter if you use SQL Server Authentication. If no database credentials are provided, Windows authentication is used.

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

-DatabaseFailOverServer

指定配置和管理中心数据库的SQL Server数据库镜像合作伙伴服务器。

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

-DatabaseName

指定新配置数据库的名称。

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:2
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DirectoryDomain

Specifies the directory domain for the new farm. If no domain is specified, the domain in which the local computer is located is used.

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

-DirectoryOrganizationUnit

Specifies the directory organizational unit for the new configuration database. If no organizational unit is specified, the organizational unit in which the local computer is located is used.

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

-FarmCredentials

指定服务器场管理员帐户的凭据。

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

-LocalServerRole

指定服务器角色。 SharePoint Server 2016 的所有版本的有效选项SharePoint Server 2019包括:CustomSingleServerFarmApplication、、WebFrontEndDistributedCache``Search

添加功能包 1 后,新选项包括: ApplicationWithSearch``WebFrontEndWithDistributedCache

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

-Passphrase

指定新服务器场的安全密码短语。 此密码用于将其他计算机加入此服务器场。

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

-ServerRoleOptional

Configures the farm to not require a server role to be specified. If no server role is specified, the server defaults to the Custom role.

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

-SiteMapDatabaseName

请勿使用。 指定“站点地图”站点的数据库名称。

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

-SiteMapDatabaseServer

请勿使用。 指定“站点地图”站点的数据库服务器名称。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
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:9
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-工作分配

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