Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Register SQL Server instances in MS. Expand / Collapse
Posted Monday, June 21, 2010 10:21 AM


Group: General Forum Members
Last Login: Wednesday, November 23, 2016 11:49 AM
Points: 134, Visits: 719
Hi All,

Recently moved to a new position where we currently have 250 SQL Servers. To register these in E.M. manually would be very time consuming and I can only think this can be done automatically via Powershell.

I can get the list of SQL Server instances into a table or text file.

I've never used PowerShell scripting before and although it would be useful to learn just don't have the time at the moment !

If I'm correct that PowerShell scripting is the easiest way forward does anyone have a script that can do this. Would be very grateful.

versions are SQL Servers are 2000, 2005 and few of thems are on 2008.


A. Singh

Post #940459
Posted Friday, September 3, 2010 8:39 AM



Group: General Forum Members
Last Login: Today @ 6:12 AM
Points: 2,113, Visits: 2,658
I have the SQL 2008 client loaded so this is a simple method using SQLPS but it is the basis of what I use:

cd 'SQLSERVER:\sqlregistration\Database Engine Server Group'
new-item ServerGroupA #tcreate a group for servers
cd ServerGroupA # sets location in the group just created
Get-Content C:\ServerList.Txt | foreach {New-Item $_ -itemtype registration -Value "server=$_ ; integrated security=true" }


"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
Tony Hoare

"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

Post #980245
Posted Friday, September 3, 2010 9:00 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Saturday, October 24, 2015 2:31 AM
Points: 3,158, Visits: 11,771
If there is someone else with all the servers registered in SSMS 2008, you can have them export their server list, and you can import it.

The export file is XML, so you might be able to figure out a way to produce a valid file to import from a list of servers.
Post #980266
Posted Friday, September 3, 2010 9:18 AM



Group: Administrators
Last Login: Yesterday @ 1:59 PM
Points: 34,363, Visits: 18,582
This help?

Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #980284
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse