Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Get-DbaClientAlias on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaClientAlias.
Gets any SQL Server alias for the specified server(s)
Gets SQL Server alias by reading HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client
Get-DbaClientAlias
[[-ComputerName] <DbaInstanceParameter[]>]
[[-Credential] <PSCredential>]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbaClientAlias
Gets all SQL Server client aliases on the local computer
PS C:\> Get-DbaClientAlias -ComputerName workstationx
Gets all SQL Server client aliases on Workstationx
PS C:\> Get-DbaClientAlias -ComputerName workstationx -Credential ad\sqldba
Logs into workstationx as ad\sqldba then retrieves all SQL Server client aliases on Workstationx
PS C:\> 'Server1', 'Server2' | Get-DbaClientAlias
Gets all SQL Server client aliases on Server1 and Server2
The target computer where the alias has been created
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value | $env:COMPUTERNAME |
Allows you to login to remote computers using alternative credentials
Alias | |
Required | False |
Pipeline | false |
Default Value |
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 |