Script request – SQL server inventory

Welcome Forums General PowerShell Q&A Script request – SQL server inventory

Viewing 1 reply thread
  • Author
    Posts
    • #241115
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      I’d like to know what version of sql and to what patch level my servers are running.

      So the output would be something like

      SERVER1 Windows 2012r2 SQL 2014 SP3

      SERVER2 Windows 2016 SQL 2017 cu3

      I have the list of servers in a csv file and would like to use that as the source for the servers the script looks for.

      Can anyone help with a script for this?

    • #241154
      Participant
      Topics: 13
      Replies: 1684
      Points: 2,853
      Helping Hand
      Rank: Community Hero

      Did you attempt to search for this? “powershell get sql version” provide many results. If you have SQL Management installed on your system, you can use this:

      https://docs.microsoft.com/en-us/powershell/module/sqlserver/get-sqlinstance?view=sqlserver-ps

      If not, then search and there are registry and WMI solutions.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.