Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an x64 machine that regularly needs about 10 aliases changed in the SQL Server Client Network Utility (cliconfig) for both the x64 and x86 sides of the registry. Is there a way I could do this with a powershell script?

share|improve this question
up vote 9 down vote accepted

cliconfig.exe is used in SQL Server 2000, the right tool to be using for SQL Server 2008 is SQL Server Configuration Manager. Nonetheless they both seem to manipulate the same registry keys.

For x86:


For x64:


To create a new TCP alias with powershell (although you can use any tool that manipulates the registry) use the following:

New-ItemProperty HKLM:SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo -name alias1 -propertytype String -value "DBMSSOCN,servera,2001"

Where alias1 is the name of the alias, servera is the name of the server and 2001 is the TCP port.

share|improve this answer
How did you figure out what registry key was being changed by that exe? – Sam Aug 19 '09 at 15:58
sysinternals tools! – Nick Kavadias Aug 20 '09 at 16:20

I believe you should use WMI for doing this. In root\Microsoft\SqlServer\ComputerManagement namespace there is an object of type SqlServerAlias which corresponds to server alias. Try using it - as far as I know using WMI is a recommended way of performing such tasks.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.