Category Archives: Powershell

Powershell Function to Get SQL Server’s Network Protocols

The output of the above function usually looks like this: ProtocolName ProtocolDisplayName ProtocolOrder sm Shared Memory 1 tcp TCP/IP 2 np Named Pipes 3 via VIA 0 Number ‘0’ means corresponding protocol is ‘disabled’, while the NO. ‘1’ has the … Continue reading

Posted in Database Connection, Powershell | Leave a comment

Powershell Function to Get Largest Files on a Drive or in a Folder

Ofentimes when a disk space shortage alert pops up from a specific server, I’d like to know quickly which files are the largest that I might have a way to shrink or move or delete. Here are the two funtions … Continue reading

Posted in Powershell | Tagged | Leave a comment

Powershell Function to Get Sizes of All Databases on an Instance

Below is a function that I modified from one in Idera’s SQL Server Powershell Scripts toolset:

Posted in Powershell | Tagged , | Leave a comment

Powershell Function to Reboot a Computer with Warning Messages

I am fully aware that a simple command can easily do the trick, but it means doing this trick a bit too easy and too harzardly. I’d like to see my own function to promt up some warnings and confirmations … Continue reading

Posted in Powershell | Leave a comment

Powershell Function to Get SQL Server’s Errorlog Path

This is a repost of Ed Wilson the ScriptingGuy’s awesome function:

Posted in Powershell | Leave a comment

Two Ways to Control Services on a Remote Computer in Powershell

I am just making a note here about the two alternatives that I found via Google. The first one is on Hey! Scripting Guy’s blog post and the second one is here. To wrap up, I am summing up the … Continue reading

Posted in Powershell | Leave a comment

Powershell Function to Get the Last Boot Up Time of a Computer

Posted in Powershell | Tagged , | Leave a comment

Powershell Function to Get the Windows Version of a Computer

Posted in Powershell | Tagged , | Leave a comment

Powershell Function to Get Statues of All Sql Related Services

Posted in Powershell | Tagged , | Leave a comment

Powershell Script of Sending an HTML Email Report in a Formatted Table

This is a re-post from Powershell expert “Ben Wilkinson“, the original ps function is here. I did have some trouble in making it work in my own script and found that I have to add opening and closing “style” tags in the … Continue reading

Posted in Powershell | Tagged , , | Leave a comment