connect to remote sql server without using SMO/ADO?

  • winston Smith

    SSCoach

    Points: 19484

    is it possible to connect to a remote sql server instance just using powershell, and avoiding SMO, ADO?

    Ive done a few searches on google but everything points to SMO to connect to a remote server.

  • winston Smith

    SSCoach

    Points: 19484

    think ive figured out i have to configure wsman on both my pc and the server to ensure they both can communicate. not fully sure what to do yet, but im on the right track.

  • MG-148046

    SSCrazy Eights

    Points: 9945

    WMF - Windows Management Framework - includes Powershell V2.0, Windows Remote (WinRM) and WPF. Enable WinRM on the servers you will be working with and you can start remote session from what machine you are currently on.

    Also, WMI commandlets and quite a few others accept -computername.

    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.

  • Joie Andrew

    One Orange Chip

    Points: 27295

    You can also try a roundabout way. If the purpose is to not use ADO/SMO yet use the power of powershell you could try something like using sqlcmd inside of a powershell session, since it can access all external commands like a cmd prompt.

    Joie Andrew
    "Since 1982"

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

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