New-SPConfigurationDatabase
Creates a new configuration database.
Syntax
Default (Default)
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]
[-DatabaseConnectionEncryption <SqlConnectionEncryptOption>]
[-DatabaseServerCertificateHostName <String>]
[<CommonParameters>]
Description
The New-SPConfigurationDatabase cmdlet creates a new configuration database on the specified database server. This is the central database for a new SharePoint farm.
For permissions and the most current information about Windows PowerShell for SharePoint Products, see the online documentation at SharePoint Server Cmdlets.
Examples
EXAMPLE 1
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential)
This example prompts the user to provide user credentials for the default Farm Administrator account.
EXAMPLE 2
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential) -SkipRegisterAsDistributedCacheHost
This example prompts the user to provide user credentials for the default Farm Administrator account and skips registering the server as Distributed Cache host. Applies to SharePoint Server 2013 and SharePoint Server 2016, SharePoint Server 2019 only.
EXAMPLE 3
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential) -LocalServerRole Custom
This example prompts the user to provide user credentials for the default Farm Administrator account and sets the Server Role to Custom. Applies to SharePoint Server 2016, SharePoint Server 2019 only.
Parameters
-AdministrationContentDatabaseName
Applicable: SharePoint Server Subscription Edition
Specifies the name for the Central Administration content database for the new farm. If no name is specified, a default name is used.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 5 |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-AssignmentCollection
Applicable: 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.
Parameter properties
| Type: | SPAssignmentCollection |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DatabaseConnectionEncryption
Applicable: SharePoint Server Subscription Edition
Specifies whether TLS encryption is used for the connection between SharePoint and the database. Mandatory requires that TLS encryption is used. If TLS encryption can't be successfully negotiated, the connection will fail. Optional allows TLS encryption to be used. If the database server requires TLS encryption, then TLS encryption will be used. Otherwise, TLS encryption will not be used. Strict requires that TLS encryption is used with TDS 8.0, which is the strongest encryption configuration. If TLS encryption with TDS 8.0 can't be successfully negotiated, the connection will fail. Databases mounted to SharePoint before the Version 24H2 feature update was installed default to Optional encryption. If this parameter is not specified when mounting a new database to SharePoint after the Version 24H2 feature update is installed, the default is Mandatory.
Parameter properties
| Type: | SqlConnectionEncryptOption |
| Default value: | Mandatory |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DatabaseCredentials
Applicable: SharePoint Server Subscription Edition
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.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 6 |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DatabaseFailOverServer
Applicable: SharePoint Server Subscription Edition
Specifies the SQL Server Database Mirror partner server for the Configuration and Central Administration database.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DatabaseName
Applicable: SharePoint Server Subscription Edition
Specifies the name of the new configuration database.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DatabaseServer
Applicable: SharePoint Server Subscription Edition
Specifies the database server on which to create the configuration database. If no value is specified, the default value is used.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 2 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DatabaseServerCertificateHostName
Applicable: SharePoint Server Subscription Edition
Sets the host name to use when validating the server certificate for the connection.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DirectoryDomain
Applicable: SharePoint Server Subscription Edition
Specifies the directory domain for the new farm. If no domain is specified, the domain in which the local computer is located is used.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 3 |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-DirectoryOrganizationUnit
Applicable: SharePoint Server Subscription Edition
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.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 4 |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-FarmCredentials
Applicable: SharePoint Server Subscription Edition
Specifies credentials for the Farm Administrator account.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 7 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-LocalServerRole
Applicable: SharePoint Server Subscription Edition
Specifies the Server Role. Valid options for all versions of SharePoint Server 2016, SharePoint Server 2019 are:
Custom, SingleServerFarm, Application, WebFrontEnd, DistributedCache, Search
With the addition of Feature Pack 1, new options include:
ApplicationWithSearch, WebFrontEndWithDistributedCache
Parameter properties
| Type: | SPServerRole |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Passphrase
Applicable: SharePoint Server Subscription Edition
Specifies the secure password phrase for the new farm. This passphrase is used to join other machines to this farm.
Parameter properties
| Type: | SecureString |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 8 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-ServerRoleOptional
Applicable: SharePoint Server Subscription Edition
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.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SiteMapDatabaseName
Applicable: SharePoint Server Subscription Edition
Do not use. Specifies the database name of the Site Map site.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SiteMapDatabaseServer
Applicable: SharePoint Server Subscription Edition
Do not use. Specifies the database server name of the Site Map site.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-SkipRegisterAsDistributedCacheHost
Applicable: SharePoint Server Subscription Edition
By default all the servers in the farm are registered as a cache host (that is, DistributedCacheService is running by default).
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.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 9 |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | 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.