Register SQL Server instances in MS.

  • 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.

    Regards,

    A. Singh

  • 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" }

    MG

    "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.

  • 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.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply