dbatools is a free PowerShell module with over 300 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

New-DbaClientAlias -ServerName sqlcluster\sharepoint -Alias sp
Creates a new TCP alias on the local workstation called sp, which points to sqlcluster\sharepoint.

New-DbaClientAlias -ServerName ‘sqlcluster,14443’ -Alias spinstance
Creates a new TCP alias on the local workstation called spinstance, which points to sqlcluster, port 14443.

New-DbaClientAlias -ServerName sqlcluster\sharepoint -Alias sp -Protocol NamedPipes
Creates a new NamedPipes alias on the local workstation called sp, which points to sqlcluster\sharepoint.

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