TL:DR - At bottom
I’m in a new position (for the past 4 months) where I am now responsible to do remote inventory, management and software patching of multiple windows servers. That includes running MSI files, copying over a few files, uploading logs, and my current least favorite, running SQL stored procedures to update databases.
After a few days messing around, I found powershell and started piecing things together on my own as much as possible to help my with my duties. I’m already started on the powershell month of lunches book and youtube series and have been bouncing around the net piecing things together fairly well on my own. At the same time as I’m learning powershell, I’m also learning databases and SQL Server management. Powershell has certainly been making this learning curve a bit easier for me, but I have a lot to chew through at the moment
I’ll cut to the quick of it.
Right now I use a modified version of the following script to inventory a unknown server. I have the IT guy at each site run this against a list of servers, and he sends back all the individual machinename.html files.
This works great, but doesn’t tell me much about the SQL server side of things. What I’m looking for is the same kind of inventory script that tells me more than I need to know about the SQL server, the databases that are installed on the server, and perhaps a short summary of each of the databases. The burn on this is, that I don’t yet know much about SQL so I tend to miss things the first time. I need someone out there with SQL brains to point me to a script that gets a SQL beginner enough information to be dangerous. Even better, tell me what to add to this existing script so it could get the information if the server had SQL server installed on it and only require one script.
I’ve done a LOT of searching out there and have found a LOT of stuff out there on the SMO cmdlets and my head is spinning. I don’t know what I need to know, which prevents me from knowing if I’m getting the needed information.
I’m a SQL newbie, looking for suggestions on a prebuilt powershell script that I can run aginst a SQL server and then get an output file that I can look at.