PowerShell – Email All Users Connected (Logged In) To A SQL Server Instance

As a DBA, when I have to do an emergency restart of a SQL Server instance or the host itself, the first thing I do is to check who is connected so that I can notify them (at least the ACTIVE users). We do have a system where we keep the app/database/owner information but notifying … Continue reading PowerShell – Email All Users Connected (Logged In) To A SQL Server Instance

Advertisements

PowerShell – Get SQL Server Instance Info from Hosts – With Pipeline input support

There is not much to say except that this supports pipeline input. Take a close look. PowerShell folks don't read text, they just focus on the code...So, here it is. The "Output" column will have an Exception object containing the error if the attempt failed to fetch the instance information. Also, isn't this cool? The … Continue reading PowerShell – Get SQL Server Instance Info from Hosts – With Pipeline input support

PowerShell: Resolve partial computer names, CNAME’s & IP Addresses to concrete Host name / IP

One can refer to a host by several means. Where I am at, we generously use CNAME's to point to host to insulate the applications from having to change when then hostname changes. For example, if the hostname for Dev SQL Server is ddxumapDEV, then we might have a cname entry that says "Dev-SQL". All … Continue reading PowerShell: Resolve partial computer names, CNAME’s & IP Addresses to concrete Host name / IP