Share via

Create connection string using powershell

dinesh 41 Reputation points
2020-11-17T16:24:50.453+00:00

Hi, I want to create connection string using powershell windows authentication. How do I do that?

SQL Server Reporting Services
SQL Server Reporting Services

A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

2 answers

Sort by: Most helpful
  1. SChalakov 10,781 Reputation points MVP Volunteer Moderator
    2020-11-17T16:49:14.093+00:00

    Hi,

    if it is related to a SQL connection then this will help you:

    Powershell script to connect to sql db with windows authentication
    https://stackoverflow.com/questions/38177582/powershell-script-to-connect-to-sql-db-with-windows-authentication

    this also:
    Connecting PowerShell to SQL Server – Using a Different Account
    https://www.sqlshack.com/connecting-powershell-to-sql-server-using-a-different-account/

    Here you will find also a couple of nice examples:

    Automating SQL operations with Service Management Automation (SMA) and Invoke-Sqlcmd – challenges and solutions
    40091.automating-sql-operations-with-service-management-automation-sma-and-invoke-sqlcmd-challenges-and-solutions.aspx

    Hope I was able to help. Regards,
    Stoyan

    1 person found this answer helpful.
    0 comments No comments

  2. ZoeHui-MSFT 41,551 Reputation points
    2020-11-18T02:16:30.86+00:00

    Hi

    Suppose that you want to connect to sql server with powershell.

    Here are some documentations for your reference.

    https://octopus.com/blog/sql-server-powershell

    https://www.sqlshack.com/connecting-powershell-to-sql-server/

    https://stackoverflow.com/questions/45859333/sql-connection-from-powershell

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.