A reader named "Ben" wrote me and said that he looked at my script in PowerShell that finds SQL Server Instances using the WMI provider yesterday and he came up with another method. Here’s what he wrote:
I wasn’t able to find a way to post a comment to the blog post, but I was wondering why something like the following code wouldn’t be better:
The advantage that I see is that you don’t have to have powershell installed on each machine. You can have a text file of server names and populate $machine_name through a read of that file.
Thanks so much for your blog…I really learn a lot from reading it
Thanks, Ben! The great thing about PowerShell is that there are so many ways to do similar things, based on your goals. Keep in mind with Ben’s approach you’ll need to be able to use the WMI provider on the target machine, which has security implications as well as the fact that WMI calls like this might be blocked by your security policies.