Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Test-DbaInstanceName on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaInstanceName.
Tests to see if it's possible to easily rename the server at the SQL Server instance level, or if it even needs to be changed.
When a SQL Server's host OS is renamed, the SQL Server should be as well. This helps with Availability Groups and Kerberos.
This command helps determine if your OS and SQL Server names match, and whether a rename is required.
It then checks conditions that would prevent a rename, such as database mirroring and replication.
Test-DbaInstanceName
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[-ExcludeSsrs]
[-EnableException]
[<CommonParameters>]
PS C:\> Test-DbaInstanceName -SqlInstance sqlserver2014a
Returns ServerInstanceName, SqlServerName, IsEqual and RenameRequired for sqlserver2014a.
PS C:\> Test-DbaInstanceName -SqlInstance sqlserver2014a, sql2016
Returns ServerInstanceName, SqlServerName, IsEqual and RenameRequired for sqlserver2014a and sql2016.
PS C:\> Test-DbaInstanceName -SqlInstance sqlserver2014a, sql2016 -ExcludeSsrs
Returns ServerInstanceName, SqlServerName, IsEqual and RenameRequired for sqlserver2014a and sql2016, but skips validating if SSRS is installed on both instances.
PS C:\> Test-DbaInstanceName -SqlInstance sqlserver2014a, sql2016 | Select-Object *
Returns ServerInstanceName, SqlServerName, IsEqual and RenameRequired for sqlserver2014a and sql2016.
If a Rename is required, it will also show Updatable, and Reasons if the server name is not updatable.
The target SQL Server instance or instances.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, checking for SQL Server Reporting Services will be skipped.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |