Tag Archives: powershell

PowerShell With Uptime – Getting Days Only

There is a handy and free tool to check your system's uptime called "Uptime".  (Clever, no?)  It can be downloaded at http://uptimeexe.codeplex.com. While it is very easy to use (just navigate to it in a command window and type "uptime"), it doesn't give much of an option for formatting the output to include only the days.  So, a… Read More »

PowerShell – Get All SQL Instances On Server

This script will return all SQL instances running on a server or list of servers. cls Import-Module -Name SQLPS -DisableNameChecking $servers = “SERVER_NAME”, “SERVER_NAME_2”, “ETC”; foreach($server in $servers) { $path = “SQLServer:\SQL\” + $server; $instances = Get-ChildItem -Path $path; $instances; }

PowerShell – Get “Logon As” Information From Remote (or local) Server

This was made possible by the Scripting Guy.  I have boiled it down to the answer. If you want to use PowerShell to query for the log on account that normally is displayed in the services.msc service properties window:   Here is the PowerShell script:   $server_name = "name_of_server"; $services = Get-WmiObject win32_service -ComputerName $server_name… Read More »