This topic contains 2 replies, has 2 voices, and was last updated by
September 5, 2013 at 9:23 am #9942ParticipantPoints: 0Rank: Member
What is the easiest way to install SQLPS module? We plan to use invoke-sqlcmd on more than 2000+ servers. (Windows server 2003 standard edition/
SQL Server 2008 EXPRESS SP2).
I know SQLPS comes with SQL 2012. But I don't think we'll migrate to 2012 anytime soon.
September 5, 2013 at 9:28 am #9943KeymasterPoints: 1,704Rank: Community Hero
SQLPS first shipped with SQL2008R2, in fact. But I'm not sure the module will work with older versions of SQL Server – there was server-side programming that had to be done in order to make the module work.
But you're welcome to try! You'd need to install the SQL 2012 admin tools – e.g., Management Studio – on your computer. That's the only way I'm aware of to get the module installed locally.
But you don't need it. If all you want to do is sent T-SQL queries to remote computers, you can do that by using the .NET Framework from within PowerShell. We covered the technique in "PowerShell In Depth," and it simply involves instantiating an instance of System.Data.Sql.SqlClient.SqlConnection to connect to a computer, and then .SqlCommand to create and execute the command. Everything you need is built into the Framework and is accessible from PowerShell, and will work with any version of SQL Server way back to, I dunno, 7.0 or something.
September 5, 2013 at 9:38 am #9945ParticipantPoints: 0Rank: Member
Thank you Don.
I found this post on installing SQLPS without installing SQL Server.
But as you said, I'm not sure if I can use Invoke-SqlCmd against SQL 2008 instances. Remote invoking is not an option in our case.
The SQL that needs to be executed on these servers is little complex, Invoke-SqlCmd would have been really handy. I'll give it a try to run the script using .net approach. Thank you.
The topic ‘SQLPS install’ is closed to new replies.