dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


New-DbaClientAlias

Creates/updates a SQL Server alias by altering HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client.

Screenshots

dbatools-New-DbaClientAlias

Examples

Creates a new TCP alias on the local workstation called sp, which points sqlcluster\sharepoint.

New-DbaClientAlias -ServerName sqlcluster\sharepoint -Alias sp

Creates a new NamedPipes alias on the local workstation called sp, which points sqlcluster\sharepoint.

New-DbaClientAlias -ServerName sqlcluster\sharepoint -Alias sp -Protocol NamedPipes

Author

This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.

Get-Help

From PowerShell, execute Get-Help New-DbaClientAlias -Detailed for more information on this function.

Source Code

Want to see the source code? View New-DbaClientAlias.ps1 on GitHub
 

Related commands