PowerShell Tip: Specify Select Column List (Attributes/Properties) Dynamically

As we pipe stuff through a pipeline, we may have the need to add/remove/rename columns. These three operations are easy to do. Remove/Add/Rename Remove: Here we remove all attributes returned from Get-Process except Handles and ProcessName by not selecting them Alternatively, you could use the ExcludeProperty parameter if you have to select everything except a … Continue reading PowerShell Tip: Specify Select Column List (Attributes/Properties) Dynamically

Quick Tip: “Paste” shortcut key + why is copy/paste so hard in the PowerShell command line?

Technorati Tags: PowerShell If you wanted to paste text into the PowerShell command line console, you can right-click. That is great but command line people usually try to avoid the mouse and stay with keyboard shortcuts whenever they can. Having said that, to paste with keyboard short-cut, you need to do this ALT+SPACE ALT+SPACE+E (follow-up … Continue reading Quick Tip: “Paste” shortcut key + why is copy/paste so hard in the PowerShell command line?

Quick Tip: No connection could be made because the target machine actively refused it

Your users get the below error when connecting to SQL Server that has been running fine all along.Reason:What could be the reason? Quite simple. Check to see if the service is running and start it if it is not!StackOverflow always has the answers for all the other kinds of configuration issues that might cause this … Continue reading Quick Tip: No connection could be made because the target machine actively refused it

Quick Tip: Find the time and reason for Windows server restart using Powershell

As a database administrator, often times, you need to find-out who rebooted a Windows Server running a SQL Server instance. Using the "Windows Event Manager" is a drag (IMHO). Use this Powershell command to do it quickly  Get-Eventlog -logname system -message '*restart*' -Newest 10 | Format-Table -wrap It gets the eventlog of type "system" with … Continue reading Quick Tip: Find the time and reason for Windows server restart using Powershell