Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7503743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:20:22+00:00 2026-05-29T21:20:22+00:00

I would like to add a bunch of SQL (mixture of 2000-2005) server instances

  • 0

I would like to add a bunch of SQL (mixture of 2000-2005) server instances on different servers to my SSMS (SQL Managment Studio) Registered servers, I was following this tutorial here but this only adds one server at a time not all at the same time.

The list is currently in Excel but can be imported to notepad or any other document format as long as it can be recognized by the PowerShell command. Also, another thing to note is where can i change the login to use sql authentication? and specify username and password?

New-Item $(Encode-Sqlname "SERVERNAME\INSTANCENAME") -itemtype registration -Value “server=MyServer;integrated security=true” 

tks

ERROR

New-Object : Cannot convert argument "1", with value: "", for "PSCredential" to
 type "System.Security.SecureString": "Cannot convert the "" value of type "Sys
tem.String" to type "System.Security.SecureString"."
At line:4 char:32
+         -Credential (New-Object <<<<  System.Management.Automation.PSCredenti
al("sa", "")) }
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodExcept
   ion
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
   Shell.Commands.NewObjectCommand
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:20:23+00:00Added an answer on May 29, 2026 at 9:20 pm

    If you save the Excel spreadsheet as a CSV file, you can easily import it in PowerShell using the Import-Csv cmdlet and automatically register the servers in the list by their names.

    Assuming your CSV file looks like this:

    |Name    |
    |Server1 |
    |Server2 |
    |Server3 |
    

    The following command will import its content as a list of objects, one for each row in the CSV file, all having a Name property, which contains the actual value. Those names are then used within the string passed to the New-Item cmdlet to actually do the registration:

    Import-Csv ServersToRegister.csv | ForEach-Object { `
        New-Item $(Encode-Sqlname $_.Name) -ItemType Registration `
            -Value ("server=$($_.Name);integrated security=true") }
    

    You can specify the username and password to use to connect to the SQL Server instance by passing a PSCredential object to the New-Item cmdlet. So the complete command would be:

    Import-Csv ServersToRegister.csv | ForEach-Object { `
        New-Item $(Encode-Sqlname $_.Name) -ItemType Registration `
            -Value ("server=$($_.Name);integrated security=true") `
            -Credential (New-Object System.Management.Automation.PSCredential("username", "password")) }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a folder containing a bunch of images. I would like to add
I have a simple Rails scaffolded application, and would like to add a bunch
I would like to add a bunch of UILabels or NSStrings to the UIALertView
I have a bunch a values I would like to add together which are
I have own project and i would like add for this class same as
I have a ListView and each item have a TextView. I would like add
I would like to add a GestureDetector to all views (view groups) of an
I would like to add a custom calculation method to a managed object (which
I would like to add roots to a VirtualTreeView http://www.delphi-gems.com/index.php/controls/virtual-treeview with a thread like
I would like to add a hash into an array using Ruby version 1.8.7:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.