Register SQL Server instances in MS.

  • Ash

    SSC Eights!

    Points: 826

    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

  • MG-148046

    SSCrazy Eights

    Points: 9945

    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.

  • Michael Valentine Jones

    SSC Guru

    Points: 64818

    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.

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 719736

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

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